?? matrix.h
字號:
// Matrix.h: interface for the CMatrix class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MATRIX_H__1D4A689F_CE10_42D0_95E8_9EC16E68ED32__INCLUDED_)
#define AFX_MATRIX_H__1D4A689F_CE10_42D0_95E8_9EC16E68ED32__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define TINY 1.0e-20
//矩陣類,用于矩陣的運算
class CMatrix
{
public:
double **m_mat;//矩陣指針
int m_row,m_col;//矩陣的行列
CMatrix(int);//重載構造函數
CMatrix(int,int);//重載構造函數
CMatrix (const CMatrix &);//顯式復制構造函數
void SetSize(int);
void SetSize(int,int);
virtual ~CMatrix();//析構函數
//操作符重載
CMatrix& operator =(CMatrix &);//矩陣賦值
CMatrix operator +(CMatrix &);//矩陣加法
CMatrix operator -(CMatrix &);//矩陣減法
CMatrix operator *(CMatrix &);//矩陣乘法
CMatrix operator !();//矩陣求逆
CMatrix operator ~();//矩陣轉置
double& operator ()(int,int);//取矩陣元素
CMatrix operator *(double);//矩陣與數相乘
friend CMatrix operator *(double d , CMatrix& m){return m*d;}//數與矩陣相乘
void Display();//矩陣顯示
//Dolittle分解求矩陣逆
protected:
void MatInverse(double** mat,int dim);
void MatLudcmp(double** mat, int, int*, double*);
void MatLubksb(double** mat, int, int*, double*);
};
#endif // !defined(AFX_MATRIX_H__1D4A689F_CE10_42D0_95E8_9EC16E68ED32__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -