Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Rational.h
Go to the documentation of this file.
1 
15 #ifndef FOPR_RATIONAL_INCLUDED
16 #define FOPR_RATIONAL_INCLUDED
17 
18 #include "fopr.h"
19 #include "field_G.h"
20 #include "shiftsolver_CG.h"
21 #include "math_Rational.h"
22 
23 #include "bridgeIO.h"
24 using Bridge::vout;
25 
26 //- parameters class
27 class Parameters_Fopr_Rational : virtual public Parameters
28 {
29  public:
31 };
32 //- end
33 
35 
46 class Fopr_Rational : public Fopr
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::valarray<double> m_cl;
60  std::valarray<double> m_bl;
61  std::valarray<Field> m_xq;
62 
63  public:
64 
66  : Fopr(), m_fopr(fopr) {}
67 
69  {
70  delete m_solver;
71  }
72 
73  void set_parameters(const Parameters& params);
74  void set_parameters(int Np, int n_exp, int d_exp, double x_min, double x_max,
75  int Niter, double Stop_cond);
76 
77  void set_config(Field *U)
78  {
79  m_fopr->set_config(U);
80  }
81 
82  const Field mult(const Field& f);
83 
84  void mult(Field& v, const Field& f)
85  {
86  v = mult(f);
87  }
88 
89  const Field mult_dag(const Field& f)
90  {
91  return mult(f);
92  }
93 
94  void mult_dag(Field& v, const Field& f)
95  {
96  v = mult_dag(f);
97  }
98 
99  double func(double x);
100 
101  int field_nvol() { return m_fopr->field_nvol(); }
102  int field_nin() { return m_fopr->field_nin(); }
103  int field_nex() { return m_fopr->field_nex(); }
104 
105  private:
106  void init_parameters();
107 };
108 #endif