Bridge++  Version 1.5.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 
20 #include "Field/field_F_SF.h"
21 
22 #include "IO/bridgeIO.h"
23 using Bridge::vout;
24 
26 
43 class Fopr_Rational_SF : public Fopr
44 {
45  public:
46  static const std::string class_name;
47 
48  private:
49  int m_Np; // number of poles in rational approx.
50  int m_n_exp, m_d_exp; // numerator and denominator of the exponent
51  double m_x_min, m_x_max; // valid range of approximate sign function
52  int m_Niter; // max iteration of shiftsolver
53  double m_Stop_cond; // stopping condition of shift solver
54 
57 
58  double m_a0;
59  std::vector<double> m_cl;
60  std::vector<double> m_bl;
61  std::vector<Field> m_xq;
62 
63  public:
65  : Fopr(), m_fopr(fopr) {}
66 
68  : Fopr(), m_fopr(fopr.get()) {}
69 
71  {
72  delete m_solver;
73  }
74 
75  void set_parameters(const Parameters& params);
76  void set_parameters(const int Np, const int n_exp, const int d_exp, const double x_min, const double x_max,
77  const int Niter, const double Stop_cond);
78 
79  void set_config(Field *U)
80  {
81  m_fopr->set_config(U);
82  }
83 
85  {
86  m_fopr->set_config(U.get());
87  }
88 
89  void mult(Field& v, const Field& f);
90 
91  void mult_dag(Field& v, const Field& f)
92  {
93  mult(v, f);
94  }
95 
96  double func(const double x);
97 
98  int field_nvol() { return m_fopr->field_nvol(); }
99  int field_nin() { return m_fopr->field_nin(); }
100  int field_nex() { return m_fopr->field_nex(); }
101 
102  private:
103  void init_parameters();
104 
105 #ifdef USE_FACTORY
106  private:
107  static Fopr *create_object(Fopr *fopr)
108  {
109  return new Fopr_Rational_SF(fopr);
110  }
111 
112  public:
113  static bool register_factory()
114  {
115  return Fopr::Factory_fopr::Register("Rational_SF", create_object);
116  }
117 #endif
118 };
119 #endif
int field_nvol()
returns the volume for which the fermion operator is defined.
BridgeIO vout
Definition: bridgeIO.cpp:503
Fopr_Rational_SF(unique_ptr< Fopr > &fopr)
double func(const double x)
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:45
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)
Base class of fermion operator family.
Definition: fopr.h:46
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