25 bool init = Solver::Factory::Register(
"BiCGStab_Cmplx", create_object);
40 #ifdef USE_PARAMETERS_FACTORY
49 { append_entry(*
this); }
57 const string str_vlevel = params.
get_string(
"verbose_level");
66 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
67 err += params.
fetch_double(
"convergence_criterion_squared", Stop_cond);
81 const double Stop_cond)
108 int& Nconv,
double& diff)
112 double bnorm2 = b.
norm2();
113 double snorm = 1.0 / bnorm2;
114 int bsize = b.
size();
138 bool is_converged =
false;
145 for (
int iter = 0; iter <
m_Niter; iter++) {
161 if (ith == 0)
vout.
detailed(
m_vl,
" iter0: %8d %22.15e\n", nth, diff2 * snorm);
164 Nconv2 = 2 * (iter + 1);
174 if (ith == 0)
vout.
detailed(
m_vl,
" iter1: %8d %22.15e\n", nth, rr * snorm);
211 if ((
s.
nin() != Nin) || (
s.
nvol() != Nvol) || (
s.
nex() != Nex)) {
267 dcomplex alpha = rho / aden;
274 double omega_d =
dot(
t,
t);
275 dcomplex omega_n =
dotc(
t,
s);
276 dcomplex omega = omega_n / omega_d;
void reset_field(const Field &)
void detailed(const char *format,...)
static int get_num_threads()
returns available number of threads.
void Register_string(const string &, const string &)
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)
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)
void solve(Field &solution, const Field &source, int &Nconv, double &diff)
Container of Field-type object.
void set_parameters(const Parameters ¶ms)
void copy(Field &y, const Field &x)
copy(y, x): y = x
static int get_thread_id()
returns thread id.
int square_non_zero(const double v)
dcomplex dotc(const Field &y, const Field &x)
void solve_step(double &)
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 solve_init(const Field &, double &)
void paranoiac(const char *format,...)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
BiCGStab algorithm with complex variables.
void crucial(const char *format,...)
Base class for linear solver class family.
static bool Register(const std::string &realm, const creator_callback &cb)
int non_negative(const int v)
void Register_double(const string &, const double)
Base class of fermion operator family.
int fetch_double(const string &key, double &val) const
string get_string(const string &key) const
Parameters_Solver_BiCGStab_Cmplx()
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.