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

📄 matrix.h

📁 变分独立因子分析C++代码,H.Attias说比独立分量分析要好,但是这个程序分析效果不好,可能是程序问题,也可能是对理论理解不透
💻 H
字号:
// Matrix.h: interface for the CMatrix class.
// Shijun Sun    Tutor: Peng Chenglin
// Chongqing University, Bioengineering College   2007/10/18
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MATRIX_H__F3078D32_4D0B_4703_8B2A_BFD255F401AC__INCLUDED_)
#define AFX_MATRIX_H__F3078D32_4D0B_4703_8B2A_BFD255F401AC__INCLUDED_

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

class CMatrix  
{
public:
	friend void swap(double &x, double &y);
	friend CMatrix linearsimultaneousequations(const CMatrix & A, const CMatrix & B);
	friend double scalarvalue(const CMatrix & matrix);
	friend double diagdeterminant(const CMatrix & matrix);
	friend CMatrix diaginverse(const CMatrix & matrix);
	friend double symmdeterminant(const CMatrix & matrix);
	friend CMatrix symminverse(const CMatrix & matrix);
	friend CMatrix symmlowtridecompose(const CMatrix & matrix);	
	friend CMatrix lowtriinverse(const CMatrix & matrix);
	friend double lowtrideterminat(const CMatrix & matrix);

	friend CMatrix operator *(const double x, const CMatrix & matrix);

	CMatrix  operator *(const double x);
	CMatrix  operator /(const double x);
	CMatrix operator *(const CMatrix & matrix);
	CMatrix operator -(const CMatrix & matrix);
	CMatrix operator +(const CMatrix & matrix);

	CMatrix operator -() const; 
	CMatrix operator +() const; 
	CMatrix operator ~() const;

	CMatrix & operator =(const CMatrix &matrix);
	CMatrix(const CMatrix & matrix);

	inline double* operator [](const int i) { return m_matrix[i];}
	inline const double* operator [](const int i) const  { return m_matrix[i];}
	inline int getnr() const { return m_nr;}
	inline int getnc() const { return m_nc;}
	inline double** getmatrix() const { return m_matrix;}

	CMatrix(double** matrix, const int nr, const int nc);
	CMatrix(const int nr, const int nc);
	CMatrix();
	virtual ~CMatrix();

private:
	void create(const int nr, const int nc);
	void clear();
	int m_nc;
	int m_nr;
	double** m_matrix;
};

#endif // !defined(AFX_MATRIX_H__F3078D32_4D0B_4703_8B2A_BFD255F401AC__INCLUDED_)

⌨️ 快捷键说明

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