class CMatrix
{
public:
CMatrix(){m_pData = 0;}
CMatrix(int rows, int cols) : m_iRows(rows), m_iCols(cols)
{
pData = new double[m_iRows * m_iCols];
//Generate data here
}
~CMatrix()
{
if(pData) delete []pData;
}
CMatrix& operator=(CMatrix& other);
double* operator[](int row)
{
return m_pData + row*m_iCols;
}
CMatrix& operator+(CMatrix& mat);
CMatrix& operator-(CMatrix& mat);
CMatrix& operator*(CMatrix& mat);
CMatrix& operator*(double c);
CMatrix& operator/(double c);
CMatrix& trans();//transpose
CMatrix& inv();//inverse
double det();//determinant
private:
int m_iRows, m_iCols;
double *m_pData;
}