CHROMA
syssolver_OPTeigbicg_params.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Solve a biCG system
4  */
5 
6 #ifndef __syssolver_OPTeigbicg_params_h__
7 #define __syssolver_OPTeigbicg_params_h__
8 
9 #include "chromabase.h"
10 
11 
12 namespace Chroma
13 {
14 
15  //! Params for EigBiCG inverter
16  /*! \ingroup invert */
18  {
20  SysSolverOptEigBiCGParams(XMLReader& in, const std::string& path);
21 
22  Real RsdCG ; /*!< CG residual */
23  int MaxCG ; /*!< Maximum CG iterations */
24  int PrintLevel ; /*!< Debugg level */
25  int Neig ; /*!< number of eigenvectors to compute */
26  int Nmax ; /*!< number of basis vectors */
27  int esize ; /*!< 2*lde+2*nev <= esize <= 2*(nev+1)*lde */
28  int Neig_max ; /*!< maximum number of eigenvectors to be refined*/
29 
30  Real restartTol ; /*!< CG restart tolerence: restart when
31  |res|<restartTol*|b-A x(0)| */
32 
33  Real NormAest ; /* an estimate of the norm2 of the Matrix */
34 
35  std::string sort_option; /* (IN) option for sorting eigenvalues computed by eigbicg
36  'M' for smallest magnitude and 'R' for smallest real part*/
37 
38  Real epsi; /* (IN) threshold used to check if two eignvalues are conjugate pairs:
39  if( imag(x)*imag(y) < 0 and
40  abs(imag(x)+imag(y))/abs(x+y) < epsi and
41  abs(real(x)-real(y)) / abs(x+y) < epsi )
42  then x and y are considered to be conjugate, otherwise they are not.*/
43 
44  int ConvTestOpt; /* (IN)option for how to determine convergence of the linear system
45  1 means norm(residual) < tol*norm(b)
46  2 means norm(residual) < MAX( tol*norm(b), MACHEPS*(AnormEst*norm(x)+norm(b)))
47  with MACHEPS=1e-7 for single precision version and 1e-16 for double precision version.*/
48  bool cleanUpEvecs ; /*!< clean up evecs upon destruction of SystemSolver*/
49  std::string eigen_id ; /*!< named buffer holding the eigenvectors */
50 
51  struct File_t
52  {
53  bool read ;
54  bool write ;
56  QDP_volfmt_t file_volfmt;
57  } file;
58 
59 
60  void defaults(){
61  RsdCG = 1.0e-8;
62  MaxCG = 1000;
63  PrintLevel=2;
64  restartTol = zero;
65 
66  Neig =0 ;
67  Neig_max =0 ;
68  esize = 4 ;
69  NormAest = 5.0 ;
70 
71  sort_option = "M";
72 
73  epsi = 1.0e-8 ;
74 
75  ConvTestOpt = 1 ;
76 
77  cleanUpEvecs=false;
78  eigen_id="NULL";
79 
80  //IO control
82  file.file_volfmt = QDPIO_SINGLEFILE ;
83 
84 
85  file.read = false;
86  file.write = false;
87 
88  }
89 
90  };
91 
92 
93  // Reader/writers
94  /*! \ingroup invert */
95  void read(XMLReader& xml, const std::string& path, SysSolverOptEigBiCGParams& param);
96 
97  /*! \ingroup invert */
98  void write(XMLWriter& xml, const std::string& path, const SysSolverOptEigBiCGParams& param);
99 
100 } // End namespace
101 
102 #endif
103 
Primary include file for CHROMA library code.
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
Double zero
Definition: invbicg.cc:106
static QDP_ColorVector * in
::std::string string
Definition: gtest.h:1979
struct Chroma::SysSolverOptEigBiCGParams::File_t file