【刘庆源码共享】稀疏线性系统求解算法MGMRES(m) 之 MGMRES类申明(C++)

来源:互联网 发布:运营商网络是要收费吗 编辑:程序博客网 时间:2024/04/30 03:22

/* 
 * Copyright (c) 2009 湖南师范大学数计院 一心飞翔项目组
 * All Right Reserved
 *
 * 文件名:mgmres.h
 * 摘  要:声明MGMRES(m)算法的操作类GMRES
 *
 * 作  者:刘 庆
 * 完成日期:2009年4月28日
 *
*/

#ifndef _MGMRES_
#define _MGMRES_

#include "matrix.h"
#include <time.h>

using namespace std;

class MGMRES
{
protected:
 Matrix A;    // 系数矩阵A
 Matrix b;    // 右端向量x
 long max_outer_itr;  // 外重循环次数
 long max_inner_itr;  // 内重循环次数
 int* resultOk;   // 检测解的优良性
 Matrix x;    // 未知量

public: 
 MGMRES();        /* 默认构造函数 */
 ~MGMRES();        /* 析构函数 */
 void SetMatrixsValue(const char* fileName); /* 替A、b、x矩阵赋值 */
 Matrix& MGMRESCode();     /* GMRES 算法的具体实现 */
 int IsEMRequalMR() const;    /* 判断增广矩阵的秩和系数矩阵的秩是否一致 */
 Matrix ValidateResult();    /* 检验结果的值 */
 void PrintRunTime(clock_t start, clock_t finsh, char* str) const; /* 打印时间 */
};

#endif // _MGMRES_

原创粉丝点击