CHROMA
overlap_state_info.h
Go to the documentation of this file.
1 #ifndef OVERLAP_STATE_INFO_H
2 #define OVERLAP_STATE_INFO_H
3 
4 #include "chromabase.h"
5 #include "io/param_io.h"
6 #include "io/eigen_io.h"
7 
8 namespace Chroma
9 {
10 
12  private:
13  bool initedP;
14  Real ApproxMin;
15  Real ApproxMax;
16  int NWilsVec;
20 
21  void notInited(void) const {
22  QDPIO::cerr << "OverlapStateInfo not inited" << std::endl;
23  QDP_abort(1);
24  }
25 
26  void notLoadEig(void) const {
27  QDPIO::cerr << "No loadable Eigenvalues. No eigen_io member " << std::endl;
28  QDP_abort(1);
29  }
30 
31  void notComputeEig(void) const {
32  QDPIO::cerr << "Eigenvalues should not be computed. No Ritz Member" << std::endl;
33  QDP_abort(1);
34  }
35 
36  public:
37 
38 
39  OverlapStateInfo(void);
40 
41  void init(const Real& _ApproxMin,
42  const Real& _ApproxMax,
43  const int& _NWilsVec,
44  const bool& _load_eigenP,
45  const EigenIO_t& _eigen_io,
46  const RitzParams_t& _ritzery) {
47  ApproxMin = _ApproxMin;
48  ApproxMax =_ApproxMax;
49  NWilsVec= _NWilsVec;
50  load_eigenP = _load_eigenP;
51  eigen_io = _eigen_io;
52  ritzery = _ritzery;
53  initedP = true;
54  }
55 
56 
57  const Real& getApproxMin(void) const {
58  if( ! initedP )
59  notInited();
60  return ApproxMin;
61  }
62 
63  const Real& getApproxMax(void) const {
64  if( ! initedP )
65  notInited();
66  return ApproxMax;
67  }
68 
69  int getNWilsVec(void) const {
70  if( ! initedP )
71  notInited();
72  return NWilsVec;
73  }
74 
75  bool loadEigVec(void) const {
76  if( ! initedP )
77  notInited();
78  return ( load_eigenP && (NWilsVec > 0) );
79  }
80 
81  bool computeEigVec(void) const {
82  if( ! initedP )
83  notInited();
84  return ( (!load_eigenP) && (NWilsVec > 0));
85  }
86 
87  const EigenIO_t& getEigenIO(void) const {
88  if( ! initedP)
89  notInited();
90 
91  if( ! loadEigVec() )
92  notLoadEig();
93 
94  return eigen_io;
95  }
96 
97  const RitzParams_t& getRitzParams(void) const {
98  if (! initedP)
99  notInited();
100 
101  if( computeEigVec() )
102  notComputeEig();
103 
104  return ritzery;
105  }
106 
107  // Virtual Destructor
109  };
110 
111  void read(XMLReader& xml_in, const std::string& path, OverlapStateInfo& info);
112  void write(XMLWriter& xml_out, const std::string& path, const OverlapStateInfo& info);
113 
114 }
115 
116 
117 #endif
Primary include file for CHROMA library code.
const RitzParams_t & getRitzParams(void) const
const EigenIO_t & getEigenIO(void) const
void init(const Real &_ApproxMin, const Real &_ApproxMax, const int &_NWilsVec, const bool &_load_eigenP, const EigenIO_t &_eigen_io, const RitzParams_t &_ritzery)
const Real & getApproxMax(void) const
bool computeEigVec(void) const
const Real & getApproxMin(void) const
void notComputeEig(void) const
Eigenvalue IO.
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
static QOP_info_t info
::std::string string
Definition: gtest.h:1979
Various parameter structs and reader/writers.
Struct for dumping the eigenvalues/vectors.
Definition: eigen_io.h:40
Struct for parameters needed for a Ritz KS type solve.
Definition: eigen_io.h:22