/* ---------------------------------------------------------------------------- MATRIX.hpp Contains the following objects: MATRIX General matrix object. not yet implemented VECTOR Vector of COMPLEX numbers, which through implementation of the * and ~ (inversion) operators will be used to hold a DIAGONAL matrix as well. */ #ifndef _MATRIX_ #define _MATRIX_ #include "extcode.h" // LabView's complex number defines #include "MISCTYPS.h" #include "COMPLEX.hpp" class VECTOR { //------------- Class construction/destruction public: VECTOR ( void ); VECTOR ( _COMPLEX *pVals ,uint Rows ); VECTOR ( cmplx64 *pVals ,uint Rows ); VECTOR ( uint Rows ); VECTOR ( VECTOR &refVECTOR ); VECTOR ( VECTOR *pVECTOR ); ~VECTOR ( void ); //------------- Class overloaded operators VECTOR operator *= ( _COMPLEX rhs ); VECTOR operator * ( _COMPLEX rhs ); friend VECTOR operator * ( _COMPLEX lhs ,VECTOR rhs ); VECTOR operator /= ( _COMPLEX rhs ); VECTOR operator / ( _COMPLEX rhs ); friend VECTOR operator / ( _COMPLEX lhs ,VECTOR rhs ); VECTOR operator += ( VECTOR &rhs ); // rhs means right hand side of equation VECTOR operator + ( VECTOR &rhs ); // Addition operator VECTOR operator -= ( VECTOR &rhs ); VECTOR operator - ( VECTOR &rhs ); // Subtraction VECTOR operator - ( void ); // Negation or unary minus VECTOR operator = ( VECTOR &rhs ); // Assignment operator VECTOR operator = ( double rhs ); VECTOR operator = ( _COMPLEX rhs ); uint operator == ( VECTOR &rhs ); uint operator != ( VECTOR &rhs ); _COMPLEX &operator [] ( uint Element ); // Lets us collapse a square diagonal matrix to a vector VECTOR operator *= ( VECTOR rhs ); // Element by element multiplication VECTOR operator * ( VECTOR rhs ); // Performs element by element multiplication VECTOR operator /= ( VECTOR rhs ); // Element by element division VECTOR operator / ( VECTOR rhs ); // Performs element by element division VECTOR operator ~ ( void ); // Performs element by element inversion //------------- Class methods void show ( void ); // dumps whole waveform int len ( void ); // Return length of vector double sumMag ( void ); // Sum of mags of all vector components VECTOR re ( void ); // Returns vector of just real components VECTOR im ( void ); // Returns vector of just imaginary components private: void vector ( _COMPLEX *pVals ,uint Rows ); // Performs common construction / re-initialization //------------- Member variables private: uint m_Rows; // Length of the vector _COMPLEX *m_pVals; // Pointer to vector's values uint m_Local; // Flag to tell us if values are local }; /* // For this project, I don't think we'll need general matricies, but this could change // so stub it out. class MATRIX { //------------- Class construction/destruction public: MATRIX ( void ); MATRIX ( double *pdVals ,uint Rows ,uint Cols ); MATRIX ( uint Rows ,uint Cols ); MATRIX ( MATRIX &refMATRIX ); MATRIX ( MATRIX *pMATRIX ); ~MATRIX ( void ); //------------- Class overloaded operators MATRIX &operator *= ( MATRIX &rhs ); // Multiplication of another matrix MATRIX operator * ( MATRIX &rhs ); // MATRIX &operator *= ( VECTOR &rhs ); // Multiplication of a vector MATRIX operator * ( VECTOR &rhs ); // MATRIX &operator += ( MATRIX &rhs ); // rhs means right hand side of equation MATRIX operator + ( MATRIX &rhs ); // Addition operator MATRIX &operator -= ( MATRIX &rhs ); MATRIX operator - ( MATRIX &rhs ); // Subtraction MATRIX operator - ( void ); // Negation or unary minus MATRIX &operator = ( MATRIX &rhs ); // Assignment operator //------------- Class methods void show ( void ); // dumps whole waveform private: void Init ( double *pdVals ,uint Rows ,uint Cols ); // Performs common initialization void copy ( MATRIX *pMATRIX ); // Workhorse copy construction //------------- Member variables public: uint m_Rows ,m_Cols; }; */ #endif