PARALUTION  1.0.0
PARALUTION
fgmres.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_FGMRES_FGMRES_HPP_
2 #define PARALUTION_FGMRES_FGMRES_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 FGMRES : public IterativeLinearSolver<OperatorType, VectorType, ValueType> {
12 
13 public:
14 
15  FGMRES();
16  virtual ~FGMRES();
17 
18  virtual void Print(void) const;
19 
20  virtual void Build(void);
21  virtual void Clear(void);
22 
24  virtual void SetBasisSize(const int size_basis);
25 
26 protected:
27 
28  virtual void SolveNonPrecond_(const VectorType &rhs,
29  VectorType *x);
30  virtual void SolvePrecond_(const VectorType &rhs,
31  VectorType *x);
32 
33  virtual void PrintStart_(void) const;
34  virtual void PrintEnd_(void) const;
35 
36  virtual void MoveToHostLocalData_(void);
37  virtual void MoveToAcceleratorLocalData_(void);
38 
39  void GenerateGivensRotation_(const ValueType &x, const ValueType &y,
40  ValueType &c, ValueType &s) const;
41 
42  void ApplyGivensRotation_(const ValueType &c, const ValueType &s,
43  ValueType &x, ValueType &y) const;
44 
45  void BackSubstitute_(std::vector<ValueType> &g,
46  const std::vector<ValueType> &H,
47  int k) const;
48 
49 private:
50 
51  VectorType w_;
52  VectorType **v_, **z_;
53 
55 
56 };
57 
58 
59 }
60 
61 #endif // PARALUTION_FGMRES_FGMRES_HPP_
virtual void MoveToAcceleratorLocalData_(void)
Move all local data to the accelerator.
Definition: fgmres.cpp:189
virtual ~FGMRES()
Definition: fgmres.cpp:28
virtual void PrintStart_(void) const
Print starting msg of the solver.
Definition: fgmres.cpp:54
VectorType ** z_
Definition: fgmres.hpp:52
Base class for all linear (iterative) solvers.
Definition: solver.hpp:94
void GenerateGivensRotation_(const ValueType &x, const ValueType &y, ValueType &c, ValueType &s) const
Definition: fgmres.cpp:634
VectorType ** v_
Definition: fgmres.hpp:52
virtual void Clear(void)
Clear (free all local data) the solver.
Definition: fgmres.cpp:135
const IndexType const IndexType const IndexType const ValueType const ValueType const ValueType ValueType * y
Definition: cuda_kernels_coo.hpp:91
virtual void SolvePrecond_(const VectorType &rhs, VectorType *x)
Preconditioned solution procedure.
Definition: fgmres.cpp:426
void BackSubstitute_(std::vector< ValueType > &g, const std::vector< ValueType > &H, int k) const
Definition: fgmres.cpp:669
VectorType w_
Definition: fgmres.hpp:51
virtual void Print(void) const
Print information about the solver.
Definition: fgmres.cpp:38
int size_basis_
Definition: fgmres.hpp:54
Definition: fgmres.hpp:11
FGMRES()
Definition: fgmres.cpp:18
Definition: backend_manager.cpp:43
virtual void MoveToHostLocalData_(void)
Move all local data to the host.
Definition: fgmres.cpp:166
const IndexType const IndexType const IndexType const ValueType const ValueType const ValueType * x
Definition: cuda_kernels_coo.hpp:91
void ApplyGivensRotation_(const ValueType &c, const ValueType &s, ValueType &x, ValueType &y) const
Definition: fgmres.cpp:659
virtual void Build(void)
Build the solver (data allocation, structure computation, numerical computation)
Definition: fgmres.cpp:85
virtual void SolveNonPrecond_(const VectorType &rhs, VectorType *x)
Non-preconditioner solution procedure.
Definition: fgmres.cpp:224
virtual void PrintEnd_(void) const
Print ending msg of the solver.
Definition: fgmres.cpp:70
virtual void SetBasisSize(const int size_basis)
Set the size of the Krylov-space basis.
Definition: fgmres.cpp:213