39 const std::string
test_name =
"Rational.Inverse";
43 const std::string filename_input =
"test_Rational_Inverse.yaml";
44 const std::string filename_output =
"stdout";
46 class Parameters_Test_Rational :
public Parameters {
48 Parameters_Test_Rational()
50 Register_string(
"gauge_config_status",
"NULL");
51 Register_string(
"gauge_config_type_input",
"NULL");
52 Register_string(
"config_filename_input",
"NULL");
54 Register_string(
"verbose_level",
"NULL");
56 Register_double(
"expected_result", 0.0);
64 #ifdef USE_TESTMANAGER_AUTOREGISTER
66 #if defined(USE_GROUP_SU2)
85 int NinF = 2 * Nc * Nd;
100 const string str_gconf_status = params_test->
get_string(
"gauge_config_status");
101 const string str_gconf_read = params_test->
get_string(
"gauge_config_type_input");
102 const string readfile = params_test->
get_string(
"config_filename_input");
103 const string str_vlevel = params_test->
get_string(
"verbose_level");
105 const bool do_check = params_test->
is_set(
"expected_result");
106 const double expected_result = do_check ? params_test->
get_double(
"expected_result") : 0.0;
108 const string str_gmset_type = params_clover->
get_string(
"gamma_matrix_type");
109 const string str_source_type = params_source->
get_string(
"source_type");
114 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
115 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
116 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
117 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
118 vout.
general(vl,
" gmset_type = %s\n", str_gmset_type.c_str());
119 vout.
general(vl,
" source_type = %s\n", str_source_type.c_str());
127 vout.
crucial(vl,
"%s: Input parameters have not been set.\n", test_name.c_str());
136 if (str_gconf_status ==
"Continue") {
138 }
else if (str_gconf_status ==
"Cold_start") {
140 }
else if (str_gconf_status ==
"Hot_start") {
141 int i_seed_noise = 1234567;
145 vout.
crucial(vl,
"%s: unsupported gconf status \"%s\".\n", test_name.c_str(), str_gconf_status.c_str());
167 Field xq(NinF, Nvol, 1), b(NinF, Nvol, 1);
168 Field v(NinF, Nvol, 1), w(NinF, Nvol, 1);
179 int idx = icolor + Nc * ispin;
180 source->
set(b2, idx);
205 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
Random number generator base on M-series.
Fermion operator for rational approximation.
const std::string test_name
void detailed(const char *format,...)
void general(const char *format,...)
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
static Parameters * New(const std::string &realm)
void read_file(Field *U, const string &filename)
void set_random(RandomNumbers *rand)
Wilson-type fermion field.
static bool RegisterTest(const std::string &key, const Test_function func)
bool is_set(const string &) const
double get_double(const string &key) const
virtual void set_parameters(const Parameters &)=0
int non_NULL(const std::string v)
virtual void set(Field &, int)=0
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void crucial(const char *format,...)
void Register_Parameters(const string &, Parameters *const)
int verify(const double result, const double expected, double eps)
Test of rational approximation of fermion operators.
void set_parameters(const Parameters ¶ms)
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
virtual void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
static void read(const std::string ¶ms_file, Parameters *params)
GaugeConfig class for file I/O of gauge configuration.
string get_string(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
virtual void set_parameters(const Parameters &)=0
static VerboseLevel set_verbose_level(const std::string &str)