Bridge++  Ver. 1.3.x
fopr_Rational_SF.h
Go to the documentation of this file.
1 
15 #ifndef FOPR_RATIONAL_SF_INCLUDED
16 #define FOPR_RATIONAL_SF_INCLUDED
17 
18 #include "fopr_Rational.h"
19 #include "field_F_SF.h"
20 
21 #include "bridgeIO.h"
22 using Bridge::vout;
23 
25 
42 //- parameters class
44 {
45  public:
47 };
48 //- end
49 
50 
51 class Fopr_Rational_SF : public Fopr
52 {
53  public:
54  static const std::string class_name;
55 
56  private:
57  int m_Np; // number of poles in rational approx.
58  int m_n_exp, m_d_exp; // numerator and denominator of the exponent
59  double m_x_min, m_x_max; // valid range of approximate sign function
60  int m_Niter; // max iteration of shiftsolver
61  double m_Stop_cond; // stopping condition of shift solver
62 
65 
66  double m_a0;
67  std::vector<double> m_cl;
68  std::vector<double> m_bl;
69  std::vector<Field> m_xq;
70 
71  public:
73  : Fopr(), m_fopr(fopr) {}
74 
76  : Fopr(), m_fopr(fopr.get()) {}
77 
79  {
80  delete m_solver;
81  }
82 
83  void set_parameters(const Parameters& params);
84  void set_parameters(int Np, int n_exp, int d_exp, double x_min, double x_max,
85  int Niter, double Stop_cond);
86 
87  void set_config(Field *U)
88  {
89  m_fopr->set_config(U);
90  }
91 
93  {
94  m_fopr->set_config(U.get());
95  }
96 
97  void mult(Field& v, const Field& f);
98 
99 
100  void mult_dag(Field& v, const Field& f)
101  {
102  mult(v, f);
103  }
104 
105  double func(double x);
106 
107  int field_nvol() { return m_fopr->field_nvol(); }
108  int field_nin() { return m_fopr->field_nin(); }
109  int field_nex() { return m_fopr->field_nex(); }
110 
111  private:
112  void init_parameters();
113 };
114 #endif
int field_nvol()
returns the volume for which the fermion operator is defined.
BridgeIO vout
Definition: bridgeIO.cpp:278
Fopr_Rational_SF(unique_ptr< Fopr > &fopr)
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:39
Multishift Conjugate Gradient solver.
static const std::string class_name
Class for parameters.
Definition: parameters.h:38
Fopr_Rational_SF(Fopr *fopr)
std::vector< Field > m_xq
virtual int field_nin()=0
returns the on-site d.o.f. for which the fermion operator is defined.
void set_parameters(const Parameters &params)
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
void mult(Field &v, const Field &f)
pointer get() const
virtual int field_nex()=0
returns the external d.o.f. for which the fermion operator is defined.
Shiftsolver_CG * m_solver
Fermion operator for rational approximation.
void set_config(Field *U)
setting pointer to the gauge configuration.
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
void set_config(unique_ptr< Field_G > &U)
double func(double x)
Base class of fermion operator family.
Definition: fopr.h:49
virtual int field_nvol()=0
returns the volume for which the fermion operator is defined.
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
std::vector< double > m_cl
std::vector< double > m_bl