16 #ifdef USE_FACTORY_AUTOREGISTER
18 bool init = Solver_BiCGStab_Cmplx::register_factory();
27 const string str_vlevel = params.
get_string(
"verbose_level");
35 double Omega_tolerance;
38 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
39 err += params.
fetch_int(
"maximum_number_of_restart", Nrestart);
40 err += params.
fetch_double(
"convergence_criterion_squared", Stop_cond);
41 err += params.
fetch_bool(
"use_initial_guess", use_init_guess);
42 err += params.
fetch_double(
"Omega_tolerance", Omega_tolerance);
57 const double Stop_cond)
87 const double Stop_cond,
const bool use_init_guess)
96 vout.
general(
m_vl,
" use_init_guess = %s\n", use_init_guess ?
"true" :
"false");
135 int& Nconv,
double& diff)
137 const double bnorm2 = b.
norm2();
138 const int bsize = b.
size();
144 bool is_converged =
false;
162 Nconv2 += Nconv_unit;
167 for (
int i_restart = 0; i_restart <
m_Nrestart; i_restart++) {
168 for (
int iter = 0; iter <
m_Niter; iter++) {
172 Nconv2 += 2 * Nconv_unit;
204 vout.
crucial(
m_vl,
" iter(final): %8d %22.15e\n", Nconv2, diff2 / bnorm2);
214 diff = sqrt(diff2 / bnorm2);
227 const int Nin = b.
nin();
228 const int Nvol = b.
nvol();
229 const int Nex = b.
nex();
287 const dcomplex alpha = rho / aden;
295 const double omega_denom =
dot(
m_t,
m_t);
297 dcomplex omega = omega_numer / omega_denom;
302 const double abs_rho = abs(omega_numer) / sqrt(omega_denom * s_norm2);
333 const int Nin =
m_x.
nin();
335 const int Nex =
m_x.
nex();
344 const double gflop_axpy = (Nin * Nex * 2) * ((Nvol * NPE) / 1.0e+9);
345 const double gflop_dotc = (Nin * Nex * 4) * ((Nvol * NPE) / 1.0e+9);
346 const double gflop_norm = (Nin * Nex * 2) * ((Nvol * NPE) / 1.0e+9);
348 const double gflop_init = gflop_fopr + gflop_axpy + gflop_norm;
349 const double gflop_step = 2 * gflop_fopr + 3 * gflop_dotc + 6 * gflop_axpy + 2 * gflop_norm;
350 const double gflop_true_residual = gflop_fopr + gflop_axpy + gflop_norm;
353 const double gflop = gflop_norm + gflop_init + gflop_step * N_iter + gflop_true_residual * (
m_Nrestart_count + 1)
void reset_field(const Field &)
int fetch_bool(const string &key, bool &value) const
void detailed(const char *format,...)
static double epsilon_criterion()
static const std::string class_name
void set(const int jin, const int site, const int jex, double v)
double dot(const Field &y, const Field &x)
void general(const char *format,...)
void solve(Field &solution, const Field &source, int &Nconv, double &diff)
Container of Field-type object.
int fetch_double(const string &key, double &value) const
void set_parameters(const Parameters ¶ms)
void copy(Field &y, const Field &x)
copy(y, x): y = x
int square_non_zero(const double v)
dcomplex dotc(const Field &y, const Field &x)
void solve_step(double &)
int fetch_int(const string &key, int &value) const
virtual double flop_count()
returns the flop in giga unit
void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
void solve_init(const Field &, double &)
void paranoiac(const char *format,...)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void crucial(const char *format,...)
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
void set_parameters_BiCGStab_series(const double Omega_tolerance)
int non_negative(const int v)
static void assert_single_thread(const std::string &class_name)
assert currently running on single thread.
string get_string(const string &key) const
Bridge::VerboseLevel m_vl
static VerboseLevel set_verbose_level(const std::string &str)