📄 matrix.h
字号:
//matrix.h //矩阵类及其运算
#if !defined(_MATRIX_H)
#define _MATRIX_H
#include <iostream.h>
class CMatrix
{
public:
CMatrix(){}
void set(int row,int col); //设置矩钲的行列数
CMatrix(int row,int col); //构造
~CMatrix() {delete[] elem;} //析构
double& operator()(int x, int y) ;
double operator()(int x, int y) const ; //const?
int getrow(){return row;}
int getcol(){return col;}
double getmod(); //求向量的模
double getval(){}
CMatrix invert(); //求矩阵的转置
double mult(const CMatrix& b);
friend CMatrix operator+(const CMatrix& a, const CMatrix& b);
friend CMatrix operator-(const CMatrix& a, const CMatrix& b);
friend CMatrix operator*(double a, const CMatrix& b);
friend CMatrix operator*(const CMatrix& a, const CMatrix& b);
friend CMatrix operator/(const CMatrix& b,double a);
friend ostream& operator<<(ostream& out,const CMatrix& a);
CMatrix& operator =(const CMatrix& m); //赋值
CMatrix(const CMatrix& m); //初始化拷贝
private:
int row,col;
double *elem;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -