⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 matrix.h

📁 摄影测量中进行后方交会的程序
💻 H
字号:
// Matrix.h: interface for the CMatrix class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MATRIX_H__BF29AB98_8F8D_4BBC_8171_4ADD41EE27F9__INCLUDED_)
#define AFX_MATRIX_H__BF29AB98_8F8D_4BBC_8171_4ADD41EE27F9__INCLUDED_

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


class CMatrix//矩阵基本功能实现类 
{
public:
	int Initate(int iRowNum, int iLineNum);
	double GetElement(int iRow, int iLine);
	void CreateData(double *a,int m,int n);//数据的输入
	void transpose();//矩阵转置
	void DisplayMatrix();//显示矩阵
	bool ChangeLine(int m, int n);//换列
	bool ChangeRow(int m,int n);//换行
	bool InsertLine(int *m,double *a,int n,int t);//m[]必须按升序排列,在矩阵第m[i]列中加一列a[][i],原先的该列往左移,n为a[][]的行数,t为a[][]的列数	
	bool InsertRow(int *m,double *a,int n,int t);//m[]必须按升序排列,在矩阵第m[i]行中加一行a[i][],原先的该行往下移,n为a[][]的行数,t为a[][]的列数
//////////////////////////////////////////////////////////////////////////
	int GetRow();//获得行数
	int GetLine();//获得列数
	double* GetData();//获得矩阵数据
    double GetMatrixValue();//求矩阵行列式的值
	CMatrix GetConvertMatrix();//求矩阵的逆矩阵
	CMatrix GetConvertMatrix(int iBool);
	int InversMatrix(double* pm1, int i4n)const;
///////////////////////////////////////////////////运算符重载
    CMatrix operator*(const CMatrix &multiplier);
	CMatrix operator-(const CMatrix &m1);
	CMatrix operator+(const CMatrix &m1);
    CMatrix operator= (const CMatrix &s);
//     CMatrix& operator = (const CMatrix &s);//直接应用引用降低对大矩阵的复制
//////////////////////////////////////////////////////////////////////////
	virtual ~CMatrix();
	CMatrix();
    CMatrix(int r,int l,bool f=false,double *a=NULL);//r为矩阵的行,l为矩阵的列,f用于确定是否要自己输入,如果为假则初始化为0.
    CMatrix (CMatrix &s);//拷贝构造函数

    //矩阵的属性
private:
	int m_Row,m_Line;//矩阵的行数和列数
	double *m_Data;//矩阵的元素
};

#endif // !defined(AFX_MATRIX_H__BF29AB98_8F8D_4BBC_8171_4ADD41EE27F9__INCLUDED_)

⌨️ 快捷键说明

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