Vector.h
Go to the documentation of this file.
00001 #ifndef __NEW_MAT_VECTOR_H__
00002 #define __NEW_MAT_VECTOR_H__
00003 
00005 class RowVector : public Matrix
00006 {
00007    GeneralMatrix* Image() const;                // copy of matrix
00008 public:
00009    RowVector() { nrows_val = 1; }
00010    ~RowVector() {}
00011    RowVector(ArrayLengthSpecifier n) : Matrix(1,n.Value()) {}
00012    RowVector(const BaseMatrix&);
00013    RowVector(const RowVector& gm) : Matrix() { GetMatrix(&gm); }
00014    void operator=(const BaseMatrix&);
00015    void operator=(Real f) { GeneralMatrix::operator=(f); }
00016    void operator=(const RowVector& m) { Eq(m); }
00017    Real& operator()(int);                       // access element
00018    Real& element(int);                          // access element
00019    Real operator()(int) const;                  // access element
00020    Real element(int) const;                     // access element
00021 #ifdef SETUP_C_SUBSCRIPTS
00022    Real& operator[](int m) { return store[m]; }
00023    const Real& operator[](int m) const { return store[m]; }
00024    // following for Numerical Recipes in C++
00025    RowVector(Real a, int n) : Matrix(a, 1, n) {}
00026    RowVector(const Real* a, int n) : Matrix(a, 1, n) {}
00027 #endif
00028    MatrixType type() const;
00029    void GetCol(MatrixRowCol&);
00030    void GetCol(MatrixColX&);
00031    void NextCol(MatrixRowCol&);
00032    void NextCol(MatrixColX&);
00033    void RestoreCol(MatrixRowCol&) {}
00034    void RestoreCol(MatrixColX& c);
00035    GeneralMatrix* Transpose(TransposedMatrix*, MatrixType);
00036    void resize(int);                       // change dimensions
00037    void ReSize(int m) { resize(m); }
00038    void resize_keep(int);
00039    void resize_keep(int,int);
00040    void resize(int,int);                   // in case access is matrix
00041    void ReSize(int m,int n) { resize(m, n); }
00042    void resize(const GeneralMatrix& A);
00043    void ReSize(const GeneralMatrix& A) { resize(A); }
00044    Real* nric() const
00045       { CheckStore(); return store-1; }         // for use by NRIC
00046    void cleanup();                              // to clear store
00047    void MiniCleanUp()
00048       { store = 0; storage = 0; nrows_val = 1; ncols_val = 0; tag_val = -1; }
00049    // friend ReturnMatrix GetMatrixRow(Matrix& A, int row);
00050    void operator+=(const Matrix& M) { PlusEqual(M); }
00051    void operator-=(const Matrix& M) { MinusEqual(M); }
00052    void operator+=(Real f) { GeneralMatrix::Add(f); }
00053    void operator-=(Real f) { GeneralMatrix::Add(-f); }
00054    void swap(RowVector& gm)
00055       { GeneralMatrix::swap((GeneralMatrix&)gm); }
00056    NEW_DELETE(RowVector)
00057 };
00058 
00060 class ColumnVector : public Matrix
00061 {
00062    GeneralMatrix* Image() const;                // copy of matrix
00063 public:
00064    ColumnVector() { ncols_val = 1; }
00065    ~ColumnVector() {}
00066    ColumnVector(ArrayLengthSpecifier n) : Matrix(n.Value(),1) {}
00067    ColumnVector(const BaseMatrix&);
00068    ColumnVector(const ColumnVector& gm) : Matrix() { GetMatrix(&gm); }
00069    void operator=(const BaseMatrix&);
00070    void operator=(Real f) { GeneralMatrix::operator=(f); }
00071    void operator=(const ColumnVector& m) { Eq(m); }
00072    Real& operator()(int);                       // access element
00073    Real& element(int);                          // access element
00074    Real operator()(int) const;                  // access element
00075    Real element(int) const;                     // access element
00076 #ifdef SETUP_C_SUBSCRIPTS
00077    Real& operator[](int m) { return store[m]; }
00078    const Real& operator[](int m) const { return store[m]; }
00079    // following for Numerical Recipes in C++
00080    ColumnVector(Real a, int m) : Matrix(a, m, 1) {}
00081    ColumnVector(const Real* a, int m) : Matrix(a, m, 1) {}
00082 #endif
00083    MatrixType type() const;
00084    GeneralMatrix* Transpose(TransposedMatrix*, MatrixType);
00085    void resize(int);                       // change dimensions
00086    void ReSize(int m) { resize(m); }
00087    void resize_keep(int);
00088    void resize_keep(int,int);
00089    void resize(int,int);                   // in case access is matrix
00090    void ReSize(int m,int n) { resize(m, n); }
00091    void resize(const GeneralMatrix& A);
00092    void ReSize(const GeneralMatrix& A) { resize(A); }
00093    Real* nric() const
00094       { CheckStore(); return store-1; }         // for use by NRIC
00095    void cleanup();                              // to clear store
00096    void MiniCleanUp()
00097       { store = 0; storage = 0; nrows_val = 0; ncols_val = 1; tag_val = -1; }
00098 //   ReturnMatrix Reverse() const;                // reverse order of elements
00099    void operator+=(const Matrix& M) { PlusEqual(M); }
00100    void operator-=(const Matrix& M) { MinusEqual(M); }
00101    void operator+=(Real f) { GeneralMatrix::Add(f); }
00102    void operator-=(Real f) { GeneralMatrix::Add(-f); }
00103    void swap(ColumnVector& gm)
00104       { GeneralMatrix::swap((GeneralMatrix&)gm); }
00105    NEW_DELETE(ColumnVector)
00106 };
00107 
00108 #endif
00109 


lo
Author(s): U. Klank
autogenerated on Mon Oct 6 2014 10:44:15