PARALUTION  1.0.0
PARALUTION
cg.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_KRYLOV_CG_HPP_
2 #define PARALUTION_KRYLOV_CG_HPP_
3 
4 #include "../solver.hpp"
5 
6 #include <vector>
7 
8 namespace paralution {
9 
10 template <class OperatorType, class VectorType, typename ValueType>
11 class CG : public IterativeLinearSolver<OperatorType, VectorType, ValueType> {
12 
13 public:
14 
15  CG();
16  virtual ~CG();
17 
18  virtual void Print(void) const;
19 
20  virtual void Build(void);
21  virtual void Clear(void);
22 
23 protected:
24 
25  virtual void SolveNonPrecond_(const VectorType &rhs,
26  VectorType *x);
27  virtual void SolvePrecond_(const VectorType &rhs,
28  VectorType *x);
29 
30  virtual void PrintStart_(void) const;
31  virtual void PrintEnd_(void) const;
32 
33  virtual void MoveToHostLocalData_(void);
34  virtual void MoveToAcceleratorLocalData_(void);
35 
36 private:
37 
38  VectorType r_, z_;
39  VectorType p_, q_;
40 
41 };
42 
43 
44 }
45 
46 #endif // PARALUTION_KRYLOV_CG_HPP_
virtual void SolveNonPrecond_(const VectorType &rhs, VectorType *x)
Non-preconditioner solution procedure.
Definition: cg.cpp:197
virtual void MoveToAcceleratorLocalData_(void)
Move all local data to the accelerator.
Definition: cg.cpp:173
virtual ~CG()
Definition: cg.cpp:26
virtual void Clear(void)
Clear (free all local data) the solver.
Definition: cg.cpp:126
virtual void MoveToHostLocalData_(void)
Move all local data to the host.
Definition: cg.cpp:152
VectorType r_
Definition: cg.hpp:38
Base class for all linear (iterative) solvers.
Definition: solver.hpp:94
Definition: cg.hpp:11
virtual void PrintStart_(void) const
Print starting msg of the solver.
Definition: cg.cpp:52
virtual void Print(void) const
Print information about the solver.
Definition: cg.cpp:36
CG()
Definition: cg.cpp:18
Definition: backend_manager.cpp:43
virtual void SolvePrecond_(const VectorType &rhs, VectorType *x)
Preconditioned solution procedure.
Definition: cg.cpp:294
virtual void Build(void)
Build the solver (data allocation, structure computation, numerical computation)
Definition: cg.cpp:83
virtual void PrintEnd_(void) const
Print ending msg of the solver.
Definition: cg.cpp:68
VectorType q_
Definition: cg.hpp:39
const IndexType const IndexType const IndexType const ValueType const ValueType const ValueType * x
Definition: cuda_kernels_coo.hpp:91
VectorType z_
Definition: cg.hpp:38
VectorType p_
Definition: cg.hpp:39