matbse.h

Go to the documentation of this file.
00001 //
00002 //******************************************************************************
00003 //                    MATBSE.H
00004 //******************************************************************************
00005 //
00006 
00007 #include <iostream.h>
00008 #include <string.h>
00009 #include "strctbse.h"
00010 #include "datahndl.h"
00011 #include "access.h"
00012 #include "mvaexit.h"
00013 #include "camtype.h"
00014 #include "typehndl.h"
00015 
00016 //
00017 //  
00018 //
00019 //
00020 //********************************************************************************
00021 //
00022 //            Chris Anderson  (C) UCLA
00023 //
00024 //            Tue Apr 16 11:30:42 1996
00025 //
00026 //********************************************************************************
00027 //
00028 #ifndef __NO_COMPLEX__
00029 #define __NO_COMPLEX__
00030 #endif
00031 //
00032 //
00033 #include "mvaimpexp.h" // C
00034 //
00035 //
00036 #ifndef _CAMARRAYBASE_
00037 class CAMarrayBase;
00038 #endif
00039 #ifndef _CAMVECTORBASE_
00040 class CAMvectorBase;
00041 #endif
00042 //
00043 //  
00044 //
00045 
00046 #ifndef _CAMMATRIXBASE_
00047 #define _CAMMATRIXBASE_
00048 
00049 
00050 class __IMPEXP__ CAMmatrixBase
00051 {
00052 
00053 public :
00054 
00055     CAMstructureBase  Structure;
00056     CAMdataHandler*  DataP;
00057     int  typeValue;
00058     int  referenceFlag;
00059     long  matrixBaseReferenceCount;
00060 
00061 public :
00062 
00063     friend class CAMvectorBase;
00064 
00065 //
00066 //  Constructors
00067 //
00068     CAMmatrixBase();
00069     CAMmatrixBase( const CAMmatrixBase& A);
00070     CAMmatrixBase(int d_type);
00071     CAMmatrixBase(int d_type, const CAMrange& R1, const CAMrange& R2); 
00072 //
00073 //  Destructor 
00074 //
00075     ~CAMmatrixBase();
00076 //
00077 //  Assignment
00078 //
00079     void  operator = (double value);
00080     void  operator = (const CAMmatrixBase& A);
00081     void  operator = (const CAMvectorBase& A);
00082 //
00083 //  Output 
00084 //
00085     __IMPEXP__ friend ostream& operator <<(ostream& out_stream, const CAMmatrixBase& A);
00086 //
00087 //  Input
00088 //
00089     __IMPEXP__ friend istream&  operator >>(istream& in_stream, CAMmatrixBase& A);
00090 //
00091 //  Initialization Functions
00092 //
00093     void  initialize();
00094     void  initialize(const CAMmatrixBase& A);
00095     void  initialize(int d_type);
00096     void  initialize(int d_type, const CAMrange& R1, const CAMrange& R2); 
00097 //
00098 //  Unary and Binary Operations
00099 //
00100     CAMmatrixBase  operator-() const;
00101     CAMmatrixBase  operator+(const CAMmatrixBase& A) const;
00102     CAMmatrixBase  operator+(const CAMvectorBase& A) const;
00103     CAMmatrixBase  operator-(const CAMmatrixBase& A) const;
00104     CAMmatrixBase  operator-(const CAMvectorBase& A) const;
00105     CAMmatrixBase  operator*(const CAMmatrixBase& A) const;
00106     CAMvectorBase  operator*(const CAMvectorBase& A) const;
00107     CAMmatrixBase  operator/(const CAMmatrixBase& A) const;
00108     CAMvectorBase  operator/(const CAMvectorBase& A) const;
00109     void  operator+=(const CAMmatrixBase& A);
00110     void  operator+=(const CAMvectorBase& A);
00111     void  operator-=(const CAMmatrixBase& A);
00112     void  operator-=(const CAMvectorBase& A);
00113     void  operator*=(const CAMmatrixBase& A);
00114     void  operator*=(const CAMvectorBase& A);
00115     void  operator/=(const CAMmatrixBase& A);
00116     void  operator/=(const CAMvectorBase& A);
00117     CAMmatrixBase transpose() const;
00118     CAMmatrixBase operator~() const; 
00119 //
00120 //  Scaler Operations
00121 //
00122     CAMmatrixBase  operator +(const double value) const;
00123     __IMPEXP__ friend CAMmatrixBase  operator +(const double value, const CAMmatrixBase& A);
00124     CAMmatrixBase  operator -(const double value) const;
00125     __IMPEXP__ friend CAMmatrixBase  operator -(const double value, const CAMmatrixBase& A);
00126     void  operator +=(const double value);
00127     void  operator -=(const double value);
00128     CAMmatrixBase  operator *(double value) const;
00129     __IMPEXP__ friend CAMmatrixBase  operator *(double value, const CAMmatrixBase& A);
00130     CAMmatrixBase  operator /(double value) const;
00131     __IMPEXP__ friend CAMmatrixBase  operator /(double value, const CAMmatrixBase& A);
00132     void  operator *=(double value);
00133     void  operator /=(double value);
00134 //
00135 //  Additional Scalar Functions
00136 //
00137     void  setToValue(double value);
00138     CAMmatrixBase  plusValue(double value);
00139     CAMmatrixBase  minusValue(double value);
00140 //
00141 //  Helper Functions
00142 //
00143     void  setTemporaryFlag(){DataP->setTemporaryFlag();};
00144     void  initializeReturnArgument(const CAMstructureBase& S, int dataT);
00145     void  initializeReturnArgument(const CAMmatrixBase& A);
00146     void  initializeMinDuplicate(const CAMmatrixBase& A);
00147     void*  getDataPointer() const {return DataP->getDataPointer();};
00148     void*  getDataPointer(long i1, long i2) const; 
00149     CAMarrayBase  asArray() const;
00150     CAMvectorBase  asVector() const;
00151 //
00152 //  Structure Functions
00153 //
00154     const CAMstructureBase&  operator[](long i) const;
00155     CAMstructureBase&  operator[](long i);
00156     void  setAllIndexBase(long i){Structure.setAllIndexBase(i);};
00157     long  getDimension() const {return Structure.getDimension();};
00158 //
00159 //  Reference Counting
00160 //
00161     void  incrementReferenceCount();
00162     void  decrementReferenceCount(){matrixBaseReferenceCount--;};
00163     int  getReferenceCount() const {return matrixBaseReferenceCount;};
00164     void  setReferenceCount(int refValue){matrixBaseReferenceCount = refValue;};
00165     static void  referenceCountError();
00166 //
00167 //  Error Handling Routines
00168 //
00169     static void  indexCheck(const CAMstructureBase &S, long i1, long i2);
00170     static void  indexErrorMessage(long indexDimension, long base, long bound, long index);
00171     static void  nonConformingMessage(const CAMstructureBase &A,const CAMstructureBase &B);
00172     static void  doubleConversionError(const CAMstructureBase& A);
00173     static void  nonSquareMessage(); 
00174     static void  objectConversionError(const CAMstructureBase& A);
00175     static void  nullOperandError();
00176     static void  nullOperandError(char* Operation);
00177     static void  inputSizeError();
00178 //
00179 //  Utility Functions
00180 //
00181     double  max() const;
00182     double  min() const;
00183     double  maxAbs() const;
00184     double  minAbs() const;
00185     double  infNorm() const;
00186     double  pNorm(int p) const;
00187     double  pNorm(long p) const;
00188     double  pNorm(float p) const;
00189     double  pNorm(double p) const;
00190 // 
00191 //  Matrix Specific Utility Routines  
00192 //
00193     CAMmatrixBase inverse() const;
00194 //
00195 //  temporary and reference utility functions
00196 //
00197     void  exchangeContentsWith(CAMmatrixBase& B);
00198     void  initializeReferenceDuplicate(const CAMmatrixBase& B);
00199 
00200 };
00201 
00202 #endif
00203 //
00204 //********************************************************************************
00205 //                     Header File End 
00206 //********************************************************************************
00207 //
00208   

Generated on Wed Aug 6 12:58:47 2003 for Open-Sessame Framework by doxygen1.3