SIBCMatrixMNd.h

Go to the documentation of this file.
00001 //***************************************************************************************
00002 // File supervisor: Crosswalk team
00012 //***************************************************************************************
00013 
00014 
00015 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00016 #pragma once
00017 #endif
00018 
00019 //******************************************************************************
00020 // Defines
00021 //******************************************************************************
00022 
00023 #ifndef _MATRIXMN_H_
00024 #define _MATRIXMN_H_
00025 
00026 //******************************************************************************
00027 // Includes
00028 //******************************************************************************
00029 #include "SIBCMathLib.h"
00030 
00031 //******************************************************************************
00032 // CSIBCMatrixMNd | General MXN matrix.
00033 //******************************************************************************
00034 
00048 class XSICOREEXPORT CSIBCMatrixMNd
00049 {
00050     // Public members
00051     public:
00052 
00053         //****************************************
00054         // Constructors/destructor:
00055         //****************************************
00056 
00060         CSIBCMatrixMNd();
00061 
00062         // Destructor.
00063          ~CSIBCMatrixMNd();
00064 
00065         //****************************************
00066         // Matrix modification functions:
00067         //****************************************
00068 
00079         bool SetDimensions(const int in_M, const int in_N);
00080 
00087         bool Set( const CSIBCMatrixMNd& in_mat);
00088 
00095         void Copy( const CSIBCMatrixMNd& in_mat);
00096 
00101         CSIBCMatrixMNd& Transpose(const CSIBCMatrixMNd& in_mat);
00102 
00103         //****************************************
00104         // General access functions:
00105         //****************************************
00106 
00112         int GetNbRow( void ) const;
00113 
00119         int GetNbCol( void ) const;
00120 
00127         double Get( const int in_nRow, const int in_nCol ) const;
00128 
00129         //****************************************
00130         // Matrix element modification functions:
00131         //****************************************
00132 
00140         void Set( int in_nRow, int in_nCol, const double in_dVal );
00141 
00145         void SetIdentity( void );
00146 
00147         //****************************************
00148         // Matrix algebra functions:
00149         //****************************************
00150 
00160         CSIBCMatrixMNd& Mul( const CSIBCMatrixMNd& in_mat1, const CSIBCMatrixMNd& in_mat2 );
00161 
00170         bool Mul( const CSIBCMatrixMNd& in_mat );
00171 
00179         bool LeftMul( const CSIBCMatrixMNd& in_mat );
00180 
00186         bool GrevilleInverse(const CSIBCMatrixMNd& in_mat);
00187 
00196         bool GrevilleInverse(const CSIBCMatrixMNd& in_mat, const unsigned int in_NbRow, const unsigned int in_NbCol);
00197 
00207         CSIBCMatrixMNd& Add( const CSIBCMatrixMNd& in_mat1, const CSIBCMatrixMNd& in_mat2);
00208 
00218         CSIBCMatrixMNd& Sub( const CSIBCMatrixMNd& in_mat1, const CSIBCMatrixMNd& in_mat2);
00219 
00228         CSIBCMatrixMNd& Add( const CSIBCMatrixMNd& in_mat );
00229 
00238         CSIBCMatrixMNd& Sub( const CSIBCMatrixMNd& in_mat );
00239 
00240     // Protected members
00241     protected:
00242 
00243         //****************************************
00244         // Protected data
00245         //****************************************
00246 
00247     // Private members
00248     private:
00249         //****************************************
00250         // Matrix algebra functions:
00251         //****************************************
00252 
00253         // Output the inverse of the input vector.
00254         void InverseVector(double *in_pdVct, double * out_pdInvVct, int in_len);
00255 
00256         // Returns the sum of the absolute values of elements in vector.
00257         double SumAbsVal( double *in_pdVct, int in_len);
00258 
00259         //****************************************
00260         // Private data
00261         //****************************************
00262 
00263         //  Number of rows in the matrix (M)
00264         int m_nRow;
00265 
00266         //  Number of columns in the matrix (N)
00267         int m_nCol;
00268 
00269         //  Pointer to MXN Matrix
00270         double**    m_dMatrixMN;
00271 
00273         // Debugging goodies
00275 
00276         //Disable copy constructor and operator =
00277         CSIBCMatrixMNd ( const CSIBCMatrixMNd& in_matrix );
00278 
00279         // Assignment operator.
00280         CSIBCMatrixMNd& operator =( const CSIBCMatrixMNd& in_matrix );
00281 };
00282 
00283 #endif // _MATRIXMN_H_