CHROMA
multi_syssolver_qphix_clover_params.cc
Go to the documentation of this file.
2 #include "chromabase.h"
3 #include "io/xml_group_reader.h"
4 #include "chroma_config.h"
5 
6 
7 
8 using namespace QDP;
9 
10 namespace Chroma {
11 
12 
13  MultiSysSolverQPhiXCloverParams::MultiSysSolverQPhiXCloverParams(XMLReader& xml,
14  const std::string& path)
15  {
16  XMLReader paramtop(xml, path);
17 
18  read(paramtop, "MaxIter", MaxIter);
19  read(paramtop, "MaxShifts", MaxShifts);
20  read(paramtop, "RsdTarget", RsdTarget);
21  read(paramtop, "CloverParams", CloverParams);
22  read(paramtop, "AntiPeriodicT", AntiPeriodicT);
23 
24  if ( paramtop.count("Verbose") > 0 ) {
25  read(paramtop, "Verbose", VerboseP);
26  }
27  else {
28  VerboseP = false;
29  }
30 
31  if ( paramtop.count("SolutionCheck") > 0 ) {
32  read(paramtop, "SolutionCheck", SolutionCheckP);
33  }
34  else {
35  SolutionCheckP = true;
36  }
37 
38  if (paramtop.count("Delta") > 0 ) {
39  read(paramtop,"Delta", Delta);
40  }
41  else {
42  Delta = Real(-1);
43  }
44 
45 
46  if( paramtop.count("RsdToleranceFactor") > 0 ) {
47  read(paramtop, "RsdToleranceFactor", RsdToleranceFactor);
48  }
49  else {
50  RsdToleranceFactor = Real(10); // Tolerate an order of magnitude difference by default.
51  }
52 
53  }
54 
55  void read(XMLReader& xml, const std::string& path,
57  {
59  p = tmp;
60  }
61 
62  void write(XMLWriter& xml, const std::string& path,
64  push(xml, path);
65  write(xml, "MaxIter", p.MaxIter);
66 
67  // Hack. Write delta only if it is greater than 0.
68  // -ve sign indicates user did not supply
69  if( toBool(p.Delta > 0 ) ) {
70  write(xml, "Delta", p.Delta);
71  }
72  write(xml, "MaxShifts", p.MaxShifts);
73  write(xml, "RsdTarget", p.RsdTarget);
74  write(xml, "Verbose", p.VerboseP);
75  write(xml, "SolutionCheck", p.SolutionCheckP);
76  write(xml, "CloverParams", p.CloverParams);
77  write(xml, "AntiPeriodicT", p.AntiPeriodicT);
78  write(xml, "RsdToleranceFactor", p.RsdToleranceFactor);
79 
80 
81  }
82 
83 
84 
85 }
Primary include file for CHROMA library code.
Double tmp
Definition: meslate.cc:60
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
void write(XMLWriter &xml, const std::string &path, const MultiSysSolverQPhiXCloverParams &p)
void read(XMLReader &xml, const std::string &path, MultiSysSolverQPhiXCloverParams &p)
::std::string string
Definition: gtest.h:1979
push(xml_out,"Cooled_Topology")
Read an XML group as a std::string.