00001
00002
00003
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
00023
00024
00025
00026
00027
00028 #ifndef __NO_COMPLEX__
00029 #define __NO_COMPLEX__
00030 #endif
00031
00032
00033 #include "mvaimpexp.h"
00034
00035
00036 #ifndef _CAMMATRIXBASE_
00037 class CAMmatrixBase;
00038 #endif
00039 #ifndef _CAMVECTORBASE_
00040 class CAMvectorBase;
00041 #endif
00042
00043
00044
00045
00046 #ifndef _CAMARRAYBASE_
00047 #define _CAMARRAYBASE_
00048
00049
00050 class __IMPEXP__ CAMarrayBase
00051 {
00052
00053 public :
00054
00055 CAMstructureBase Structure;
00056 CAMdataHandler* DataP;
00057 int typeValue;
00058 int referenceFlag;
00059 long arrayBaseReferenceCount;
00060
00061 public :
00062
00063
00064
00065
00066 CAMarrayBase();
00067 CAMarrayBase( const CAMarrayBase& A);
00068 CAMarrayBase(int d_type);
00069 CAMarrayBase(int d_type, const CAMrange& R1, const CAMrange& R2 = CAMnullRange,
00070 const CAMrange& R3 = CAMnullRange, const CAMrange&R4 = CAMnullRange,
00071 const CAMrange& R5 = CAMnullRange, const CAMrange&R6 = CAMnullRange,
00072 const CAMrange& R7 = CAMnullRange);
00073
00074
00075
00076 ~CAMarrayBase();
00077
00078
00079
00080 void operator = (double value);
00081 void operator = (const CAMarrayBase& A);
00082
00083
00084
00085 __IMPEXP__ friend ostream& operator <<(ostream& out_stream, const CAMarrayBase& A);
00086
00087
00088
00089 __IMPEXP__ friend istream& operator >>(istream& in_stream, CAMarrayBase& A);
00090
00091
00092
00093 void initialize();
00094 void initialize(const CAMarrayBase& A);
00095 void initialize(int d_type);
00096 void initialize(int d_type, const CAMrange& R1, const CAMrange& R2 = CAMnullRange,
00097 const CAMrange& R3 = CAMnullRange, const CAMrange&R4 = CAMnullRange,
00098 const CAMrange& R5 = CAMnullRange, const CAMrange&R6 = CAMnullRange,
00099 const CAMrange& R7 = CAMnullRange);
00100
00101
00102
00103 CAMarrayBase operator-() const;
00104 CAMarrayBase operator+(const CAMarrayBase& A) const;
00105 CAMarrayBase operator-(const CAMarrayBase& A) const;
00106 CAMarrayBase operator*(const CAMarrayBase& A) const;
00107 CAMarrayBase operator/(const CAMarrayBase& A) const;
00108 void operator+=(const CAMarrayBase& A);
00109 void operator-=(const CAMarrayBase& A);
00110 void operator*=(const CAMarrayBase& A);
00111 void operator/=(const CAMarrayBase& A);
00112
00113
00114
00115 CAMarrayBase operator +(const double value) const;
00116 __IMPEXP__ friend CAMarrayBase operator +(const double value, const CAMarrayBase& A);
00117 CAMarrayBase operator -(const double value) const;
00118 __IMPEXP__ friend CAMarrayBase operator -(const double value, const CAMarrayBase& A);
00119 void operator +=(const double value);
00120 void operator -=(const double value);
00121 CAMarrayBase operator *(double value) const;
00122 __IMPEXP__ friend CAMarrayBase operator *(double value, const CAMarrayBase& A);
00123 CAMarrayBase operator /(double value) const;
00124 __IMPEXP__ friend CAMarrayBase operator /(double value, const CAMarrayBase& A);
00125 void operator *=(double value);
00126 void operator /=(double value);
00127
00128
00129
00130 void setToValue(double value);
00131 CAMarrayBase plusValue(double value);
00132 CAMarrayBase minusValue(double value);
00133
00134
00135
00136 void setTemporaryFlag(){DataP->setTemporaryFlag();};
00137 void initializeReturnArgument(const CAMstructureBase& S, int dataT);
00138 void initializeReturnArgument(const CAMarrayBase& A);
00139 void initializeMinDuplicate(const CAMarrayBase& A);
00140 void* getDataPointer() const {return DataP->getDataPointer();};
00141 void* getDataPointer(long i1, long i2 = 0, long i3 = 0, long i4 = 0,
00142 long i5 =0, long i6 = 0, long i7 = 0) const;
00143 CAMmatrixBase asMatrix() const;
00144 CAMvectorBase asVector() const;
00145
00146
00147
00148 const CAMstructureBase& operator[](long i) const;
00149 CAMstructureBase& operator[](long i);
00150 void setAllIndexBase(long i){Structure.setAllIndexBase(i);};
00151 long getDimension() const {return Structure.getDimension();};
00152
00153
00154
00155 void incrementReferenceCount();
00156 void decrementReferenceCount(){arrayBaseReferenceCount--;};
00157 int getReferenceCount() const {return arrayBaseReferenceCount;};
00158 void setReferenceCount(int refValue){arrayBaseReferenceCount = refValue;};
00159 static void referenceCountError();
00160
00161
00162
00163 static void indexCheck(const CAMstructureBase &S, long i1);
00164 static void indexCheck(const CAMstructureBase &S, long i1, long i2);
00165 static void indexCheck(const CAMstructureBase &S, long i1, long i2, long i3);
00166 static void indexCheck(const CAMstructureBase &S, long i1, long i2, long i3, long i4);
00167 static void indexCheck(const CAMstructureBase &S, long i1, long i2, long i3, long i4, long i5);
00168 static void indexCheck(const CAMstructureBase &S, long i1, long i2, long i3, long i4, long i5, long i6);
00169 static void indexCheck(const CAMstructureBase &S, long i1, long i2, long i3, long i4, long i5, long i6, long i7);
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 objectConversionError(const CAMstructureBase& A);
00174 static void nullOperandError();
00175 static void nullOperandError(char* Operation);
00176 static void inputSizeError();
00177
00178
00179
00180 double max() const;
00181 double min() const;
00182 double maxAbs() const;
00183 double minAbs() const;
00184 double infNorm() const;
00185 double pNorm(int p) const;
00186 double pNorm(long p) const;
00187 double pNorm(float p) const;
00188 double pNorm(double p) const;
00189
00190
00191
00192 void exchangeContentsWith(CAMarrayBase& B);
00193 void initializeReferenceDuplicate(const CAMarrayBase& B);
00194
00195 };
00196
00197 #endif
00198
00199
00200
00201
00202
00203
00204
00205