CHROMA
mg_solver_exception.h
Go to the documentation of this file.
1 #include "chromabase.h"
2 #include <exception>
3 #include <string>
4 #include <sstream>
5 namespace Chroma {
6 
7  class MGSolverException : public std::exception
8  {
9  public:
10  MGSolverException(const Real& Mass, const std::string& SubspaceId, int Iters, const Real& Rsd, const Real& RsdTarget) :
11  _Mass(Mass), _SubspaceId(SubspaceId), _Iters(Iters), _Rsd(Rsd), _RsdTarget(RsdTarget) {
12  std::ostringstream message;
13  message << "MultiGrid Exception. SubspaceId=" << _SubspaceId
14  << " Mass=" << _Mass
15  << " Iters=" << _Iters
16  << " RsdTarget=" << _RsdTarget
17  << " Rsd=" << _Rsd ;
18 
19  _MsgString = message.str();
20 
21 
22  }
23 
24 
25  virtual const char* what() const throw()
26  {
27 
28  return _MsgString.c_str();
29 
30  }
31 
32  const std::string& whatStr() const { return _MsgString; }
33  const Real& getMass() const { return _Mass; }
34  const std::string& getSubspaceID() const { return _SubspaceId; }
35  const int& getIters() const { return _Iters; }
36  const Real& getRsd() const { return _Rsd; }
37  const Real& getRsdTarget() const { return _RsdTarget; }
38 
39  private:
40  Real _Mass; // quark mass
41  std::string _SubspaceId; // the subspace
42  int _Iters; // Number of iterations taken
43  Real _Rsd; // Actual Residuum
44  Real _RsdTarget; // Target Residuum
45  std::string _MsgString; // The error string
46  };
47 
48 
49 }
Primary include file for CHROMA library code.
const std::string & whatStr() const
const std::string & getSubspaceID() const
const Real & getRsdTarget() const
virtual const char * what() const
const int & getIters() const
const Real & getMass() const
const Real & getRsd() const
MGSolverException(const Real &Mass, const std::string &SubspaceId, int Iters, const Real &Rsd, const Real &RsdTarget)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > & Mass
Definition: pbg5p_w.cc:29
::std::string string
Definition: gtest.h:1979