Bridge++  Ver. 2.0.2
asolver_CGNR.h
Go to the documentation of this file.
1 
10 #ifndef ASOLVER_CGNR_INCLUDED
11 #define ASOLVER_CGNR_INCLUDED
12 
14 
16 
30 template<typename AFIELD>
31 class ASolver_CGNR : public ASolver_CG<AFIELD>
32 {
33  public:
34  typedef typename AFIELD::real_t real_t;
35  static const std::string class_name;
36 
38 
39  private:
42  std::string m_mode_fopr;
43  double m_flop;
44 
45  public:
46 
48  : ASolver_CG<AFIELD>(fopr), m_fopr(fopr)
49  { init(); }
50 
51  ASolver_CGNR(unique_ptr<AFopr<AFIELD> >& fopr)
52  : ASolver_CG<AFIELD>(fopr.get()), m_fopr(fopr.get())
53  { init(); }
54 
56 
57  void set_parameters(const Parameters& params);
58 
59  void solve(AFIELD& solution, const AFIELD& source,
60  int& Nconv, real_t& diff);
61 
63 
64  double flop_count();
65 
66  private:
67  void init();
68 
69 #ifdef USE_FACTORY
70  private:
71  static ASolver<AFIELD> *create_object_with_fopr(AFopr<AFIELD> *fopr)
72  {
73  return new ASolver_CGNR<AFIELD>(fopr);
74  }
75 
76  public:
77  static bool register_factory()
78  {
80  create_object_with_fopr);
81  }
82 #endif
83 };
84 #endif
ASolver_CGNR::solve
void solve(AFIELD &solution, const AFIELD &source, int &Nconv, real_t &diff)
solver main.
Definition: asolver_CGNR-tmpl.h:49
AFopr
Definition: afopr.h:48
ASolver
Definition: asolver.h:23
ASolver_CGNR::ASolver_CGNR
ASolver_CGNR(AFopr< AFIELD > *fopr)
Definition: asolver_CGNR.h:47
ASolver_CGNR::m_flop
double m_flop
Definition: asolver_CGNR.h:43
Parameters
Class for parameters.
Definition: parameters.h:46
ASolver_CG
Definition: asolver_CG.h:16
ASolver_CGNR::real_t
AFIELD::real_t real_t
Definition: asolver_CGNR.h:34
ASolver_CGNR::m_b2
AFIELD m_b2
Definition: asolver_CGNR.h:41
ASolver_CGNR::init
void init()
Definition: asolver_CGNR-tmpl.h:24
real_t
double real_t
Definition: bridgeQXS_Clover_coarse_double.cpp:16
Field::real_t
double real_t
Definition: field.h:51
ASolver_CG::get_fopr
AFopr< AFIELD > * get_fopr()
returns the pointer to the fermion operator.
Definition: asolver_CG.h:73
ASolver_CGNR
CGNR solver.
Definition: asolver_CGNR.h:31
ASolver_CGNR::flop_count
double flop_count()
returns the floating point operation count.
Definition: asolver_CGNR-tmpl.h:131
ASolver_CGNR::m_mode_fopr
std::string m_mode_fopr
Definition: asolver_CGNR.h:42
ASolver_CGNR::set_parameters
void set_parameters(const Parameters &params)
setting parameters by a Parameter object.
Definition: asolver_CGNR-tmpl.h:36
ASolver_CGNR::ASolver_CGNR
ASolver_CGNR(unique_ptr< AFopr< AFIELD > > &fopr)
Definition: asolver_CGNR.h:51
ASolver_CGNR::get_fopr
AFopr< AFIELD > * get_fopr()
returns the pointer to the fermion operator.
Definition: asolver_CGNR.h:62
Field
Container of Field-type object.
Definition: field.h:46
asolver_CG.h
ASolver_CGNR::m_fopr
AFopr< AFIELD > * m_fopr
Definition: asolver_CGNR.h:40
ASolver_CGNR::class_name
static const std::string class_name
Definition: asolver_CGNR.h:35
ASolver_CGNR::~ASolver_CGNR
~ASolver_CGNR()
Definition: asolver_CGNR.h:55