CHROMA
syssolver_linop_bicrstab.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Solve a M*psi=chi linear system by BICGSTAB
4  */
5 
6 #ifndef __syssolver_linop_bicrstab_h__
7 #define __syssolver_linop_bicrstab_h__
8 
9 #include "chroma_config.h"
10 #include "handle.h"
11 #include "syssolver.h"
12 #include "linearop.h"
16 
17 namespace Chroma
18 {
19 
20  //! BICGSTAB system solver namespace
21  namespace LinOpSysSolverBiCRStabEnv
22  {
23  //! Register the syssolver
24  bool registerAll();
25  }
26 
27 
28  //! Solve a M*psi=chi linear system by BICGSTAB
29  /*! \ingroup invert
30  */
31  template<typename T>
33  {
34  public:
35  //! Constructor
36  /*!
37  * \param A_ Linear operator ( Read )
38  * \param invParam inverter parameters ( Read )
39  */
41  const SysSolverBiCGStabParams& invParam_) :
42  A(A_), invParam(invParam_)
43  {}
44 
45  //! Destructor is automatic
47 
48  //! Return the subset on which the operator acts
49  const Subset& subset() const {return A->subset();}
50 
51  //! Solver the linear system
52  /*!
53  * \param psi solution ( Modify )
54  * \param chi source ( Read )
55  * \return syssolver results
56  */
58  {
59  START_CODE();
60 
61 
62  SystemSolverResults_t res; // initialized by a constructor
63 
64  // For now solve with PLUS until we add a way to explicitly
65  // ask for MINUS
66  res = InvBiCRStab(*A,
67  chi,
68  psi,
71  PLUS);
72 
73 
74  END_CODE();
75 
76  return res;
77  }
78 
79 
80  private:
81  // Hide default constructor
83 
86  };
87 
88 } // End namespace
89 
90 #endif
91 
Class for counted reference semantics.
Definition: handle.h:33
Solve a M*psi=chi linear system by BICGSTAB.
LinOpSysSolverBiCRStab(Handle< LinearOperator< T > > A_, const SysSolverBiCGStabParams &invParam_)
Constructor.
const Subset & subset() const
Return the subset on which the operator acts.
~LinOpSysSolverBiCRStab()
Destructor is automatic.
Handle< LinearOperator< T > > A
SystemSolverResults_t operator()(T &psi, const T &chi) const
Solver the linear system.
SystemSolver disambiguator.
Linear Operator.
Definition: linearop.h:27
Class for counted reference semantics.
Conjugate-Gradient algorithm for a generic Linear Operator.
Linear Operators.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LinOpSysSolverMGProtoClover::T T
SystemSolverResults_t InvBiCRStab(const LinearOperator< LatticeFermionF > &A, const LatticeFermionF &chi, LatticeFermionF &psi, const Real &RsdBiCGStab, int MaxBiCGStab, enum PlusMinus isign)
Definition: invbicrstab.cc:231
@ PLUS
Definition: chromabase.h:45
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
START_CODE()
Params for BiCGStab inverter.
Holds return info from SystemSolver call.
Definition: syssolver.h:17
Linear system solvers.
Solve a BICGSTAB system.
Disambiguator for LinOp system solvers.