CHROMA
inline_eigbnds.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*! \file
4  * \brief Inline measurements for eigenvalue bounds
5  *
6  * Measure bounds of M^dag*M
7  */
8 
9 #ifndef __inline_eigbndsmdagm_h__
10 #define __inline_eigbndsmdagm_h__
11 
12 #include "chromabase.h"
13 #include "fermact.h"
15 #include "io/xml_group_reader.h"
16 
17 namespace Chroma
18 {
19  /*! \ingroup inlineeig */
20  namespace InlineEigBndsMdagMEnv
21  {
22  extern const std::string name;
23  bool registerAll();
24  }
25 
26 
27  //! Parameter structure
28  /*! \ingroup inlineeig */
30  {
32  InlineEigBndsMdagMParams(XMLReader& xml_in, const std::string& path);
33  void write(XMLWriter& xml_in, const std::string& path);
34 
35  unsigned long frequency;
36  GroupXML_t ferm_act; /*!< fermion action */
37  bool usePV; /*!< measure eigs of PV matrix if applicable */
38 
39  //! Struct for parameters needed for a Ritz type solve
40  struct RitzParams_t
41  {
42  Real RsdR;
43  Real RsdA;
44  Real RsdRHi;
45  Real RsdAHi;
46  Real RsdZero;
47  bool ProjApsiP;
48  int Nmin;
49  int MaxCG;
50  int Nrenorm;
51  int Neig;
52  } ritz;
53 
55  {
58 
59  std::string xml_file; // Alternate XML file pattern
60  };
61 
62 
63  //! Inline measurement of eigenvalue bounds of M^dag*M
64  /*! \ingroup inlineeig */
66  {
67  public:
71 
72  unsigned long getFrequency(void) const {return params.frequency;}
73 
74  //! Do the measurement
75  void operator()(unsigned long update_no,
76  XMLWriter& xml_out);
77 
78  protected:
79  //! Do the measurement
80  void func(const unsigned long update_no,
81  XMLWriter& xml_out);
82 
83  //! 4D
85  unsigned long update_no,
86  XMLWriter& xml_out);
87 
88  //! 5D
90  unsigned long update_no,
91  XMLWriter& xml_out);
92 
93  private:
95  Handle< FermionAction<LatticeFermion,
96  multi1d<LatticeColorMatrix>,
97  multi1d<LatticeColorMatrix> > > fermact;
98  };
99 
100 }
101 
102 #endif
Abstract inline measurements.
Primary include file for CHROMA library code.
Base class for quadratic matter actions (e.g., fermions)
Definition: fermact.h:53
Class for counted reference semantics.
Definition: handle.h:33
Inline measurement of eigenvalue bounds of M^dag*M.
InlineEigBndsMdagM(const InlineEigBndsMdagMParams &p)
void do4d(Handle< LinearOperator< LatticeFermion > > MM, unsigned long update_no, XMLWriter &xml_out)
4D
unsigned long getFrequency(void) const
Tell me how often I should measure this beastie.
InlineEigBndsMdagMParams params
InlineEigBndsMdagM(const InlineEigBndsMdagM &p)
void do5d(Handle< LinearOperatorArray< LatticeFermion > > MM, unsigned long update_no, XMLWriter &xml_out)
5D
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
Handle< FermionAction< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > fermact
void operator()(unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
Linear Operator to arrays.
Definition: linearop.h:61
Class structure for fermion actions.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
::std::string string
Definition: gtest.h:1979
Hold group xml and type id.
Struct for parameters needed for a Ritz type solve.
struct Chroma::InlineEigBndsMdagMParams::RitzParams_t ritz
struct Chroma::InlineEigBndsMdagMParams::NamedObject_t named_obj
void write(XMLWriter &xml_in, const std::string &path)
Read an XML group as a std::string.