Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
shiftsolver_CG.h
Go to the documentation of this file.
1 
14 #ifndef SHIFTSOLVER_CG_INCLUDED
15 #define SHIFTSOLVER_CG_INCLUDED
16 
17 #include "shiftsolver.h"
18 
19 #include "IO/bridgeIO.h"
20 using Bridge::vout;
21 
22 
24 
32 {
33  public:
34  static const std::string class_name;
35 
36  private:
38 
39  int m_Niter;
40  double m_Stop_cond;
41 
42  std::vector<Field> m_x, m_p;
44  std::vector<double> m_zeta1, m_zeta2, m_csh2, m_pp;
45 
47  int m_Nshift2;
48 
49  double m_sigma0;
50 
51  public:
53  : Shiftsolver(), m_fopr(fopr) {}
54 
55  Shiftsolver_CG(Fopr *fopr, const int niter, const double stop_cond)
56  : Shiftsolver(), m_fopr(fopr)
57  {
58  set_parameters(niter, stop_cond);
59  }
60 
62  : Shiftsolver(), m_fopr(fopr.get()) {}
63 
64  Shiftsolver_CG(unique_ptr<Fopr>& fopr, const int niter, const double stop_cond)
65  : Shiftsolver(), m_fopr(fopr.get())
66  {
67  set_parameters(niter, stop_cond);
68  }
69 
71 
72  void set_parameters(const Parameters& params);
73  void set_parameters(const int niter, const double stop_cond);
74 
75  void solve(std::vector<Field>& solution,
76  const std::vector<double>& shift,
77  const Field& source,
78  int& Nconv, double& diff);
79 
80  private:
81  void solve_init(double&);
82  void solve_step(double&);
83 
84  void reset_field(const Field& b, const std::vector<double>& sigma, const int Nshift);
85 };
86 #endif
std::vector< Field > m_p
BridgeIO vout
Definition: bridgeIO.cpp:503
static const std::string class_name
void reset_field(const Field &b, const std::vector< double > &sigma, const int Nshift)
Shiftsolver_CG(unique_ptr< Fopr > &fopr)
std::vector< double > m_zeta2
Shiftsolver_CG(unique_ptr< Fopr > &fopr, const int niter, const double stop_cond)
void solve_init(double &)
int shift(void)
Container of Field-type object.
Definition: field.h:45
Multishift Conjugate Gradient solver.
void set_parameters(const Parameters &params)
std::vector< double > m_csh2
Shiftsolver class as an abstract base class for multi-shift solvers.
Definition: shiftsolver.h:24
std::vector< Field > m_x
Class for parameters.
Definition: parameters.h:46
std::vector< double > m_zeta1
Shiftsolver_CG(Fopr *fopr, const int niter, const double stop_cond)
Shiftsolver_CG(Fopr *fopr)
std::vector< double > m_pp
Base class of fermion operator family.
Definition: fopr.h:46
void solve_step(double &)
void solve(std::vector< Field > &solution, const std::vector< double > &shift, const Field &source, int &Nconv, double &diff)