PARALUTION  1.0.0
PARALUTION
idr.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_KRYLOV_IDR_HPP_
2 #define PARALUTION_KRYLOV_IDR_HPP_
3 
4 #include "../solver.hpp"
5 
6 #include <vector>
7 
8 namespace paralution {
9 
13 template <class OperatorType, class VectorType, typename ValueType>
14 class IDR : public IterativeLinearSolver<OperatorType, VectorType, ValueType> {
15 
16 public:
17 
18  IDR();
19  virtual ~IDR();
20 
21  virtual void Print(void) const;
22 
23  virtual void Build(void);
24  virtual void Clear(void);
25 
27  virtual void SetShadowSpace(const int s);
28 
29 protected:
30 
31  virtual void SolveNonPrecond_(const VectorType &rhs,
32  VectorType *x);
33  virtual void SolvePrecond_(const VectorType &rhs,
34  VectorType *x);
35 
36  virtual void PrintStart_(void) const;
37  virtual void PrintEnd_(void) const;
38 
39  virtual void MoveToHostLocalData_(void);
40  virtual void MoveToAcceleratorLocalData_(void);
41 
42 private:
43 
44  int s_;
45 
46  ValueType kappa_;
47 
48  ValueType *fhost_, *Mhost_;
49 
50  VectorType r_, v_, z_, t_;
51  VectorType **g_, **u_, **P_;
52 
53 };
54 
55 
56 }
57 
58 #endif // PARALUTION_KRYLOV_IDR_HPP_
VectorType t_
Definition: idr.hpp:50
VectorType r_
Definition: idr.hpp:50
ValueType * fhost_
Definition: idr.hpp:48
VectorType ** g_
Definition: idr.hpp:51
virtual void MoveToHostLocalData_(void)
Move all local data to the host.
Definition: idr.cpp:231
VectorType z_
Definition: idr.hpp:50
Base class for all linear (iterative) solvers.
Definition: solver.hpp:94
virtual void Print(void) const
Print information about the solver.
Definition: idr.cpp:48
virtual void Clear(void)
Clear (free all local data) the solver.
Definition: idr.cpp:172
virtual void PrintEnd_(void) const
Print ending msg of the solver.
Definition: idr.cpp:80
IDR(s) - Induced Dimension Reduction method, taken from "An Elegant IDR(s) Variant that Efficiently E...
Definition: idr.hpp:14
VectorType v_
Definition: idr.hpp:50
virtual void SetShadowSpace(const int s)
Set the size of the Shadow Space.
Definition: idr.cpp:216
virtual void Build(void)
Build the solver (data allocation, structure computation, numerical computation)
Definition: idr.cpp:95
virtual void SolvePrecond_(const VectorType &rhs, VectorType *x)
Preconditioned solution procedure.
Definition: idr.cpp:630
IDR()
Definition: idr.cpp:20
virtual void PrintStart_(void) const
Print starting msg of the solver.
Definition: idr.cpp:64
virtual void SolveNonPrecond_(const VectorType &rhs, VectorType *x)
Non-preconditioner solution procedure.
Definition: idr.cpp:291
Definition: backend_manager.cpp:43
ValueType * Mhost_
Definition: idr.hpp:48
const IndexType const IndexType const IndexType const ValueType const ValueType const ValueType * x
Definition: cuda_kernels_coo.hpp:91
virtual ~IDR()
Definition: idr.cpp:38
ValueType kappa_
Definition: idr.hpp:46
int s_
Definition: idr.hpp:44
VectorType ** u_
Definition: idr.hpp:51
VectorType ** P_
Definition: idr.hpp:51
virtual void MoveToAcceleratorLocalData_(void)
Move all local data to the accelerator.
Definition: idr.cpp:261