sparsematrix.h

来自「三维框架梁单元C++版本的源程序 可以使结构力学的概念更上升一个层次」· C头文件 代码 · 共 39 行

H
39
字号
// SparseMatrix.h: interface for the CSparseMatrix class.
//
//////////////////////////////////////////////////////////////////////

//#if !defined(AFX_SPARSEMATRIX_H__ED691D40_B2A3_11D5_97B8_CCA92B7E7B70__INCLUDED_)
//#define AFX_SPARSEMATRIX_H__ED691D40_B2A3_11D5_97B8_CCA92B7E7B70__INCLUDED_

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

class CSparseMatrix  
{
public:
	double & operator()(int iRow, int iCol);
	void ElementBufRealloc();
	void ElementBufEmpty();
	bool Decomposition(int nRow);
	bool LdltSolve(int nRow,double *adB);
	bool LdltSolve(int nRow,CMatrix& m);
	void Realloc(int nRow,unsigned long* aiDiag);
	CSparseMatrix();
	CSparseMatrix(int nRow,unsigned long* aiDiag);
	virtual ~CSparseMatrix();
	CSparseMatrix& operator =(const double dBuf);
	CSparseMatrix& operator*=(const double dBuf);
	CSparseMatrix& operator =(CSparseMatrix& sm);
	CSparseMatrix& operator+=(CSparseMatrix& sm);
	CMatrix operator*(CMatrix& m);
private:
	bool m_bDecomposed,m_bElementBufEmpty;
	int m_nRow;
	unsigned long *m_aiDiag;
	double *m_adValue;
	double m_dBuf;
};

//#endif // !defined(AFX_SPARSEMATRIX_H__ED691D40_B2A3_11D5_97B8_CCA92B7E7B70__INCLUDED_)

⌨️ 快捷键说明

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