matrix.h
来自「变分独立因子分析C++代码,H.Attias说比独立分量分析要好,但是这个程序分」· C头文件 代码 · 共 62 行
H
62 行
// 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 + =
减小字号Ctrl + -
显示快捷键?