CHROMA
disp_soln_cache.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Cache for displaced solution vectors
4  */
5 
6 #ifndef __disp_soln_cache_h__
7 #define __disp_soln_cache_h__
8 
9 
10 #include "chromabase.h"
11 
12 #ifndef QDP_IS_QDPJIT_NO_NVPTX
13 
14 #include <qdp_map_obj_disk_multiple.h>
15 #include <qdp_map_obj_memory.h>
16 
17 //#include "util/ferm/distillation_soln_cache.h"
18 
19 #include <vector>
20 
21 namespace Chroma
22 {
23  //----------------------------------------------------------------------------
24  /*!
25  * \ingroup ferm
26  * @{
27  */
28 
29  //! The key for displaced color vectors
31  {
32  bool use_derivP;
33  std::vector<int> displacement; /*!< Orig plus/minus 1-based directional displacements */
34  multi1d<int> mom;
35  };
36 
37  // Quark read
38  void read(BinaryReader& bin, KeyDispSolnVector_t& param);
39 
40  // Quark write
41  void write(BinaryWriter& bin, const KeyDispSolnVector_t& param);
42 
43 
44  //---------------------------------------------------------------------
45  //! Cache for distillation
46  /*!
47  * \ingroup ferm
48  *
49  * Holds unsmeared distillation solution vectors
50  */
52  {
53  public:
54  //! Default constructor
55  DispSolnCache(const multi1d<LatticeColorMatrix>& u_smr,
56  const LatticeColorVectorSpinMatrix& soln_);
57 
58  //! Destructor
59  virtual ~DispSolnCache() {}
60 
61  //! Accessor
62  const LatticeColorVectorSpinMatrix& getDispVector(bool use_derivP, const multi1d<int>& mom,
63  const std::vector<int>& disp);
64 
65  protected:
66  //! Displace an object
67  const LatticeColorVectorSpinMatrix& displaceObject(const KeyDispSolnVector_t& key);
68 
69  private:
70  //! Displacement length
72 
73  //! Gauge field
74  const multi1d<LatticeColorMatrix>& u;
75 
76  // Disk cache of solutions
77  const LatticeColorVectorSpinMatrix& soln;
78 
79  //! Unsmeared vectors
80  QDP::MapObjectMemory<KeyDispSolnVector_t, LatticeColorVectorSpinMatrix> disp_src_map;
81  };
82 
83  /*! @} */ // end of group ferm
84 
85 } // namespace Chroma
86 
87 #endif // QDP_IS_QDPJIT
88 #endif // HEADER GUARD
Primary include file for CHROMA library code.
Cache for distillation.
const LatticeColorVectorSpinMatrix & soln
QDP::MapObjectMemory< KeyDispSolnVector_t, LatticeColorVectorSpinMatrix > disp_src_map
Unsmeared vectors.
const LatticeColorVectorSpinMatrix & displaceObject(const KeyDispSolnVector_t &key)
Displace an object.
const multi1d< LatticeColorMatrix > & u
Gauge field.
DispSolnCache(const multi1d< LatticeColorMatrix > &u_smr, const LatticeColorVectorSpinMatrix &soln_)
Default constructor.
int displacement_length
Displacement length.
virtual ~DispSolnCache()
Destructor.
const LatticeColorVectorSpinMatrix & getDispVector(bool use_derivP, const multi1d< int > &mom, const std::vector< int > &disp)
Accessor.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
The key for displaced color vectors.
std::vector< int > displacement