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

📄 cematrix.h

📁 本程序主要用于计算空间刚架的位移。通过直接输入结构基本信息
💻 H
字号:
/* 二维等带宽存储CEMatrix声明*/

#ifndef EMATRIX
#define EMATRIX

#include "Head.h"

class CEMatrix
{
// 接口函数
public:
	// 缺省构造函数
	CEMatrix();

	// 指定带宽,行数的构造函数
	CEMatrix( int nRow, int nD);

	// 拷贝构造函数
	CEMatrix(const CEMatrix& other);

	// 析构函数
	virtual ~CEMatrix();

	// 初始化矩阵
	bool Init(int nRow, int nD);

	// 设置指定元素的值
	bool SetElement(int nRow, int nCol, double value);

	// 设置矩阵的值
	void SetData(double value[]);

	// 获取指定元素的值
	double GetElement(int nRow, int nCol) const;

	// 获取矩阵的带宽
	int GetD(void) const;

	// 获取矩阵的行数
	int GetNumRow(void) const;

	// 获取矩阵的值
	double* GetData() const;

	// 运算符重载
	CEMatrix& operator=( const CEMatrix& other);

	// 添加子块矩阵并和原子块相加
	void AddPartK(
		int nRowStart,
		int nColStart,
		CMatrix PartK );

	// 对调第x,y行
	void SwapRow( int x, int y);
	
	// 从文件filename中读取一个矩阵
	bool Read( ifstream &readfile);

	// 将一个矩阵写入文件filename中
	bool Write( ofstream &writefile);

private:
	// 带宽,行数
	int m_nD,m_nNumRow;

	double* p_Data;

};

#endif // CEMATRIX

⌨️ 快捷键说明

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