00001 #ifndef __J2K__MATRIX_DATA_HPP__ 00002 #define __J2K__MATRIX_DATA_HPP__ 00003 00004 #include <j2k/Fred/Basic.hpp> 00005 #include <j2k/Fred/StdTypes.hpp> 00006 #include <j2k/Fred/Math/Vector.hpp> 00007 00008 class MatrixData { 00009 public: 00010 // Default, copy, and sizing constructors. 00011 MatrixData(); 00012 MatrixData(const MatrixData& src); 00013 MatrixData(UINT nSize); 00014 virtual ~MatrixData(); 00015 00016 // Reference counting. 00017 void inc(); 00018 void dec(); 00019 BOOL isShared() const; 00020 00021 // Get the size of the matrix. 00022 UINT getSize() const; 00023 00024 // Comparison. 00025 BOOL equals(const MatrixData& src); 00026 00027 // Get and set elements. 00028 double Element(UINT nRow, UINT nCol) const; 00029 double& Element(UINT nRow, UINT nCol); 00030 00031 private: 00032 UINT size; 00033 double* elements; 00034 UINT ref; 00035 }; 00036 00037 #endif