📄 matrix.h
字号:
//矩阵类声明:
//
//矩阵类的目的是为减化程序设计中文本数据的输入和输出,增加二维
//数组对一维指针、和二维指针的支持,并提供基本的矩阵运算功能。
//王仁铭 98.10月
class ifstream;
class ofstream;
class CMatrix
{
public:
int m_nCol;
int m_nRow;
double** m_pData;
CMatrix();//未定大小
CMatrix(int,int);//指定大小
CMatrix(int,int,double*);//根据一维指针生成CMatrix对象
CMatrix(CMatrix & m);//拷贝
virtual ~CMatrix();
CMatrix& operator=(CMatrix&);
CMatrix operator+(CMatrix&); //矩阵相加
void operator+=(CMatrix&); //矩阵相加
CMatrix operator-(CMatrix&); //矩阵相减
void operator-=(CMatrix&); //矩阵相减
CMatrix operator*(CMatrix&); //矩阵相乘
CMatrix operator*(double); //矩阵乘数
CMatrix operator!(); //求逆矩阵
CMatrix operator/(CMatrix&); //乘逆矩阵
operator double**(); //强制转换成二维指针
operator double*(); //强制转换成一维指针
double* operator[](int); //用二维指针存取数据
friend ifstream& operator>>(ifstream&,CMatrix&) ;
friend ofstream& operator<<(ofstream&,CMatrix&) ;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -