Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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/field_F_SF.h"
20 
21 #include "IO/bridgeIO.h"
22 using Bridge::vout;
23 
25 
44 class Fopr_Rational_SF : public Fopr
45 {
46  public:
47  static const std::string class_name;
48 
49  private:
50  int m_Np; // number of poles in rational approx.
51  int m_n_exp, m_d_exp; // numerator and denominator of the exponent
52  double m_x_min, m_x_max; // valid range of approximate sign function
53  int m_Niter; // max iteration of shiftsolver
54  double m_Stop_cond; // stopping condition of shift solver
55 
58 
59  double m_a0;
60  std::vector<double> m_cl;
61  std::vector<double> m_bl;
62  std::vector<Field> m_xq;
63 
64  public:
66  : Fopr(), m_fopr(fopr) {}
67 
69  : Fopr(), m_fopr(fopr.get()) {}
70 
72  {
73  delete m_solver;
74  }
75 
76  void set_parameters(const Parameters& params);
77  void set_parameters(int Np, int n_exp, int d_exp, double x_min, double x_max,
78  int Niter, double Stop_cond);
79 
80  void set_config(Field *U)
81  {
82  m_fopr->set_config(U);
83  }
84 
86  {
87  m_fopr->set_config(U.get());
88  }
89 
90  void mult(Field& v, const Field& f);
91 
92  void mult_dag(Field& v, const Field& f)
93  {
94  mult(v, f);
95  }
96 
97  double func(double x);
98 
99  int field_nvol() { return m_fopr->field_nvol(); }
100  int field_nin() { return m_fopr->field_nin(); }
101  int field_nex() { return m_fopr->field_nex(); }
102 
103  private:
104  void init_parameters();
105 };
106 #endif
int field_nvol()
returns the volume for which the fermion operator is defined.
BridgeIO vout
Definition: bridgeIO.cpp:495
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:46
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)
Fermion operator for rational approximation.
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
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:47
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