Bridge++  Ver. 2.0.2
afopr_Chebyshev.h
Go to the documentation of this file.
1 
10 #ifndef AFOPR_CHEBYSHEV_INCLUDED
11 #define AFOPR_CHEBYSHEV_INCLUDED
12 
13 #include "lib/Fopr/afopr.h"
14 
15 #include "lib/IO/bridgeIO.h"
16 using Bridge::vout;
17 
18 #include <vector>
19 #include <string>
20 using std::string;
21 
22 class Field;
23 
25 
33 template<typename AFIELD>
34 class AFopr_Chebyshev : public AFopr<AFIELD>
35 {
36  public:
37  static const std::string class_name;
38  typedef typename AFIELD::real_t real_t;
39 
40  private:
42  int m_Npcb;
45 
47 
48  std::string m_mode;
49 
51 
52  std::vector<AFIELD> m_dj;
53 
54  public:
57  const Parameters& params)
58  : AFopr<AFIELD>(), m_fopr(fopr)
59  { init(params); }
60 
63  : AFopr<AFIELD>(), m_fopr(fopr)
64  { init(); }
65 
67 
69  void set_parameters(const Parameters& params);
70 
72  void set_parameters(const int Np,
73  const real_t v_threshold,
74  const real_t v_max);
75 
76  void get_parameters(Parameters& params) const;
77 
79  void set_config(Field *U);
80 
81  void set_mode(std::string mode);
82 
83  std::string get_mode() const;
84 
85  void mult(AFIELD& v, const AFIELD& w);
86 
87  void mult_dag(AFIELD& v, const AFIELD& w)
88  {
89  mult(v, w);
90  }
91 
92  void mult(real_t& v, const real_t x);
93 
94  real_t mult(const real_t x);
95 
97  virtual bool needs_convert()
98  { return m_fopr->needs_convert(); }
99 
101  virtual void convert(AFIELD& v, const Field& w)
102  { m_fopr->convert(v, w); }
103 
105  virtual void reverse(Field& v, const AFIELD& w)
106  { m_fopr->reverse(v, w); }
107 
108  int field_nin() { return m_NinF; }
109  int field_nvol() { return m_Nvol; }
110  int field_nex() { return m_NexF; }
111 
112  double flop_count();
113 
114  private:
116  void init(const Parameters& params);
117 
119  void init();
120 
122  void tidyup();
123 
124 #ifdef USE_FACTORY
125  private:
126  static AFopr<AFIELD> *create_object(AFopr<AFIELD> *fopr)
127  { return new AFopr_Chebyshev<AFIELD>(fopr); }
128 
129  static AFopr<AFIELD> *create_object_with_params(AFopr<AFIELD> *fopr,
130  const Parameters& params)
131  { return new AFopr_Chebyshev<AFIELD>(fopr, params); }
132 
133  public:
134  static bool register_factory()
135  {
136  bool init = true;
138  "Chevyshev", create_object);
140  "Chevyshev", create_object_with_params);
141  return init;
142  }
143 #endif
144 };
145 
146 #endif
AFopr_Chebyshev::convert
virtual void convert(AFIELD &v, const Field &w)
converts a Field object into other format if necessary.
Definition: afopr_Chebyshev.h:101
AFopr_Chebyshev::m_NexF
int m_NexF
Definition: afopr_Chebyshev.h:41
AFopr_Chebyshev::set_config
void set_config(Field *U)
setting gauge configuration.
Definition: afopr_Chebyshev-tmpl.h:169
bridgeIO.h
AFopr_Chebyshev::flop_count
double flop_count()
returns the number of floating point operations.
Definition: afopr_Chebyshev-tmpl.h:272
AFopr_Chebyshev::m_dj
std::vector< AFIELD > m_dj
Definition: afopr_Chebyshev.h:52
AFopr
Definition: afopr.h:48
AFopr_Chebyshev::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: afopr_Chebyshev.h:108
AFopr_Chebyshev::real_t
AFIELD::real_t real_t
Definition: afopr_Chebyshev.h:38
AFopr_Chebyshev::m_mode
std::string m_mode
mult mode
Definition: afopr_Chebyshev.h:48
Parameters
Class for parameters.
Definition: parameters.h:46
AFopr_Chebyshev::mult
void mult(AFIELD &v, const AFIELD &w)
multiplies fermion operator to a given field.
Definition: afopr_Chebyshev-tmpl.h:194
AFopr_Chebyshev::set_parameters
void set_parameters(const Parameters &params)
setting parameters with a Parameter object.
Definition: afopr_Chebyshev-tmpl.h:86
AFopr_Chebyshev::~AFopr_Chebyshev
~AFopr_Chebyshev()
Definition: afopr_Chebyshev.h:66
AFopr_Chebyshev::AFopr_Chebyshev
DEPRECATED AFopr_Chebyshev(AFopr< AFIELD > *fopr)
Definition: afopr_Chebyshev.h:62
real_t
double real_t
Definition: bridgeQXS_Clover_coarse_double.cpp:16
AFopr_Chebyshev::mult_dag
void mult_dag(AFIELD &v, const AFIELD &w)
hermitian conjugate of mult.
Definition: afopr_Chebyshev.h:87
Field::real_t
double real_t
Definition: field.h:51
AFopr_Chebyshev::m_Vthrs
real_t m_Vthrs
Definition: afopr_Chebyshev.h:43
AFopr_Chebyshev::tidyup
void tidyup()
final cleanup.
Definition: afopr_Chebyshev-tmpl.h:78
AFopr_Chebyshev::init
void init()
initial setup (obsolete).
Definition: afopr_Chebyshev-tmpl.h:49
AFopr_Chebyshev::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Chebyshev-tmpl.h:157
AFopr_Chebyshev::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: afopr_Chebyshev.h:109
AFopr_Chebyshev::m_Fcb2
real_t m_Fcb2
Definition: afopr_Chebyshev.h:44
AFopr_Chebyshev::m_Npcb
int m_Npcb
Definition: afopr_Chebyshev.h:42
AFopr_Chebyshev::m_Nvol
int m_Nvol
Definition: afopr_Chebyshev.h:41
AFopr_Chebyshev::reverse
virtual void reverse(Field &v, const AFIELD &w)
reverses to a Field object from other format if necessary.
Definition: afopr_Chebyshev.h:105
AFopr_Chebyshev::AFopr_Chebyshev
AFopr_Chebyshev(AFopr< AFIELD > *fopr, const Parameters &params)
standard constructor.
Definition: afopr_Chebyshev.h:56
AFopr_Chebyshev::class_name
static const std::string class_name
Definition: afopr_Chebyshev.h:37
AFopr_Chebyshev::get_mode
std::string get_mode() const
returns the current mult mode.
Definition: afopr_Chebyshev-tmpl.h:186
AFopr_Chebyshev::m_Fcb1
real_t m_Fcb1
Definition: afopr_Chebyshev.h:44
AFopr_Chebyshev
Chebyshev polynomial.
Definition: afopr_Chebyshev.h:34
AFopr_Chebyshev::set_mode
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: afopr_Chebyshev-tmpl.h:177
AFopr_Chebyshev::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: afopr_Chebyshev.h:110
AFopr_Chebyshev::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: afopr_Chebyshev.h:50
AFopr_Chebyshev::m_fopr
AFopr< AFIELD > * m_fopr
Definition: afopr_Chebyshev.h:46
AFopr_Chebyshev::m_Vmax
real_t m_Vmax
Definition: afopr_Chebyshev.h:43
Field
Container of Field-type object.
Definition: field.h:46
afopr.h
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
AFopr_Chebyshev::needs_convert
virtual bool needs_convert()
returns true if additional field conversion is needed.
Definition: afopr_Chebyshev.h:97
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
AFopr_Chebyshev::m_NinF
int m_NinF
Definition: afopr_Chebyshev.h:41