36 namespace Test_Rational {
37 const std::string
test_name =
"Rational.Inverse";
41 const std::string filename_input =
"test_Rational_Inverse.yaml";
42 const std::string filename_output =
"stdout";
44 class Parameters_Test_Rational :
public Parameters {
46 Parameters_Test_Rational()
48 Register_string(
"gauge_config_status",
"NULL");
49 Register_string(
"gauge_config_type_input",
"NULL");
50 Register_string(
"config_filename_input",
"NULL");
52 Register_string(
"verbose_level",
"NULL");
54 Register_double(
"expected_result", 0.0);
62 #ifdef USE_TESTMANAGER_AUTOREGISTER
64 #if defined(USE_GROUP_SU2)
83 int NinF = 2 * Nc * Nd;
85 Parameters *params_test =
new Parameters_Test_Rational;
97 params_manager.
read_params(filename_input, params_all);
99 const string str_gconf_status = params_test->
get_string(
"gauge_config_status");
100 const string str_gconf_read = params_test->
get_string(
"gauge_config_type_input");
101 const string readfile = params_test->
get_string(
"config_filename_input");
102 const string str_vlevel = params_test->
get_string(
"verbose_level");
104 const bool do_check = params_test->
is_set(
"expected_result");
105 const double expected_result = do_check ? params_test->
get_double(
"expected_result") : 0.0;
107 const string str_gmset_type = params_clover->
get_string(
"gamma_matrix_type");
108 const string str_source_type = params_source->
get_string(
"source_type");
113 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
114 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
115 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
116 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
117 vout.
general(vl,
" gmset_type = %s\n", str_gmset_type.c_str());
118 vout.
general(vl,
" source_type = %s\n", str_source_type.c_str());
135 if (str_gconf_status ==
"Continue") {
137 }
else if (str_gconf_status ==
"Cold_start") {
139 }
else if (str_gconf_status ==
"Hot_start") {
143 vout.
crucial(vl,
"%s: unsupported gconf status \"%s\".\n",
test_name.c_str(), str_gconf_status.c_str());
156 Source *source = Source::New(str_source_type);
165 Field xq(NinF, Nvol, 1), b(NinF, Nvol, 1);
166 Field v(NinF, Nvol, 1), w(NinF, Nvol, 1);
177 int idx = icolor + Nc * ispin;
178 source->
set(b2, idx);
202 delete params_clover;
203 delete params_rational;
204 delete params_source;
220 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 read_params(const std::string ¶ms_file, Parameters *params)
read parameters from file.
void detailed(const char *format,...)
void general(const char *format,...)
const Field mult(const Field &f)
multiplies fermion operator to a given field and returns the resultant field.
Container of Field-type object.
const Field mult(const Field &f)
multiplies fermion operator to a given field and returns the resultant field.
static Parameters * New(const std::string &realm)
void set_random(RandomNumbers *rand)
Wilson-type fermion field.
static bool RegisterTest(const std::string &key, const Test_function func)
void set_config(Field *U)
setting pointer to the gauge configuration.
bool is_set(const string &) const
double get_double(const string &key) const
int non_NULL(const std::string v)
virtual void set(Field &, int)=0
void crucial(const char *format,...)
void Register_Parameters(const string &, Parameters *const)
void set_parameters(const Parameters ¶ms)
Parameter manager with YAML parser.
GaugeConfig class for file I/O of gauge configuration.
Base class of fermion operator family.
int verify(const double expected, const double result)
void read_file(Field *u, const string &filename)
Base class of sources for a linear solver.
string get_string(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
virtual void set_parameters(const Parameters &)=0
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_parameters(const Parameters ¶ms)