Go to the documentation of this file.
16 #ifdef USE_FACTORY_AUTOREGISTER
18 bool init = Solver_BiCGStab_Cmplx::register_factory();
36 double Omega_tolerance;
39 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
40 err += params.
fetch_int(
"maximum_number_of_restart", Nrestart);
41 err += params.
fetch_double(
"convergence_criterion_squared", Stop_cond);
42 err += params.
fetch_bool(
"use_initial_guess", use_init_guess);
43 err += params.
fetch_double(
"Omega_tolerance", Omega_tolerance);
53 set_parameters(Niter, Nrestart, Stop_cond, use_init_guess, Omega_tolerance);
72 const double Stop_cond)
102 const double Stop_cond,
const bool use_init_guess)
111 vout.
general(
m_vl,
" use_init_guess = %s\n", use_init_guess ?
"true" :
"false");
151 const double Stop_cond,
152 const bool use_init_guess,
153 const double Omega_tolerance)
162 vout.
general(
m_vl,
" use_init_guess = %s\n", use_init_guess ?
"true" :
"false");
190 int& Nconv,
double& diff)
192 const double bnorm2 = b.
norm2();
193 const int bsize = b.
size();
199 bool is_converged =
false;
217 Nconv2 += Nconv_unit;
222 for (
int i_restart = 0; i_restart <
m_Nrestart; i_restart++) {
223 for (
int iter = 0; iter <
m_Niter; iter++) {
227 Nconv2 += 2 * Nconv_unit;
259 vout.
crucial(
m_vl,
" iter(final): %8d %22.15e\n", Nconv2, diff2 / bnorm2);
269 diff = sqrt(diff2 / bnorm2);
282 const int Nin = b.
nin();
283 const int Nvol = b.
nvol();
284 const int Nex = b.
nex();
342 const dcomplex alpha = rho / aden;
350 const double omega_denom =
dot(
m_t,
m_t);
352 dcomplex omega = omega_numer / omega_denom;
357 const double abs_rho = abs(omega_numer) / sqrt(omega_denom * s_norm2);
388 const int Nin =
m_x.
nin();
390 const int Nex =
m_x.
nex();
399 const double gflop_axpy = (Nin * Nex * 2) * ((Nvol * NPE) / 1.0e+9);
400 const double gflop_dotc = (Nin * Nex * 4) * ((Nvol * NPE) / 1.0e+9);
401 const double gflop_norm = (Nin * Nex * 2) * ((Nvol * NPE) / 1.0e+9);
403 const double gflop_init = gflop_fopr + gflop_axpy + gflop_norm;
404 const double gflop_step = 2 * gflop_fopr + 3 * gflop_dotc + 6 * gflop_axpy + 2 * gflop_norm;
405 const double gflop_true_residual = gflop_fopr + gflop_axpy + gflop_norm;
408 const double gflop = gflop_norm + gflop_init + gflop_step * N_iter + gflop_true_residual * (
m_Nrestart_count + 1)
void set_bool(const string &key, const bool value)
static const std::string class_name
void reset_field(const Field &)
void set_string(const string &key, const string &value)
void set(const int jin, const int site, const int jex, double v)
virtual void mult(AFIELD &, const AFIELD &)
multiplies fermion operator to a given field.
void set_double(const string &key, const double value)
void detailed(const char *format,...)
void get_parameters(Parameters ¶ms) const
void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
void set_parameters(const Parameters ¶ms)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
double dot(const Field &y, const Field &x)
void solve(Field &solution, const Field &source, int &Nconv, double &diff)
int non_negative(const int v)
int fetch_bool(const string &key, bool &value) const
void copy(Field &y, const Field &x)
copy(y, x): y = x
void paranoiac(const char *format,...)
void solve_step(double &)
void solve_init(const Field &, double &)
virtual double flop_count()
returns the number of floating point operations.
int square_non_zero(const double v)
DEPRECATED void set_parameters_BiCGStab_series(const double Omega_tolerance)
dcomplex dotc(const Field &y, const Field &x)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
static VerboseLevel set_verbose_level(const std::string &str)
void set_int(const string &key, const int value)
int fetch_string(const string &key, string &value) const
int fetch_double(const string &key, double &value) const
void crucial(const char *format,...)
Container of Field-type object.
Bridge::VerboseLevel m_vl
int fetch_int(const string &key, int &value) const
void general(const char *format,...)
static void assert_single_thread(const std::string &class_name)
assert currently running on single thread.
static std::string get_verbose_level(const VerboseLevel vl)
static double epsilon_criterion()