matrix1.h

来自「该软件是我读硕士的时候写的」· C头文件 代码 · 共 57 行

H
57
字号
// Matrix.h: interface for the CMatrix1 class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MATRIX_H__97E8AC2E_203C_415E_9855_C22338559D82__INCLUDED_)
#define AFX_MATRIX_H__97E8AC2E_203C_415E_9855_C22338559D82__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CMatrix1  
{
public:
	CMatrix1();
	virtual ~CMatrix1();
	
public:
   
    CMatrix1(int nRows,int nCols);
    CMatrix1(int nRows,int nCols,double value[]);
//	CMatrix1(int nSize);
//    CMatrix1(int nSize,double value[]);
    CMatrix1(const CMatrix1& other);

	BOOL Init(int nRows,int nCols);
	BOOL MakeUnitMatrix(int nSize);
	
	BOOL SetElement(int nRows,int nCols,double value);
	double GetElement(int nRows,int nCols) const;
	void SetData(double value[]) ;
	double* GetData() const;
	int GetNumColumns() const;
    int GetNumRows() const;

	void MulData(CMatrix1 CM1,CMatrix1 CM2) ;
	
	CMatrix1& operator=(const CMatrix1& other);
	CMatrix1 operator+(const CMatrix1& other) const;
	CMatrix1 operator-(const CMatrix1& other) const;
	CMatrix1 operator*(double value) const;
	CMatrix1 operator*(const CMatrix1& other) const;
	
	//矩阵的转秩
	CMatrix1 Transpose() const;
	//实矩阵求逆的全选主元高斯-约当法
	BOOL InvertGaussJordan();
	
public:
    int m_nNumColumns;
    int m_nNumRows;
    double *m_pData;

};

#endif // !defined(AFX_MATRIX_H__97E8AC2E_203C_415E_9855_C22338559D82__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?