Go to the documentation of this file.
30 const std::string
test_name =
"RandomNumbers.Mseries.Gaussian";
34 const std::string filename_input =
"test_RandomNumbers_Mseries_Gaussian.yaml";
40 #ifdef USE_TESTMANAGER_AUTOREGISTER
58 const int iseed = params_test.
get_int(
"int_seed");
59 const int Nrand = params_test.
get_int(
"number_of_samples");
60 const string str_vlevel = params_test.
get_string(
"verbose_level");
62 const bool do_check = params_test.
is_set(
"expected_result");
63 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
86 for (
int i = 0; i < Nrand; ++i) {
87 rand.
gauss(rand1, rand2);
89 vr += rand1 * rand1 + rand2 * rand2;
92 av = av / (2.0 * Nrand);
93 vr = vr / (2.0 * Nrand) - av * av;
101 vout.
general(
vl,
" variance(expect) = %10.8f\n", 1.0 / sqrt(2.0));
103 const double result = vr;
int verify(const double result, const double expected, double eps)
int get_int(const string &key) const
void detailed(const char *format,...)
Random number generator base on M-series.
static void read(const std::string ¶ms_file, Parameters ¶ms)
double get_double(const string &key) const
static VerboseLevel set_verbose_level(const std::string &str)
bool is_set(const string &key) const
void gauss(double &rand1, double &rand2)
string get_string(const string &key) const
const std::string test_name
Test of random number generator.
void general(const char *format,...)
Parameters lookup(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
static bool RegisterTest(const std::string &key, const Test_function func)