CHROMA
eigen_io.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Eigenvalue IO
4  */
5 
6 #ifndef EIGEN_IO_H
7 #define EIGEN_IO_H
8 
9 #include "chromabase.h"
10 #include "io/cfgtype_io.h"
13 
14 #include <iostream>
15 
16 namespace Chroma
17 {
18 
19  //! Struct for parameters needed for a Ritz KS type solve
20  /*! \ingroup io */
21  struct RitzParams_t
22  {
23  int Neig;
24  Real RsdR;
25  Real RsdA;
26  Real RsdZero;
27  bool ProjApsiP;
28  int Ndummy;
30  int MaxKS;
31  int MinKSIter;
32  int MaxKSIter;
33  int MaxCG;
34  int Nrenorm;
35  };
36 
37  //! Struct for dumping the eigenvalues/vectors
38  /*! \ingroup io */
39  struct EigenIO_t
40  {
43  QDP_volfmt_t eigen_volfmt;
44  };
45 
46 
47  //! Struct for the overall application.
48  /*! \ingroup io */
50  {
51  int version;
54  multi1d<int> nrow;
55  QDP::Seed seed;
59  };
60 
61 
62  /*!
63  * \ingroup io
64  * @{
65  */
66  void read(XMLReader& xml, const std::string& path, RitzParams_t& header);
67  void read(XMLReader& xml, const std::string& path, EigenIO_t& header);
68  void read(XMLReader& xml, const std::string& path, ChromaWilsonRitz_t& header);
69 
70  void write(XMLWriter& xml, const std::string& path, const RitzParams_t& header);
71  void write(XMLWriter& xml, const std::string& path, const EigenIO_t& header);
72  void write(XMLWriter& xml, const std::string& path, const ChromaWilsonRitz_t& header);
73 
74  void writeEigen(const ChromaWilsonRitz_t& header, multi1d<Real>& lambda_lo,
75  multi1d<LatticeFermion>& eigv_lo, Real& lambda_hi,
76  QDP_serialparallel_t serpar);
77 
78 
79  void readEigenPair(Real& lambda_lo, int& eig_index,
80  LatticeFermion& eigv,
81  const std::string& filename,
82  QDP_serialparallel_t serpar,
83  XMLReader& file_xml);
84 
85  void readEigen(ChromaWilsonRitz_t& header, multi1d<Real>& lambda_lo,
86  multi1d<LatticeFermion>& eigv_lo, Real& lambda_hi,
87  const std::string& filename_stem,
88  int Neig,
89  QDP_serialparallel_t serpar);
90 
91  void readEigenSzin(multi1d<Real>& lambda_lo,
92  multi1d<LatticeFermion>& eigv_lo, Real& lambda_hi,
93  const int Neig,
94  const std::string& filename_stem);
95  /*! @} */ // end of group io
96 
97 } // end namespace Chroma
98 
99 #endif
Configuration structure IO.
Primary include file for CHROMA library code.
Eigenstd::vector type enum.
QDP volfmt enum.
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.
EigenVecType
Eigenstd::vector type.
void readEigenSzin(multi1d< Real > &lambda_lo, multi1d< LatticeFermion > &eigv_lo, Real &lambda_hi, const int Neig, const std::string &filename_stem)
Definition: eigen_io.cc:353
void readEigenPair(Real &lambda_lo, int &eig_index, LatticeFermion &eigv, const std::string &filename, QDP_serialparallel_t serpar, XMLReader &file_xml)
Definition: eigen_io.cc:217
void readEigen(ChromaWilsonRitz_t &header, multi1d< Real > &lambda_lo, multi1d< LatticeFermion > &eigv_lo, Real &lambda_hi, const std::string &filename_stem, int Neig, QDP_serialparallel_t serpar)
Definition: eigen_io.cc:276
void writeEigen(const ChromaWilsonRitz_t &header, multi1d< Real > &lambda_lo, multi1d< LatticeFermion > &eigv_lo, Real &lambda_hi, QDP_serialparallel_t serpar)
Definition: eigen_io.cc:170
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
::std::string string
Definition: gtest.h:1979
Gauge configuration structure.
Definition: cfgtype_io.h:16
Struct for the overall application.
Definition: eigen_io.h:50
multi1d< int > nrow
Definition: eigen_io.h:54
RitzParams_t ritz_params
Definition: eigen_io.h:56
std::string state_info
Definition: eigen_io.h:53
Struct for dumping the eigenvalues/vectors.
Definition: eigen_io.h:40
EigenVecType eigen_filefmt
Definition: eigen_io.h:41
std::string eigen_file
Definition: eigen_io.h:42
QDP_volfmt_t eigen_volfmt
Definition: eigen_io.h:43
Struct for parameters needed for a Ritz KS type solve.
Definition: eigen_io.h:22