CHROMA
syssolver_mdagm_cg.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Solve a MdagM*psi=chi linear system by CG2
3  */
4 
7 
9 
10 namespace Chroma
11 {
12 
13  //! CG2 system solver namespace
14  namespace MdagMSysSolverCGEnv
15  {
16  //! Anonymous namespace
17  namespace
18  {
19  //! Name to be used
20  const std::string name("CG_INVERTER");
21 
22  //! Local registration flag
23  bool registered = false;
24  }
25 
26 
27  //! Callback function
29  const std::string& path,
30  Handle< FermState< LatticeFermion, multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > > state,
31 
33  {
34  return new MdagMSysSolverCG<LatticeFermion>(A, SysSolverCGParams(xml_in, path));
35  }
36 
37  //! Callback function
39  const std::string& path,
40  Handle< FermState< LatticeFermionF, multi1d<LatticeColorMatrixF>, multi1d<LatticeColorMatrixF> > > state,
41 
43  {
44  return new MdagMSysSolverCG<LatticeFermionF>(A, SysSolverCGParams(xml_in, path));
45  }
46 
47  //! Callback function
49  const std::string& path,
50  Handle< FermState< LatticeFermionD, multi1d<LatticeColorMatrixD>, multi1d<LatticeColorMatrixD> > > state,
51 
53  {
54  return new MdagMSysSolverCG<LatticeFermionD>(A, SysSolverCGParams(xml_in, path));
55  }
56 
57  //! Register all the factories
58  bool registerAll()
59  {
60  bool success = true;
61  if (! registered)
62  {
66  registered = true;
67  }
68  return success;
69  }
70  }
71 }
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
Solve a CG2 system. Here, the operator is NOT assumed to be hermitian.
static T & Instance()
Definition: singleton.h:432
static bool registered
Local registration flag.
const std::string name
Name to be used.
MdagMSystemSolver< LatticeFermionD > * createFermD(XMLReader &xml_in, const std::string &path, Handle< FermState< LatticeFermionD, multi1d< LatticeColorMatrixD >, multi1d< LatticeColorMatrixD > > > state, Handle< LinearOperator< LatticeFermionD > > A)
Callback function.
MdagMSystemSolver< LatticeFermion > * createFerm(XMLReader &xml_in, const std::string &path, Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, Handle< LinearOperator< LatticeFermion > > A)
Callback function.
bool registerAll()
Register all the factories.
MdagMSystemSolver< LatticeFermionF > * createFermF(XMLReader &xml_in, const std::string &path, Handle< FermState< LatticeFermionF, multi1d< LatticeColorMatrixF >, multi1d< LatticeColorMatrixF > > > state, Handle< LinearOperator< LatticeFermionF > > A)
Callback function.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
A(A, psi, r, Ncb, PLUS)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
::std::string string
Definition: gtest.h:1979
Params for CG inverter.
Register MdagM system solvers.
Solve a MdagM*psi=chi linear system by CG2.
Factory for producing system solvers for MdagM*psi = chi.