Bridge++  Ver. 2.0.2
ASolver_CG< AFIELD > Class Template Reference

#include <asolver_CG.h>

Inheritance diagram for ASolver_CG< AFIELD >:
ASolver< AFIELD > ASolver_CGNR< AFIELD >

Public Types

typedef AFIELD::real_t real_t
 
using InitialGuess = typename ASolver< AFIELD >::InitialGuess
 
- Public Types inherited from ASolver< AFIELD >
enum  InitialGuess { RHS, GIVEN, ZERO }
 
typedef AFIELD::real_t real_t
 

Public Member Functions

 ASolver_CG (AFopr< AFIELD > *fopr)
 constructor. More...
 
 ~ASolver_CG ()
 destructor. More...
 
void set_parameters (const Parameters &params)
 setting parameters by a Parameter object. More...
 
void set_parameters (const int Niter, const real_t Stop_cond)
 setting parameters. More...
 
void set_parameters (const int Niter, const real_t Stop_cond, const InitialGuess init_guess_mode)
 setting parameters. More...
 
void set_init_mode (const InitialGuess init_guess)
 
void solve (AFIELD &xq, const AFIELD &b, int &nconv, real_t &diff)
 solver main. More...
 
AFopr< AFIELD > * get_fopr ()
 returns the pointer to the fermion operator. More...
 
double flop_count ()
 returns the floating point operation count. More...
 
const std::string class_name
 
const std::string class_name
 
- Public Member Functions inherited from ASolver< AFIELD >
 ASolver ()
 
virtual ~ASolver ()
 
void set_parameter_verboselevel (const Bridge::VerboseLevel vl)
 
virtual void set_init_mode (const InitialGuess init_guess)
 

Static Public Attributes

static const std::string class_name = "ASolver_CG"
 

Protected Member Functions

 ASolver_CG ()
 calling constructor without fermion operator is forbidden. More...
 
void init (void)
 
void tidyup (void)
 
void solve_CG_init (real_t &rrp, real_t &rr)
 
void solve_CG_step (real_t &rrp, real_t &rr)
 

Protected Attributes

AFopr< AFIELD > * m_fopr
 fermion operator. More...
 
int m_Niter
 maximum iteration number. More...
 
real_t m_Stop_cond
 stopping criterion (squared). More...
 
int m_nconv
 to remember convergence iteration to provide flop count. More...
 
InitialGuess m_initial_mode
 mode switch for initial guess More...
 
AFIELD m_x
 working vectors. More...
 
AFIELD m_r
 
AFIELD m_p
 
AFIELD m_s
 
- Protected Attributes inherited from ASolver< AFIELD >
Bridge::VerboseLevel m_vl
 

Detailed Description

template<typename AFIELD>
class ASolver_CG< AFIELD >

Definition at line 16 of file asolver_CG.h.

Member Typedef Documentation

◆ InitialGuess

template<typename AFIELD >
using ASolver_CG< AFIELD >::InitialGuess = typename ASolver<AFIELD>::InitialGuess

Definition at line 22 of file asolver_CG.h.

◆ real_t

template<typename AFIELD >
typedef AFIELD::real_t ASolver_CG< AFIELD >::real_t

Definition at line 19 of file asolver_CG.h.

Constructor & Destructor Documentation

◆ ASolver_CG() [1/2]

template<typename AFIELD >
ASolver_CG< AFIELD >::ASolver_CG ( )
inlineprotected

calling constructor without fermion operator is forbidden.

Definition at line 38 of file asolver_CG.h.

◆ ASolver_CG() [2/2]

template<typename AFIELD >
ASolver_CG< AFIELD >::ASolver_CG ( AFopr< AFIELD > *  fopr)
inline

constructor.

Definition at line 45 of file asolver_CG.h.

◆ ~ASolver_CG()

template<typename AFIELD >
ASolver_CG< AFIELD >::~ASolver_CG ( )
inline

destructor.

Definition at line 53 of file asolver_CG.h.

Member Function Documentation

◆ class_name() [1/2]

const std::string ASolver_CG< AField< double, QXS > >::class_name

Definition at line 23 of file asolver_CG.cpp.

◆ class_name() [2/2]

const std::string ASolver_CG< AField< float, QXS > >::class_name

Definition at line 37 of file asolver_CG.cpp.

◆ flop_count()

template<typename AFIELD >
double ASolver_CG< AFIELD >::flop_count
virtual

returns the floating point operation count.

Reimplemented from ASolver< AFIELD >.

Reimplemented in ASolver_CGNR< AFIELD >.

Definition at line 229 of file asolver_CG-tmpl.h.

◆ get_fopr()

template<typename AFIELD >
AFopr<AFIELD>* ASolver_CG< AFIELD >::get_fopr ( )
inlinevirtual

returns the pointer to the fermion operator.

Reimplemented from ASolver< AFIELD >.

Reimplemented in ASolver_CGNR< AFIELD >.

Definition at line 73 of file asolver_CG.h.

◆ init()

template<typename AFIELD >
void ASolver_CG< AFIELD >::init ( void  )
protected

Definition at line 5 of file asolver_CG-tmpl.h.

◆ set_init_mode()

template<typename AFIELD >
void ASolver_CG< AFIELD >::set_init_mode ( const InitialGuess  init_guess)
inline

Definition at line 64 of file asolver_CG.h.

◆ set_parameters() [1/3]

template<typename AFIELD >
void ASolver_CG< AFIELD >::set_parameters ( const int  Niter,
const real_t  Stop_cond 
)

setting parameters.

Definition at line 79 of file asolver_CG-tmpl.h.

◆ set_parameters() [2/3]

template<typename AFIELD >
void ASolver_CG< AFIELD >::set_parameters ( const int  Niter,
const real_t  Stop_cond,
const InitialGuess  init_guess_mode 
)

setting parameters.

Definition at line 88 of file asolver_CG-tmpl.h.

◆ set_parameters() [3/3]

template<typename AFIELD >
void ASolver_CG< AFIELD >::set_parameters ( const Parameters params)
virtual

setting parameters by a Parameter object.

Implements ASolver< AFIELD >.

Reimplemented in ASolver_CGNR< AFIELD >.

Definition at line 35 of file asolver_CG-tmpl.h.

◆ solve()

template<typename AFIELD >
void ASolver_CG< AFIELD >::solve ( AFIELD xq,
const AFIELD b,
int &  nconv,
real_t diff 
)
virtual

solver main.

Reimplemented from ASolver< AFIELD >.

Reimplemented in ASolver_CGNR< AFIELD >.

Definition at line 110 of file asolver_CG-tmpl.h.

◆ solve_CG_init()

template<typename AFIELD >
void ASolver_CG< AFIELD >::solve_CG_init ( real_t rrp,
real_t rr 
)
protected

Definition at line 169 of file asolver_CG-tmpl.h.

◆ solve_CG_step()

template<typename AFIELD >
void ASolver_CG< AFIELD >::solve_CG_step ( real_t rrp,
real_t rr 
)
protected

Definition at line 204 of file asolver_CG-tmpl.h.

◆ tidyup()

template<typename AFIELD >
void ASolver_CG< AFIELD >::tidyup ( void  )
protected

Definition at line 26 of file asolver_CG-tmpl.h.

Member Data Documentation

◆ class_name

template<typename AFIELD >
const std::string ASolver_CG< AFIELD >::class_name = "ASolver_CG"
static

Definition at line 21 of file asolver_CG.h.

◆ m_fopr

template<typename AFIELD >
AFopr<AFIELD>* ASolver_CG< AFIELD >::m_fopr
protected

fermion operator.

Definition at line 26 of file asolver_CG.h.

◆ m_initial_mode

template<typename AFIELD >
InitialGuess ASolver_CG< AFIELD >::m_initial_mode
protected

mode switch for initial guess

Definition at line 35 of file asolver_CG.h.

◆ m_nconv

template<typename AFIELD >
int ASolver_CG< AFIELD >::m_nconv
protected

to remember convergence iteration to provide flop count.

Definition at line 32 of file asolver_CG.h.

◆ m_Niter

template<typename AFIELD >
int ASolver_CG< AFIELD >::m_Niter
protected

maximum iteration number.

Definition at line 28 of file asolver_CG.h.

◆ m_p

template<typename AFIELD >
AFIELD ASolver_CG< AFIELD >::m_p
protected

Definition at line 41 of file asolver_CG.h.

◆ m_r

template<typename AFIELD >
AFIELD ASolver_CG< AFIELD >::m_r
protected

Definition at line 41 of file asolver_CG.h.

◆ m_s

template<typename AFIELD >
AFIELD ASolver_CG< AFIELD >::m_s
protected

Definition at line 41 of file asolver_CG.h.

◆ m_Stop_cond

template<typename AFIELD >
real_t ASolver_CG< AFIELD >::m_Stop_cond
protected

stopping criterion (squared).

Definition at line 29 of file asolver_CG.h.

◆ m_x

template<typename AFIELD >
AFIELD ASolver_CG< AFIELD >::m_x
protected

working vectors.

Definition at line 41 of file asolver_CG.h.


The documentation for this class was generated from the following files: