Bridge++  Ver. 1.3.x
solver_GMRES_m_Cmplx.h
Go to the documentation of this file.
1 
14 #ifndef SOLVER_GMRES_m_CMPLX_INCLUDED
15 #define SOLVER_GMRES_m_CMPLX_INCLUDED
16 
17 #include "solver.h"
18 
19 #include <valarray>
20 
21 #include "bridgeIO.h"
22 using Bridge::vout;
23 
24 //- parameters class
26 {
27  public:
29 };
30 //- end
31 
33 
47 {
48  public:
49  static const std::string class_name;
50 
51  private:
52 
54  int m_Niter;
55  double m_Stop_cond;
56 
57  int m_N_M;
58 
59  std::vector<Field> v;
60 
61  Field s, r, x, v_tmp;
62  double beta_prev;
63 
64  public:
66  : Solver(), m_fopr(fopr) {}
67 
69  : Solver(), m_fopr(fopr.get()) {}
70 
72 
73  void set_parameters(const Parameters& params);
74  void set_parameters(const int Niter, const double Stop_cond);
75  void set_parameters_GMRES_m(const int N_M);
76 
77  void solve(Field& solution, const Field& source,
78  int& Nconv, double& diff);
79 
80  Fopr *get_fopr() { return m_fopr; }
81 
82  private:
83 
84  void reset_field(const Field&);
85 
86  void solve_init(const Field&, double&);
87  void solve_step(const Field&, double&);
88 
89  void innerprod_c(double& prod_r, double& prod_i,
90  const Field& v, const Field& w);
91 
92  void min_J(std::valarray<dcomplex>& y,
93  std::valarray<dcomplex>& h);
94 
95  int index_ij(int i, int j)
96  {
97  return i + (m_N_M + 1) * j;
98  }
99 };
100 #endif
BridgeIO vout
Definition: bridgeIO.cpp:278
static const std::string class_name
Container of Field-type object.
Definition: field.h:39
void solve_init(const Field &, double &)
Class for parameters.
Definition: parameters.h:38
void innerprod_c(double &prod_r, double &prod_i, const Field &v, const Field &w)
GMRES(m) algorithm with complex variables.
int index_ij(int i, int j)
Base class for linear solver class family.
Definition: solver.h:38
void reset_field(const Field &)
void solve(Field &solution, const Field &source, int &Nconv, double &diff)
std::vector< Field > v
void min_J(std::valarray< dcomplex > &y, std::valarray< dcomplex > &h)
void set_parameters_GMRES_m(const int N_M)
Base class of fermion operator family.
Definition: fopr.h:49
Solver_GMRES_m_Cmplx(unique_ptr< Fopr > &fopr)
void solve_step(const Field &, double &)
void set_parameters(const Parameters &params)