Go to the documentation of this file.
15 template<
typename AFIELD>
19 template<
typename AFIELD>
25 vout.
general(m_vl,
"%s: construction\n", class_name.c_str());
28 m_NinF = m_fopr->field_nin();
29 m_Nvol = m_fopr->field_nvol();
30 m_NexF = m_fopr->field_nex();
32 vout.
general(m_vl,
"kernel: %s\n", m_fopr->class_name.c_str());
34 set_parameters(params);
37 for (
int k = 0; k < 3; ++k) {
38 m_dj[k].reset(m_NinF, m_Nvol, m_NexF);
48 template<
typename AFIELD>
55 vout.
general(m_vl,
"%s: construction (obsoletre)\n",
59 m_NinF = m_fopr->field_nin();
60 m_Nvol = m_fopr->field_nvol();
61 m_NexF = m_fopr->field_nex();
64 for (
int k = 0; k < 3; ++k) {
65 m_dj[k].reset(m_NinF, m_Nvol, m_NexF);
68 vout.
general(m_vl,
"kernel: %s\n", m_fopr->class_name.c_str());
77 template<
typename AFIELD>
85 template<
typename AFIELD>
95 double v_threshold, v_max;
98 err += params.
fetch_int(
"degree_of_polynomial", Np);
99 err += params.
fetch_double(
"threshold_value", v_threshold);
103 vout.
crucial(m_vl,
"Error at %s: input parameter not found.\n",
113 template<
typename AFIELD>
124 vout.
crucial(m_vl,
"Error at %s: parameter range check failed.\n",
137 real_t b_max = Vmax / Vthrs;
138 real_t r = 2.0 / (b_max * b_max - 1.0);
139 real_t s = Vthrs / sqrt(0.5 * r);
141 m_Fcb1 = 2.0 / (s * s);
146 vout.
general(m_vl,
"%s: input parameters\n", class_name.c_str());
156 template<
typename AFIELD>
159 params.
set_int(
"degree_of_polynomial", m_Npcb);
160 params.
set_double(
"threshold_value", m_Vthrs);
168 template<
typename AFIELD>
171 m_fopr->set_config(U);
176 template<
typename AFIELD>
180 m_fopr->set_mode(mode);
185 template<
typename AFIELD>
193 template<
typename AFIELD>
207 for (
int j = m_Npcb; j >= 2; --j) {
208 m_fopr->mult(m_dj[jn], m_dj[jp1]);
209 scal(m_dj[jn], m_Fcb1);
210 axpy(m_dj[jn], m_Fcb2, m_dj[jp1]);
220 m_fopr->mult(v, m_dj[jp1]);
222 axpy(v, m_Fcb2, m_dj[jp1]);
228 template<
typename AFIELD>
231 std::vector<real_t> dj(3);
240 for (
int j = m_Npcb; j >= 2; --j) {
241 dj[jn] = x * dj[jp1];
243 dj[jn] += m_Fcb2 * dj[jp1];
246 dj[jn] -= 1.0 * dj[jp2];
255 v += m_Fcb2 * dj[jp1];
261 template<
typename AFIELD>
271 template<
typename AFIELD>
void set_config(Field *U)
setting gauge configuration.
double flop_count()
returns the number of floating point operations.
void set_string(const string &key, const string &value)
void mult(AFIELD &v, const AFIELD &w)
multiplies fermion operator to a given field.
void set_parameters(const Parameters ¶ms)
setting parameters with a Parameter object.
void set_double(const string &key, const double value)
bool check_size(const int nin, const int nvol, const int nex) const
checking size parameters. [23 May 2016 H.Matsufuru]
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
int non_negative(const int v)
void copy(Field &y, const Field &x)
copy(y, x): y = x
void tidyup()
final cleanup.
void init()
initial setup (obsolete).
void get_parameters(Parameters ¶ms) const
gets parameters by a Parameter object: to be implemented in a subclass.
int mult(const std::string &)
std::string get_mode() const
returns the current mult mode.
static Bridge::VerboseLevel Vlevel()
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
static VerboseLevel set_verbose_level(const std::string &str)
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.
static int get_thread_id()
returns thread id.
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)