CMatrix类的实现
1、头文件声明:CMatrix.h
#ifndef CMATRIX_H
#define CMATRIX_H
#include <iostream>
using namespace std;
class CMatrix
{
public:
CMatrix();
CMatrix(int nRow, int nCOl, double* pData = NULL);
CMatrix(const CMatrix& m);
CMatrix(const char* strPath);
~CMatrix();
bool Create(int nRow, int nCol, double* pData = NULL);
void Release();
void Set(int nRow, int nCol, double dVale);
friend istream& operator>>(istream& is, CMatrix& m);
friend ostream& operator<<(ostream& os, const CMatrix& m);
CMatrix& operator=(const CMatrix& m);
CMatrix& operator+=(const CMatrix& m);
CMatrix& operator-=(const CMatrix& m);
bool operator == (const CMatrix& m);
bool operator != (const CMatrix& m);
double& operator[](int nIndex);
double& operator()(int nRow, int nCol);
operator double();
private:
int m_nRow;
int m_nCol;
double* m_pData = NULL;
};
CMatrix operator+(const CMatrix& m1, const CMatrix& m2);
CMatrix operator-(const CMatrix& m1, const CMatrix& m2);
inline void CMatrix::Set</