angchen

angchen

 

解线性方程组的头文件

 1#ifndef LINEARFUN_H
 2#define LINEARFUN_H
 3
 4#include<iostream>
 5#include<cstdlib>
 6#include"Matrix.h"
 7using namespace std;
 8
 9class LinearFun
10{
11public:
12    LinearFun();
13    LinearFun(Matrix ma, Matrix vb);
14    LinearFun(const LinearFun& lf);
15
16    ~LinearFun();
17    LinearFun& operator =(const LinearFun& lf);
18
19    Matrix Lx_b(Matrix& L, Matrix& b, const int flag);//if flag==1 for the LU Method,else for others. 
20    Matrix Ux_b(Matrix& U, Matrix& b);
21    //need to remember that J-I and G-S 's x0 will change as routine over.So they can not use  simultaneously.
22    Matrix JacobiIteration(Matrix& A1, Matrix& b, Matrix& x0, const double tol);                                                                    
23    Matrix GaussSeidelIteration(Matrix& A1, Matrix& b, Matrix& x0, const double tol);
24    Matrix SOR(Matrix& A1, Matrix& b, Matrix& x0, const double weight, const double tol);
25    Matrix CG(Matrix& A1, Matrix& b, Matrix& x0, const double tol);
26    Matrix QROrth(Matrix& A1, Matrix& b);//using the QR orthogonalization to solve the LS problem.
27
28private:
29    Matrix A;
30    Matrix B;
31}
;
32
33#endif

posted on 2009-04-14 12:24 陈安 阅读(299) 评论(1)  编辑 收藏 引用

评论

# re: 解线性方程组的头文件 2009-04-14 12:27 陈安

只是一些较简单的算法实现。还得继续完善。  回复  更多评论   


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


导航

统计

常用链接

留言簿(1)

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜