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

📄 ccrosslist.h

📁 一个用十字链表实现的稀疏矩阵类
💻 H
字号:
#ifndef CROSS_LIST_H_FILE_INLUDED
#define CROSS_LIST_H_FILE_INLUDED

#include <iostream>
#include <vector>
#include <iomanip>
#include <math.h>
#include <fstream>
//#include "iFace_Matrix.h"
using namespace std;
class Element {
public:
	double value;
	int i;
	int j;
	Element* right;
	Element* down;
	Element* left;
	Element* up;
	Element();
	Element(int r, int c, double v);
	
};

class CrossList
{
public:
	int m_r,m_c;
	int m_elements_counter;
	int m_elements_MaxNum;
	CrossList();
	CrossList(const CrossList& motherboard);
	CrossList(int para_r, int para_c);
	~CrossList();
	
	Element **Rheaders;
	Element **CHeaders;   //记录头地址
	Element *m_elements;
	void InsertElement(int i, int j, double v);
	void Print();
	void PrintAll();
//	void SaveAll(CString);
	CrossList operator * (const CrossList & matrix);
	CrossList operator * (const double n);
	CrossList operator / (const double n);
	CrossList operator + (const CrossList & matrix);
	CrossList operator - (const CrossList & matrix);
	CrossList& operator = (const CrossList & matrix);
	double QtbyAbyQ(double* q);
	CrossList Transpose() const;
	CrossList SubAlphak(double alphak);
//	void Lanczos(CString );
//	void Lanczos(iFace_CMatrix *eigenvector, int dim);
//	void ToMatrix(iFace_CMatrix* mx);
	void SubAlphak1(double alphak);
	void Arraydivdouble(double* Array, double n, double* outArray, int sz);
	void RightMultiplyArray(double* inArray, double* out_Array);
	void ArraySubArray(double* inArray1, double* inArray2, double* outArray, int sz);
	double ArrayNorm(double* inArray, int n);
	void CrossListDivDouble(double n);
	double MaxNonnegtiveValue();
};
#endif

⌨️ 快捷键说明

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