29 namespace Test_RandomNumbers_Mseries {
30 const std::string
test_name =
"RandomNumbers.Mseries.GaussianField";
34 const std::string filename_input =
"test_RandomNumbers_Mseries_GaussianField.yaml";
40 #ifdef USE_TESTMANAGER_AUTOREGISTER
58 int iseed = params_test.
get_int(
"int_seed");
59 const string str_vlevel = params_test.
get_string(
"verbose_level");
61 const bool do_check = params_test.
is_set(
"expected_result");
62 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
68 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
83 Field v(Nin, Nvol, Nex);
91 for (
int i = 0; i < size; ++i) {
102 av = av_all / global_size;
103 vr = vr_all / global_size - av * av;
107 vout.
general(vl,
"Gaussian distribution (Field):\n");
108 vout.
general(vl,
" number of samples = %10d\n", size);
111 vout.
general(vl,
" variance(expect) = %10.8f\n", 1.0 / sqrt(2.0));
121 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
Random number generator base on M-series.
void detailed(const char *format,...)
void general(const char *format,...)
Container of Field-type object.
double cmp(const int jin, const int site, const int jex) const
int get_int(const string &key) const
virtual void gauss_lex_global(Field &)
gaussian random number defined on global lattice.
Parameters lookup(const string &key) const
static bool RegisterTest(const std::string &key, const Test_function func)
double get_double(const string &key) const
bool is_set(const string &key) const
const std::string test_name
static void read(const std::string ¶ms_file, Parameters ¶ms)
int verify(const double result, const double expected, double eps)
static int reduce_sum(int count, double *recv_buf, double *send_buf, int pattern=0)
make a global sum of an array of double over the communicator. pattern specifies the dimensions to be...
string get_string(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
static VerboseLevel set_verbose_level(const std::string &str)