25 bool init = Solver::Factory::Register(
"BiCGStab", create_object);
40 #ifdef USE_PARAMETERS_FACTORY
55 const string str_vlevel = params.
get_string(
"verbose_level");
64 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
65 err += params.
fetch_double(
"convergence_criterion_squared", Stop_cond);
105 int& Nconv,
double& diff)
109 double bnorm2 = b.
norm2();
110 double snorm = 1.0 / bnorm2;
111 int bsize = b.
size();
134 bool is_converged =
false;
141 for (
int iter = 0; iter <
m_Niter; iter++) {
157 if (ith == 0)
vout.
detailed(
m_vl,
" iter0: %8d %22.15e\n", nth, diff2 * snorm);
160 Nconv2 = 2 * (iter + 1);
170 if (ith == 0)
vout.
detailed(
m_vl,
" iter1: %8d %22.15e\n", nth, rr * snorm);
207 if ((
s.
nin() != Nin) || (
s.
nvol() != Nvol) || (
s.
nex() != Nex)) {
262 double alpha = rho / aden;
269 double omega_d =
dot(
t,
t);
270 double omega_n =
dot(
t,
s);
271 double omega = omega_n / omega_d;
void detailed(const char *format,...)
static int get_num_threads()
returns available number of threads.
void Register_string(const string &, const string &)
void solve(Field &solution, const Field &source, int &Nconv, double &diff)
void set(const int jin, const int site, const int jex, double v)
double dot(const Field &y, const Field &x)
virtual const Field mult(const Field &)=0
multiplies fermion operator to a given field and returns the resultant field.
void general(const char *format,...)
void Register_int(const string &, const int)
Container of Field-type object.
void set_parameters(const Parameters ¶ms)
void copy(Field &y, const Field &x)
copy(y, x): y = x
Parameters_Solver_BiCGStab()
void solve_init(const Field &, double &)
static int get_thread_id()
returns thread id.
int square_non_zero(const double v)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
static void sync_barrier_all()
barrier among all the threads and nodes.
void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
void paranoiac(const char *format,...)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void crucial(const char *format,...)
static const std::string class_name
Base class for linear solver class family.
static bool Register(const std::string &realm, const creator_callback &cb)
void solve_step(double &)
int non_negative(const int v)
void Register_double(const string &, const double)
void reset_field(const Field &)
Base class of fermion operator family.
int fetch_double(const string &key, double &val) const
string get_string(const string &key) const
int fetch_int(const string &key, int &val) const
Bridge::VerboseLevel m_vl
static VerboseLevel set_verbose_level(const std::string &str)
static void assert_single_thread(const std::string &classname)
assert currently running on single thread.