6 #ifndef __syssolver_mdagm_cg_h__
7 #define __syssolver_mdagm_cg_h__
23 namespace MdagMSysSolverCGEnv
51 const Subset&
subset()
const {
return A->subset();}
63 swatch.reset(); swatch.start();
68 #ifdef CHROMA_DO_ONE_CG_RESTART
78 r[
A->subset()] -=
chi;
79 res.
resid = sqrt(norm2(
r,
A->subset()));
83 QDPIO::cout <<
"CG_SOLVER: " << res.
n_count
84 <<
" iterations. Rsd = " << res.
resid
85 <<
" Relative Rsd = " << res.
resid/sqrt(norm2(
chi,
A->subset())) << std::endl;
87 double time = swatch.getTimeInSeconds();
88 QDPIO::cout <<
"CG_SOLVER_TIME: "<<time<<
" sec" << std::endl;
Abstract interface for a Chronological Solution predictor.
virtual void newVector(const T &psi)=0
Class for counted reference semantics.
Solve a CG2 system. Here, the operator is NOT assumed to be hermitian.
SystemSolverResults_t operator()(T &psi, const T &chi, AbsChronologicalPredictor4D< T > &predictor) const
Solve the linear system starting with a chrono guess.
SysSolverCGParams invParam
const Subset & subset() const
Return the subset on which the operator acts.
SystemSolverResults_t operator()(T &psi, const T &chi) const
Solver the linear system.
Handle< LinearOperator< T > > A
MdagMSysSolverCG(Handle< LinearOperator< T > > A_, const SysSolverCGParams &invParam_)
Constructor.
~MdagMSysSolverCG()
Destructor is automatic.
SystemSolver disambiguator.
SystemSolverResults_t InvCG2(const LinearOperator< LatticeFermionF > &M, const LatticeFermionF &chi, LatticeFermionF &psi, const Real &RsdCG, int MaxCG)
Conjugate-Gradient (CGNE) algorithm for a generic Linear Operator.
Class for counted reference semantics.
Conjugate-Gradient algorithm for a generic Linear Operator.
M^dag*M composition of a linear operator.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
Holds return info from SystemSolver call.
Disambiguator for MdagM system solvers.
Handle< LinearOperator< T > > MdagM