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 _CAMARRAYBASE_
00040 class CAMarrayBase;
00041 #endif
00042
00043
00044
00045
00046 #ifndef _CAMVECTORBASE_
00047 #define _CAMVECTORBASE_
00048
00049
00050 class __IMPEXP__ CAMvectorBase
00051 {
00052
00053 public :
00054
00055 CAMstructureBase Structure;
00056 CAMdataHandler* DataP;
00057 int typeValue;
00058 int referenceFlag;
00059 long vectorBaseReferenceCount;
00060
00061 public :
00062
00063 friend class CAMmatrixBase;
00064
00065
00066
00067
00068 CAMvectorBase();
00069 CAMvectorBase( const CAMvectorBase& A);
00070 CAMvectorBase(int d_type);
00071 CAMvectorBase(int d_type, const CAMrange& R1);
00072
00073
00074
00075 ~CAMvectorBase();
00076
00077
00078
00079 void operator = (double value);
00080 void operator = (const CAMvectorBase& A);
00081 void operator = (const CAMmatrixBase& A);
00082
00083
00084
00085 __IMPEXP__ friend ostream& operator <<(ostream& out_stream, const CAMvectorBase& A);
00086
00087
00088
00089 __IMPEXP__ friend istream& operator >>(istream& in_stream, CAMvectorBase& A);
00090
00091
00092
00093 void initialize();
00094 void initialize(const CAMvectorBase& A);
00095 void initialize(int d_type);
00096 void initialize(int d_type, const CAMrange& R1);
00097
00098
00099
00100 CAMvectorBase operator-() const;
00101 CAMvectorBase operator+(const CAMvectorBase& A) const;
00102 CAMmatrixBase operator+(const CAMmatrixBase& A) const;
00103 CAMvectorBase operator-(const CAMvectorBase& A) const;
00104 CAMmatrixBase operator-(const CAMmatrixBase& A) const;
00105 CAMmatrixBase operator*(const CAMvectorBase& A) const;
00106 CAMvectorBase operator*(const CAMmatrixBase& A) const;
00107 void operator+=(const CAMvectorBase& A);
00108 void operator+=(const CAMmatrixBase& A);
00109 void operator-=(const CAMvectorBase& A);
00110 void operator-=(const CAMmatrixBase& A);
00111 CAMvectorBase operator~() const;
00112 CAMvectorBase transpose() const;
00113
00114 long getIndexBase() const;
00115 long getIndexBound() const;
00116 long getIndexStride() const;
00117 long getIndexCount() const;
00118 void setIndexBase(long i);
00119 void setIndexStride(long i);
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 CAMvectorBase operator +(const double value) const;
00132 __IMPEXP__ friend CAMvectorBase operator +(const double value, const CAMvectorBase& A);
00133 CAMvectorBase operator -(const double value) const;
00134 __IMPEXP__ friend CAMvectorBase operator -(const double value, const CAMvectorBase& A);
00135 void operator +=(const double value);
00136 void operator -=(const double value);
00137 CAMvectorBase operator *(double value) const;
00138 __IMPEXP__ friend CAMvectorBase operator *(double value, const CAMvectorBase& A);
00139 CAMvectorBase operator /(double value) const;
00140 __IMPEXP__ friend CAMvectorBase operator /(double value, const CAMvectorBase& A);
00141 void operator *=(double value);
00142 void operator /=(double value);
00143
00144
00145
00146 void setToValue(double value);
00147 CAMvectorBase plusValue(double value);
00148 CAMvectorBase minusValue(double value);
00149
00150
00151
00152 void setTemporaryFlag(){DataP->setTemporaryFlag();};
00153 void initializeReturnArgument(const CAMstructureBase& S, int dataT);
00154 void initializeReturnArgument(const CAMvectorBase& A);
00155 void initializeMinDuplicate(const CAMvectorBase& A);
00156 void* getDataPointer() const {return DataP->getDataPointer();};
00157 void* getDataPointer(long i1, long i2) const;
00158 CAMmatrixBase asMatrix() const;
00159 CAMarrayBase asArray() const;
00160
00161 long getDimension() const {return 1;};
00162
00163
00164
00165 void incrementReferenceCount();
00166 void decrementReferenceCount(){vectorBaseReferenceCount--;};
00167 int getReferenceCount() const {return vectorBaseReferenceCount;};
00168 void setReferenceCount(int refValue){vectorBaseReferenceCount = refValue;};
00169 static void referenceCountError();
00170
00171
00172
00173 static void indexCheck(const CAMstructureBase &S, long i1, long i2);
00174 static void indexErrorMessage(long indexDimension, long base, long bound, long index);
00175 static void nonConformingMessage(const CAMstructureBase &A,const CAMstructureBase &B);
00176 static void doubleConversionError(const CAMstructureBase& A);
00177 static void objectConversionError(const CAMstructureBase& A);
00178 static void nullOperandError();
00179 static void nullOperandError(char* Operation);
00180 static void inputSizeError();
00181
00182
00183
00184 double max() const;
00185 double min() const;
00186 double maxAbs() const;
00187 double minAbs() const;
00188 double infNorm() const;
00189 double pNorm(int p) const;
00190 double pNorm(long p) const;
00191 double pNorm(float p) const;
00192 double pNorm(double p) const;
00193
00194 double dot(const CAMvectorBase& V) const;
00195
00196
00197
00198
00199 void exchangeContentsWith(CAMvectorBase& B);
00200 void initializeReferenceDuplicate(const CAMvectorBase& B);
00201
00202 };
00203
00204 #endif
00205
00206
00207
00208
00209
00210