Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "IO/bridgeIO.h"
22 using Bridge::vout;
23 
24 
26 
42 {
43  public:
44  static const std::string class_name;
45 
46  private:
48 
49  int m_Niter;
51  double m_Stop_cond;
52 
53  int m_N_M;
54 
55  //- working area
56  double m_beta_prev;
57 
58  std::vector<Field> m_v;
60 
63 
64  public:
66  : Solver(), m_fopr(fopr)
67  {
68  m_Nrestart_count = 0;
69  m_Nconv_count = 0;
70  }
71 
73  : Solver(), m_fopr(fopr.get())
74  {
75  m_Nrestart_count = 0;
76  m_Nconv_count = 0;
77  }
78 
80 
81  void set_parameters(const Parameters& params);
82  void set_parameters(const int Niter, const int Nrestart, const double Stop_cond);
83  void set_parameters_GMRES_m(const int N_M);
84 
85  void solve(Field& solution, const Field& source,
86  int& Nconv, double& diff);
87 
88  Fopr *get_fopr() { return m_fopr; }
89 
90  double flop_count();
91 
92  private:
93  void reset_field(const Field&);
94 
95  void solve_init(const Field&, double&);
96  void solve_step(const Field&, double&);
97 
98  void innerprod_c(double& prod_r, double& prod_i,
99  const Field& v, const Field& w);
100 
101  void min_J(std::valarray<dcomplex>& y,
102  std::valarray<dcomplex>& h);
103 
104  int index_ij(int i, int j)
105  {
106  return i + (m_N_M + 1) * j;
107  }
108 };
109 #endif
BridgeIO vout
Definition: bridgeIO.cpp:495
std::vector< Field > m_v
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:46
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:37
void reset_field(const Field &)
void solve(Field &solution, const Field &source, int &Nconv, double &diff)
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:47
Solver_GMRES_m_Cmplx(unique_ptr< Fopr > &fopr)
void solve_step(const Field &, double &)
void set_parameters(const Parameters &params)