6 #ifndef __syssolver_linop_cg_h__
7 #define __syssolver_linop_cg_h__
21 namespace LinOpSysSolverCGEnv
49 const Subset&
subset()
const {
return A->subset();}
69 #ifdef CHROMA_DO_ONE_CG_RESTART
78 double time = swatch.getTimeInSeconds();
85 r[
A->subset()] -=
tmp;
86 res.
resid = sqrt(norm2(
r,
A->subset()));
88 QDPIO::cout <<
"CG_SOLVER: " << res.
n_count <<
" iterations. Rsd = " << res.
resid <<
" Relative Rsd = " << res.
resid/sqrt(norm2(
chi,
A->subset())) << std::endl;
89 QDPIO::cout <<
"CG_SOLVER_TIME: "<<time<<
" sec" << std::endl;
Class for counted reference semantics.
Solve a M*psi=chi linear system by CG2.
const Subset & subset() const
Return the subset on which the operator acts.
SysSolverCGParams invParam
~LinOpSysSolverCG()
Destructor is automatic.
LinOpSysSolverCG(Handle< LinearOperator< T > > A_, const SysSolverCGParams &invParam_)
Constructor.
SystemSolverResults_t operator()(T &psi, const T &chi) const
Solver the linear system.
Handle< LinearOperator< T > > A
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.
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 LinOp system solvers.