CHROMA
zero_guess_predictor.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Zero initial guess predictor
4  *
5  * Predictors for HMC
6  */
7 
8 #ifndef __zero_guess_predictor_h__
9 #define __zero_guess_predictor_h__
10 
11 #include "chromabase.h"
14 
15 
16 namespace Chroma
17 {
18 
19  /*! @ingroup predictor */
20  namespace ZeroGuess4DChronoPredictorEnv
21  {
22  extern const std::string name;
23  bool registerAll();
24  }
25 
26  //! Zero initial guess predictor
27  /*! @ingroup predictor */
29  public AbsTwoStepChronologicalPredictor4D<LatticeFermion>
30  {
31  public:
32 
33  // Destructor is automagic
35 
36  // Zero out psi -- it is a zero guess after all
37  void predictX(LatticeFermion& X,
39  const LatticeFermion& chi)
40  {
41  START_CODE();
42 
43  QDPIO::cout << "ZeroGuessPredictor: zeroing initial guess" << std::endl;
44  X = zero;
45 
46  END_CODE();
47  }
48 
49  void predictY(LatticeFermion& Y,
51  const LatticeFermion& chi)
52  {
53  START_CODE();
54 
55  QDPIO::cout << "ZeroGuessPredictor: zeroing initial guess" << std::endl;
56  Y = zero;
57 
58  END_CODE();
59  }
60 
61 
62 
63  // No internal state so reset is a nop
64  void reset(void) {
65  }
66 
67  // Ignore new std::vector
68  void newXVector(const LatticeFermion& psi) {
69  QDPIO::cout << "ZeroGuessPredictor: registering new solution (not)" << std::endl;
70  }
71 
72  void newYVector(const LatticeFermion& psi) {
73  QDPIO::cout << "ZeroGuessPredictor: registering new solution (not)" << std::endl;
74  }
75 
76  };
77 
78 
79 
80  /*! @ingroup predictor */
81  namespace ZeroGuess5DChronoPredictorEnv
82  {
83  extern const std::string name;
84  bool registerAll();
85  }
86 
87  //! Zero initial guess predictor
88  /*! @ingroup predictor */
90  public AbsChronologicalPredictor5D<LatticeFermion>
91  {
92  public:
94 
95  // Creation
96  ZeroGuess5DChronoPredictor(const int N5_) : N5(N5_) {}
97 
98  // Copying
100  N5(p.N5) {}
101 
102  // Zero out psi -- it is a zero guess after all
103  void operator()(multi1d<LatticeFermion>& psi,
105  const multi1d<LatticeFermion>& chi)
106  {
107  START_CODE();
108 
109  if (A.size() != N5)
110  {
111  QDPIO::cerr << "ZeroGuess5D: mismatched sizes A.size=" << A.size()
112  << " and N5=" << N5 << std::endl;
113  QDP_abort(1);
114  }
115  psi.resize(N5);
116  psi = zero;
117 
118  END_CODE();
119  }
120 
121 
122  // No internal state so reset is a Nop
123  void reset(void) {
124  }
125 
126  // Ignore new std::vector
127  void newVector(const multi1d<LatticeFermion>& psi) {
128  QDPIO::cout << "ZeroGuessPredictor: registering new solution (not)" << std::endl;
129  }
130 
131  private:
132  const int N5;
133  };
134 
135 } // End Namespace Chroma
136 
137 #endif
Primary include file for CHROMA library code.
Chronological predictor for HMC.
Monomial factories.
Abstract interface for a Chronological Solution predictor in 5D.
Abstract interface for a Chronological Solution predictor.
Linear Operator to arrays.
Definition: linearop.h:61
Zero initial guess predictor.
void newXVector(const LatticeFermion &psi)
void newYVector(const LatticeFermion &psi)
void predictY(LatticeFermion &Y, const LinearOperator< LatticeFermion > &A, const LatticeFermion &chi)
void predictX(LatticeFermion &X, const LinearOperator< LatticeFermion > &A, const LatticeFermion &chi)
Zero initial guess predictor.
ZeroGuess5DChronoPredictor(const ZeroGuess5DChronoPredictor &p)
void newVector(const multi1d< LatticeFermion > &psi)
void operator()(multi1d< LatticeFermion > &psi, const LinearOperatorArray< LatticeFermion > &A, const multi1d< LatticeFermion > &chi)
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
START_CODE()
A(A, psi, r, Ncb, PLUS)
Double zero
Definition: invbicg.cc:106
::std::string string
Definition: gtest.h:1979