CHROMA
lunprec_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 #ifndef __lunprec_h__
4 #define __lunprec_h__
5 
6 #include "handle.h"
7 #include "linearop.h"
8 #include "eoprec_linop.h"
9 
10 namespace Chroma
11 {
12  //! Gamma(5) hermitian linear operator
13  /*!
14  * \ingroup linop
15  *
16  * This routine is specific to Wilson fermions!
17  *
18  * This operator scales its input operator
19  */
20  template<typename T,typename P,typename Q>
21  class Lunprec : public LinearOperator<T>
22  {
23  public:
24  //! Initialize pointer with existing pointer
25  /*! Requires that the pointer p is a return value of new */
27 
28  //! Copy pointer (one more owner)
30 
31  //! Destructor
32  ~Lunprec() {}
33 
34  //! Subset comes from underlying operator
35  inline const Subset& subset() const {return A->subset();}
36 
37  //! Apply the operator onto a source std::vector
38  /*! For this operator, the sign is ignored */
39  inline void operator() (T& chi, const T& psi, enum PlusMinus isign) const
40  {
41 
42  try {
44  dynamic_cast<EvenOddPrecLinearOperator<T,P,Q>&>(*A);
45 
46  A_eo.unprecLinOp(chi, psi, isign);
47  }
48  catch(std::bad_cast& bc) {
49  QDPIO::cout << "Couldnt cast Linop to Even Odd Operator" << std::endl;
50  QDP_abort(1);
51  }
52  catch(...) {
53  QDPIO::cout << "Unknown exception occurred in lunprec::operator()" << std:: endl;
54  QDP_abort(1);
55  }
56 
57  }
58 
59  private:
61  };
62 
63 
64 } // End Namespace Chroma
65 
66 
67 #endif
Even-odd preconditioned linear operator.
Definition: eoprec_linop.h:92
virtual void unprecLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the UNPRECONDITIONED operator onto a source std::vector.
Definition: eoprec_linop.h:147
Class for counted reference semantics.
Definition: handle.h:33
Linear Operator.
Definition: linearop.h:27
Gamma(5) hermitian linear operator.
Definition: lunprec_w.h:22
const Subset & subset() const
Subset comes from underlying operator.
Definition: lunprec_w.h:35
~Lunprec()
Destructor.
Definition: lunprec_w.h:32
Handle< LinearOperator< T > > A
Definition: lunprec_w.h:60
Lunprec(LinearOperator< T > *p)
Initialize pointer with existing pointer.
Definition: lunprec_w.h:26
Lunprec(Handle< LinearOperator< T > > p)
Copy pointer (one more owner)
Definition: lunprec_w.h:29
void operator()(T &chi, const T &psi, enum PlusMinus isign) const
Apply the operator onto a source std::vector.
Definition: lunprec_w.h:39
Base class for even-odd preconditioned 4D and 5D Linop.
Class for counted reference semantics.
multi1d< int > bc
Linear Operators.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35