vecbse.h

Go to the documentation of this file.
00001 //
00002 //******************************************************************************
00003 //                    VECBSE.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 _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 //  Constructors
00067 //
00068     CAMvectorBase();
00069     CAMvectorBase( const CAMvectorBase& A);
00070     CAMvectorBase(int d_type);
00071     CAMvectorBase(int d_type, const CAMrange& R1); 
00072 //
00073 //  Destructor 
00074 //
00075     ~CAMvectorBase();
00076 //
00077 //  Assignment
00078 //
00079     void  operator = (double value);
00080     void  operator = (const CAMvectorBase& A);
00081     void  operator = (const CAMmatrixBase& A);
00082 //
00083 //  Output 
00084 //
00085     __IMPEXP__ friend ostream& operator <<(ostream& out_stream, const CAMvectorBase& A);
00086 //
00087 //  Input
00088 //
00089     __IMPEXP__ friend istream&  operator >>(istream& in_stream, CAMvectorBase& A);
00090 //
00091 //  Initialization Functions
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 //  Unary and Binary Operations
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  CAMvectorBase::getIndexBase() const; 
00115     long  CAMvectorBase::getIndexBound() const; 
00116     long  CAMvectorBase::getIndexStride() const; 
00117     long  CAMvectorBase::getIndexCount() const; 
00118     void  CAMvectorBase::setIndexBase(long i); 
00119     void  CAMvectorBase::setIndexStride(long i); 
00120 
00121 //
00122 //  Scaler Operations
00123 //
00124     CAMvectorBase  operator +(const double value) const;
00125     __IMPEXP__ friend CAMvectorBase  operator +(const double value, const CAMvectorBase& A);
00126     CAMvectorBase  operator -(const double value) const;
00127     __IMPEXP__ friend CAMvectorBase  operator -(const double value, const CAMvectorBase& A);
00128     void  operator +=(const double value);
00129     void  operator -=(const double value);
00130     CAMvectorBase  operator *(double value) const;
00131     __IMPEXP__ friend CAMvectorBase  operator *(double value, const CAMvectorBase& A);
00132     CAMvectorBase  operator /(double value) const;
00133     __IMPEXP__ friend CAMvectorBase  operator /(double value, const CAMvectorBase& A);
00134     void  operator *=(double value);
00135     void  operator /=(double value);
00136 //
00137 //  Additional Scalar Functions
00138 //
00139     void  setToValue(double value);
00140     CAMvectorBase  plusValue(double value);
00141     CAMvectorBase  minusValue(double value);
00142 //
00143 //  Helper Functions
00144 //
00145     void  setTemporaryFlag(){DataP->setTemporaryFlag();};
00146     void  initializeReturnArgument(const CAMstructureBase& S, int dataT);
00147     void  initializeReturnArgument(const CAMvectorBase& A);
00148     void  initializeMinDuplicate(const CAMvectorBase& A);
00149     void*  getDataPointer() const {return DataP->getDataPointer();};
00150     void*  getDataPointer(long i1, long i2) const; 
00151     CAMmatrixBase  asMatrix() const;
00152     CAMarrayBase  asArray() const;
00153 //
00154     long  getDimension() const {return 1;};
00155 //
00156 //  Reference Counting
00157 //
00158     void  incrementReferenceCount();
00159     void  decrementReferenceCount(){vectorBaseReferenceCount--;};
00160     int  getReferenceCount() const {return vectorBaseReferenceCount;};
00161     void  setReferenceCount(int refValue){vectorBaseReferenceCount = refValue;};
00162     static void  referenceCountError();
00163 //
00164 //  Error Handling Routines
00165 //
00166     static void  indexCheck(const CAMstructureBase &S, long i1, long i2);
00167     static void  indexErrorMessage(long indexDimension, long base, long bound, long index);
00168     static void  nonConformingMessage(const CAMstructureBase &A,const CAMstructureBase &B);
00169     static void  doubleConversionError(const CAMstructureBase& A);
00170     static void  objectConversionError(const CAMstructureBase& A);
00171     static void  nullOperandError();
00172     static void  nullOperandError(char* Operation);
00173     static void  inputSizeError();
00174 //
00175 //  Utility Functions
00176 //
00177     double  max() const;
00178     double  min() const;
00179     double  maxAbs() const;
00180     double  minAbs() const;
00181     double  infNorm() const;
00182     double  pNorm(int p) const;
00183     double  pNorm(long p) const;
00184     double  pNorm(float p) const;
00185     double  pNorm(double p) const;
00186 
00187     double dot(const CAMvectorBase& V) const; 
00188 
00189 //
00190 //  temporary and reference utility functions
00191 //
00192     void  exchangeContentsWith(CAMvectorBase& B);
00193     void  initializeReferenceDuplicate(const CAMvectorBase& B);
00194 
00195 };
00196 
00197 #endif
00198 //
00199 //********************************************************************************
00200 //                     Header File End 
00201 //********************************************************************************
00202 //
00203   

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