00001 #ifndef __J2K__MATRIX_HPP__ 00002 #define __J2K__MATRIX_HPP__ 00003 00004 #include <j2k/Fred/Basic.hpp> 00005 #include <j2k/Fred/StdTypes.hpp> 00006 #include <j2k/Fred/Math/Vector.hpp> 00007 #include <j2k/Fred/Math/MatrixData.hpp> 00008 00009 // Matrix class. 00010 // Represents a square matrix of doubles. 00011 class Matrix 00012 { 00013 public: 00014 // Create an identity matrix. 00015 static Matrix Identity( UINT nSize ); 00016 00017 // Default, copy, and sizing constructors. 00018 Matrix(); 00019 Matrix( const Matrix& src ); 00020 Matrix( UINT nSize ); 00021 virtual ~Matrix(); 00022 00023 // Comparison and assignment operators. 00024 BOOL operator== ( const Matrix& right ) const; 00025 BOOL operator!= ( const Matrix& right ) const; 00026 const Matrix& operator= (const Matrix& right ); 00027 00028 // Get the size of the matrix. 00029 UINT getSize() const; 00030 00031 // Get and set elements. 00032 double operator()(UINT nRow, UINT nCol) const; 00033 double& operator()(UINT nRow, UINT nCol); 00034 00035 // Matrix multiplication. 00036 Matrix operator* (const Matrix& src) const; 00037 Vector operator* (const Vector& src) const; 00038 00039 Matrix transpose() const; 00040 void dump() const; 00041 00042 private: 00043 MatrixData* pData; 00044 }; 00045 00046 #endif