CHROMA
syssolver_linop_cg.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Solve a M*psi=chi linear system by CG2
3  */
4 #include "state.h"
7 
9 
10 namespace Chroma
11 {
12 
13  //! CG1 system solver namespace
14  namespace LinOpSysSolverCGEnv
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,
31  LatticeFermion,
32  multi1d<LatticeColorMatrix>,
33  multi1d<LatticeColorMatrix>
34  >
35  > state,
36 
38  {
39  return new LinOpSysSolverCG<LatticeFermion>(A, SysSolverCGParams(xml_in, path));
40  }
41 
42  //! Callback function
44  const std::string& path,
46  LatticeFermionF,
47  multi1d<LatticeColorMatrixF>,
48  multi1d<LatticeColorMatrixF>
49  >
50  > state,
51 
53  {
54  return new LinOpSysSolverCG<LatticeFermionF>(A, SysSolverCGParams(xml_in, path));
55  }
56 
57  //! Callback function
59  const std::string& path,
61  {
63  }
64 
65  //! Register all the factories
66  bool registerAll()
67  {
68  bool success = true;
69  if (! registered)
70  {
74  registered = true;
75  }
76  return success;
77  }
78  }
79 }
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
Solve a M*psi=chi linear system by CG2.
static T & Instance()
Definition: singleton.h:432
static bool registered
Local registration flag.
const std::string name
Name to be used.
LinOpSystemSolver< LatticeFermionF > * createFermF(XMLReader &xml_in, const std::string &path, Handle< FermState< LatticeFermionF, multi1d< LatticeColorMatrixF >, multi1d< LatticeColorMatrixF > > > state, Handle< LinearOperator< LatticeFermionF > > A)
Callback function.
LinOpSystemSolver< 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.
LinOpSystemSolver< LatticeStaggeredFermion > * createStagFerm(XMLReader &xml_in, const std::string &path, Handle< LinearOperator< LatticeStaggeredFermion > > 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
Support class for fermion actions and linear operators.
Params for CG inverter.
Register linop system solvers that solve M*psi=chi.
Solve a M*psi=chi linear system by CG2.
Factory for solving M*psi=chi where M is not hermitian or pos. def.