Go to the documentation of this file.
26 template<
typename AFIELD>
30 template<
typename AFIELD>
45 err += params.
fetch_int(
"number_of_poles", Np);
46 err += params.
fetch_int(
"exponent_numerator", n_exp);
47 err += params.
fetch_int(
"exponent_denominator", d_exp);
50 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
51 err += params.
fetch_double(
"convergence_criterion_squared", Stop_cond);
54 vout.
crucial(m_vl,
"Error at %s: input parameter not found.\n",
59 set_parameters(Np, n_exp, d_exp,
real_t(x_min),
real_t(x_max),
65 template<
typename AFIELD>
68 params.
set_int(
"number_of_poles", m_Np);
69 params.
set_int(
"exponent_numerator", m_n_exp);
70 params.
set_int(
"exponent_denominator", m_d_exp);
71 params.
set_double(
"lower_bound",
double(m_x_min));
72 params.
set_double(
"upper_bound",
double(m_x_max));
73 params.
set_int(
"maximum_number_of_iteration", m_Niter);
74 params.
set_double(
"convergence_criterion_squared",
double(m_Stop_cond));
81 template<
typename AFIELD>
84 const int n_exp,
const int d_exp,
86 const int Niter,
const real_t Stop_cond)
96 vout.
general(m_vl,
" Stop_cond = %8.2e\n", Stop_cond);
108 vout.
crucial(m_vl,
"Error at %s: parameter range check failed.\n", class_name.c_str());
119 m_Stop_cond = Stop_cond;
128 template<
typename AFIELD>
131 m_fopr->set_config(U);
135 template<
typename AFIELD>
138 const int Nin = m_fopr->field_nin();
139 const int Nvol = m_fopr->field_nvol();
140 const int Nex = m_fopr->field_nex();
142 const int Nshift = m_Np;
144 const double x_min2 = m_x_min * m_x_min;
145 const double x_max2 = m_x_max * m_x_max;
151 for (
int i = 0; i < Nshift; ++i) {
152 m_xq[i].reset(Nin, Nvol, Nex);
156 m_fopr, m_Niter, m_Stop_cond);
158 std::vector<double> bl(m_Np), cl(m_Np);
163 double(x_min2),
double(x_max2));
169 for (
int i = 0; i < m_Np; i++) {
172 vout.
general(m_vl,
" bl[%d] = %18.14f cl[%d] = %18.14f\n",
173 i, m_bl[i], i, m_cl[i]);
179 template<
typename AFIELD>
184 assert(v.
nin() == b.
nin());
186 assert(v.
nex() == b.
nex());
188 vout.
general(m_vl,
"Shift solver in rational function\n");
191 vout.
detailed(m_vl,
"Number of shift values = %d\n", m_Np);
196 m_fopr->set_mode(
"DdagD");
197 m_solver->solve(m_xq, m_cl, b, Nconv, diff);
199 vout.
general(m_vl,
"diff(max) = %22.15e \n", diff);
203 for (
int i = 0; i < m_Np; i++) {
213 template<
typename AFIELD>
218 for (
int k = 0; k < m_Np; ++k) {
219 y += m_bl[k] / (x + m_cl[k]);
void set_string(const string &key, const string &value)
void mult(AFIELD &v, const AFIELD &f)
multiplies fermion operator to a given field.
void set_parameters(const Parameters ¶ms)
sets parameters by a Parameter object: to be implemented in a subclass.
void set_double(const string &key, const double value)
real_t func(const real_t x)
void detailed(const char *format,...)
void get_parameters(double &norm, std::vector< double > &res, std::vector< double > &pole)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void copy(Field &y, const Field &x)
copy(y, x): y = x
void set_parameters(const Parameters ¶ms)
void get_parameters(Parameters ¶ms) const
gets parameters by a Parameter object: to be implemented in a subclass.
int square_non_zero(const double v)
Fermion operator for rational approximation.
static VerboseLevel set_verbose_level(const std::string &str)
int non_zero(const double v)
void set_config(Field *U)
sets the gauge configuration.
void set_int(const string &key, const int value)
void scal(Field &x, const double a)
scal(x, a): x = a * x
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.
Multishift Conjugate Gradient solver.
Determionation of coefficients of rational approximation.
int fetch_int(const string &key, int &value) const
void general(const char *format,...)
static std::string get_verbose_level(const VerboseLevel vl)