6 #ifndef __syssolver_mdagm_mr_h__
7 #define __syssolver_mdagm_mr_h__
21 namespace MdagMSysSolverMREnv
49 const Subset&
subset()
const {
return A->subset();}
64 swatch.reset(); swatch.start();
74 re[
A->subset()] -=
chi;
75 res2.
resid = sqrt(norm2(re,
A->subset()));
79 QDPIO::cout <<
"MR_SOLVER: " << res2.
n_count
80 <<
" iterations. Rsd = " << res2.
resid
81 <<
" Relative Rsd = " << res2.
resid/sqrt(norm2(
chi,
A->subset())) << std::endl;
83 double time = swatch.getTimeInSeconds();
84 QDPIO::cout <<
"MR_SOLVER_TIME: "<<time<<
" sec" << std::endl;
106 swatch.reset(); swatch.start();
126 catch(std::bad_cast) {
143 re[
A->subset()] -=
chi;
144 res2.
resid = sqrt(norm2(re,
A->subset()));
148 QDPIO::cout <<
"MR_SOLVER: " << res2.
n_count
149 <<
" iterations. Rsd = " << res2.
resid
150 <<
" Relative Rsd = " << res2.
resid/sqrt(norm2(
chi,
A->subset())) << std::endl;
152 double time = swatch.getTimeInSeconds();
153 QDPIO::cout <<
"MR_SOLVER_TIME: "<<time<<
" sec" << std::endl;
Abstract interface for a Chronological Solution predictor.
virtual void newVector(const T &psi)=0
Abstract interface for a Chronological Solution predictor.
virtual void predictY(T &Y, const T &chi, const Subset &s) const
virtual void newYVector(const T &Y)=0
virtual void predictX(T &X, const T &chi, const Subset &s) const
virtual void newXVector(const T &X)=0
Class for counted reference semantics.
Solve a MR system. Here, the operator is NOT assumed to be hermitian.
Handle< LinearOperator< T > > A
~MdagMSysSolverMR()
Destructor is automatic.
SystemSolverResults_t operator()(T &psi, const T &chi) const
Solver the linear system.
MdagMSysSolverMR(Handle< LinearOperator< T > > A_, const SysSolverMRParams &invParam_)
Constructor.
const Subset & subset() const
Return the subset on which the operator acts.
SysSolverMRParams invParam
SystemSolver disambiguator.
SystemSolverResults_t InvMR(const LinearOperator< LatticeFermion > &M, const LatticeFermion &chi, LatticeFermion &psi, const Real &MRovpar, const Real &RsdMR, int MaxMR, enum PlusMinus isign)
Minimal-residual (MR) algorithm for a generic Linear Operator.
Class for counted reference semantics.
Minimal-Residual (MR) for a generic fermion 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