41 namespace Test_Spectrum_CRSMatrix
47 const string& solution,
71 double Stop_cond = 1.0e-28;
85 solver->
solve(x, b2, Nconv, diff);
86 vout.
general(vl,
"solver(CG): Nconv = %4d diff = %12.6e\n", Nconv, diff);
90 double xx = x.
norm2();
108 std::ofstream field_out(filename.c_str());
109 if (!field_out.is_open()) {
110 vout.
crucial(
"Failed to open the text file. %s\n", filename.c_str());
114 vout.
general(
"Writing Field to %s\n", filename.c_str());
116 field_out << f.
nin() << std::endl;
117 field_out << f.
nvol() << std::endl;
118 field_out << f.
nex() << std::endl;
120 field_out.setf(std::ios_base::scientific, std::ios_base::floatfield);
121 field_out.precision(14);
123 for (
int j = 0, n = f.
size(); j < n; ++j) {
124 field_out << f.
cmp(j) << std::endl;
139 std::ifstream field_in(filename.c_str());
140 if (!field_in.is_open()) {
141 vout.
crucial(
"Failed to open the text file. %s\n", filename.c_str());
145 vout.
general(
"Reading Field from %s\n", filename.c_str());
147 int Nin = 0, Nvol = 0, Nex = 0;
152 f.
reset(Nin, Nvol, Nex);
155 for (
int j = 0, n = f.
ntot(); j < n; ++j) {
void set(const int jin, const int site, const int jex, double v)
void general(const char *format,...)
static Bridge::VerboseLevel Vlevel()
Container of Field-type object.
double cmp(const int jin, const int site, const int jex) const
void Ddag(Field &, const Field &)
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Standard Conjugate Gradient solver algorithm.
virtual void set_parameters(const Parameters ¶ms)=0
int CRSsolver(const string &solution, const string &matrix, const string &source, double &result)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
void write_text(const Field &f, const string &filename)
void crucial(const char *format,...)
void read_text(Field &f, const string &filename)
Base class for linear solver class family.
Base class of fermion operator family.
Fermion operator with CRS matrix format.
virtual void solve(Field &solution, const Field &source, int &Nconv, double &diff)=0