00001 #ifndef _MY_SolverGPU_AGM_
00002 #define _MY_SolverGPU_AGM_
00003 #include "globals.h"
00004 #include <lac/sparse_matrix.h>
00005 #include "linearsolver.h"
00010 class SolverGPU_AGM : public LinearSolver
00011 {
00012 private:
00013 void convertSparseMatrix(const SparseMatrix<double> &M,std::vector<int> &cnt,std::vector<int> &col, std::vector<double> &ele);
00014
00015
00016 void gpu_agm(std::vector<int> &cnt,std::vector<int> &col, std::vector<double> &ele, std::vector<double> &b, std::vector<double> &x,double tol,unsigned nIt);
00017 void add_diagonal(std::vector<int> &cnt,std::vector<int> &col, std::vector<double> &ele,const VecDouble &addElem);
00018 void gpu_agmII(std::vector<int> &cnt,std::vector<int> &col, std::vector<double> &ele_agm,std::vector<double> &ele_cg, std::vector<double> &b, std::vector<double> &x,double tol,unsigned nIt);
00019
00020
00021
00022 void gpu_agm_compressible(std::vector<int> &cnt,std::vector<int> &col, std::vector<double> &ele, std::vector<double> &b, std::vector<double> &x,double tol,unsigned nIt);
00023
00024 protected:
00025 double m_tol;
00026 unsigned m_nIt;
00027 public:
00028 SolverGPU_AGM(double tol,unsigned nIt);
00029 virtual ~SolverGPU_AGM(){}
00030
00031 virtual void solve(const SparseMatrix<double> &M,VecDouble &sol,const VecDouble &rhs);
00032
00033 virtual void solveAgain(const SparseMatrix<double> &M,VecDouble &sol,const VecDouble &rhs);
00034
00035
00036
00037 void solve(const SparseMatrix<double> &A,VecDouble &sol,const VecDouble &vRHS,double tol,unsigned nIt);
00038
00039
00040
00041
00042
00043
00044 void gpu_agmSchur(std::vector<int> &Acnt,std::vector<int> &Acol, std::vector<double> &Aele,
00045 std::vector<int> &Bcnt,std::vector<int> &Bcol, std::vector<double> &Bele,
00046 std::vector<int> &tcnt,std::vector<int> &tcol, std::vector<double> &tele,
00047 std::vector<double> &_f, std::vector<double> &_g,std::vector<double> &_u, std::vector<double> &_p);
00048
00049
00050
00051
00052 };
00053
00054 #endif