CHROMA
comp_approx.cc
Go to the documentation of this file.
1 /*! @file
2  * @brief Components of rational approximation
3  */
4 
6 
7 namespace Chroma
8 {
9 
10  //-----------------------------------------------------------------------------
11  //! Remez param
12  void read(XMLReader& xml, const std::string& path,
13  TermApprox_t& param)
14  {
15  XMLReader paramtop(xml, path);
16 
17  param.ratApprox = readXMLGroup(paramtop, "RationalApprox", "ratApproxType");
18  param.invParam = readXMLGroup(paramtop, "InvertParam", "invType");
19  }
20 
21  //! Remez param
22  void write(XMLWriter& xml, const std::string& path,
23  const TermApprox_t& param)
24  {
25  push(xml, path);
26 
27  xml << param.ratApprox.xml;
28  xml << param.invParam.xml;
29 
30  pop(xml);
31  }
32 
33 
34  //-----------------------------------------------------------------------------
35  //! Remez param
36  void read(XMLReader& xml, const std::string& path,
37  CompApprox_t& param)
38  {
39  XMLReader paramtop(xml, path);
40 
41  param.fermact = readXMLGroup(paramtop, "FermionAction", "FermAct");
42  read(paramtop, "ActionApprox", param.action);
43  read(paramtop, "ForceApprox", param.force);
44  }
45 
46 
47  //! Write Parameters
48  void write(XMLWriter& xml, const std::string& path,
49  const CompApprox_t& params)
50  {
51  push(xml, path);
52 
53  xml << params.fermact.xml;
54  write(xml, "ActionApprox", params.action);
55  write(xml, "ForceApprox", params.force);
56 
57  pop(xml);
58  }
59 
60 
61  //-----------------------------------------------------------------------------
62  //! Remez param
63  void read(XMLReader& xml, const std::string& path,
64  CompAction_t& param)
65  {
66  XMLReader paramtop(xml, path);
67 
68  param.fermact = readXMLGroup(paramtop, "FermionAction", "FermAct");
69  }
70 
71 
72  //! Write Parameters
73  void write(XMLWriter& xml, const std::string& path,
74  const CompAction_t& params)
75  {
76  push(xml, path);
77 
78  xml << params.fermact.xml;
79 
80  pop(xml);
81  }
82 
83 
84  //-----------------------------------------------------------------------------
85  //! Remez param
86  void read(XMLReader& xml, const std::string& path,
87  CompActionInv_t& param)
88  {
89  XMLReader paramtop(xml, path);
90 
91  param.fermact = readXMLGroup(paramtop, "FermionAction", "FermAct");
92 
93  if( paramtop.count("InvertParam") == 0) {
94  // No invert param provided.
95  param.invParam.xml = "";
96  param.invParam.id = "NULL";
97  param.invParam.path = "";
98  }
99  else {
100  param.invParam = readXMLGroup(paramtop, "InvertParam", "invType");
101  }
102 
103  }
104 
105 
106  //! Write Parameters
107  void write(XMLWriter& xml, const std::string& path,
108  const CompActionInv_t& params)
109  {
110  push(xml, path);
111 
112  xml << params.fermact.xml;
113  xml << params.invParam.xml;
114 
115  pop(xml);
116  }
117 
118 } //end namespace Chroma
119 
120 
Components of rational approximation.
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.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
Params params
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
push(xml_out,"Condensates")
pop(xml_out)
::std::string string
Definition: gtest.h:1979
Params for numerator and denominator fermion actions.
Definition: comp_approx.h:67
Params for numerator and denominator fermion actions.
Definition: comp_approx.h:52
GroupXML_t fermact
Definition: comp_approx.h:53
Params for numerator and denominator fermion actions.
Definition: comp_approx.h:35
GroupXML_t fermact
Definition: comp_approx.h:36
TermApprox_t action
Definition: comp_approx.h:37
TermApprox_t force
Definition: comp_approx.h:38
Params for each major group - action/heatbath & force.
Definition: comp_approx.h:19
GroupXML_t invParam
Definition: comp_approx.h:21
GroupXML_t ratApprox
Definition: comp_approx.h:20