📄 h12.h
字号:
#ifndef _MATRIX_H_
#define _MATRIX_H_
#include "math.h"
#include "stdlib.h"
#include "stdio.h"
#include "memory.h"
#include "assert.h"
#include "windows.h"
class CMatrix
{
public:
CMatrix();
CMatrix(int nRows, int nCols);
CMatrix(int nRows, int nCols, double value[]);
CMatrix(int nSize);
CMatrix(int nSize, double value[]);
CMatrix(const CMatrix& other);
~CMatrix();
public:
bool Init(int nRows, int nCols);
bool MakeUnitMatrix(int nSize);
// bool FromString(CString s, const CString& sDelim /*= " "*/, bool bLineBreak /*= TRUE*/);
// CString ToString(const CString& sDelim /*= " "*/, bool bLineBreak /*= TRUE*/)const;
// CString RowToString(int nRow, const CString& sDelim /*= " "*/)const;
// CString ColToString(int nCol, const CString& sDelim /*= " "*/)const;
void SetData(double value[]);
bool SetElement(int nRow, int nCol, double value);
double GetElement(int nRow, int nCol)const;
int GetNumColumns()const;
int GetNumRows()const;
double* GetData()const;
int GetRowVector(int nRow, double* pVector)const;
int GetColVector(int nCol, double* pVector)const;
CMatrix& operator=(const CMatrix& other);
bool operator==(const CMatrix& other)const;
bool operator!=(const CMatrix& other)const;
CMatrix operator+(const CMatrix& other)const;
CMatrix operator-(const CMatrix& other)const;
CMatrix operator*(double value)const;
CMatrix operator*(const CMatrix& other)const;
bool CMul(const CMatrix& AR, const CMatrix& AI, const CMatrix& BR, const CMatrix& BI, CMatrix& CR, CMatrix& CI)const;
CMatrix Transpose()const;
bool InvertGaussJordan();
bool InvertGaussJordan(CMatrix& mtxImag);
bool InvertSsgj();
bool InvertTrench();
double DetGauss();
int RankGauss();
bool DetCholesky(double* dblDet);
bool SplitLU(CMatrix& mtxL, CMatrix& mtxU);
bool SplitQR(CMatrix& mtxQ);
bool SplitUV(CMatrix& mtxU, CMatrix& mtxV, double eps /*= 0.000001*/);
void ppp(double a[], double e[], double s[], double v[], int m, int n);
void sss(double fg[2], double cs[2]);
bool GInvertUV(CMatrix& mtxAP, CMatrix& mtxU, CMatrix& mtxV, double eps /*= 0.000001*/);
bool MakeSymTri(CMatrix& mtxQ, CMatrix& mtxT, double dblB[], double dblC[]);
bool SymTriEigenv(double dblB[], double dblC[], CMatrix& mtxQ, int nMaxIt /*= 60*/, double eps /*= 0.000001*/);
void MakeHberg();
bool HBergEigenv(double dblU[], double dblV[], int nMaxIt /*= 60*/, double eps /*= 0.000001*/);
bool JacobiEigenv(double dblEigenValue[], CMatrix& mtxEigenVector, int nMaxIt /*= 60*/, double eps /*= 0.000001*/);
bool JacobiEigenv2(double dblEigenValue[], CMatrix& mtxEigenVector, double eps /*= 0.000001*/);
double remean(Cmatrix& a);
double norm();
void pcamat(Cmatrix& E,Cmatrix& D);
CMatrix& white(Cmatrix& whiteningMatrix,Cmatrix& dewhiteningMatrix);
public:
int m_nNumColumns, m_nNumRows;
double *m_pData;
};
#endif
ff
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -