Definition at line 52 of file rngtest.cc.
References tfxx::cmdline::arg_no, tfxx::cmdline::arg_yes, tfxx::numeric::RNGgaussian::comment_gsl_rng_ranlux, tfxx::cmdline::Commandline::double_arg(), tfxx::cmdline::Commandline::int_arg(), Options::listtypes, tfxx::cmdline::Commandline::long_arg(), Options::mean, Options::nsamples, tfxx::cmdline::Commandline::optset(), report(), tfxx::numeric::RNGgaussian::rng_list_types(), RNGTEST_VERSION, Options::seed, Options::seedset, tfxx::numeric::RNGgaussian::set(), Options::std, tfxx::cmdline::Commandline::string_arg(), Options::type, and Options::verbose.
59 "usage: rngtest [-l] [-v] [-t type] [-seed v] [-mean v]\n" 60 " [-std v] [-n n] [run]\n" 61 " or: rngtest --help|-h" "\n" 62 " or: rngtest --xhelp" "\n" 68 "--xhelp print comments regarding GSL RNG implementation\n" 70 "run run the program\n" 71 "-l print list of random number generators and exit\n" 73 "-t type select random number generator of type \"type\"\n" 74 " use option -l for a list of available types\n" 75 " type \"default\" will make selection based on\n" 76 " environment variables\n" 77 "-seed v initialize RNG with seed value v\n" 78 "-mean v set mean value\n" 79 "-std v set standard deviation\n" 80 "-n n print n random numbers\n" 82 "In case of no type selected or type set to \"default\" type\n" 83 "and seed value can be specified through environment variables.\n" 86 "GSL_RNG_TYPE=ranlux GSL_RNG_SEED=125 rngtest -v run\n" 117 cerr << usage_text << endl;
125 if (cmdline.optset(0) || cmdline.optset(8))
127 cerr << usage_text << endl;
128 cerr << help_text << endl;
129 if (cmdline.optset(8))
140 opt.
type=cmdline.string_arg(3);
142 opt.
seed=cmdline.long_arg(4);
143 opt.
mean=cmdline.double_arg(5);
144 opt.
std=cmdline.double_arg(6);
156 cout <<
"Parameters specified on command line (maybe default):\n" 157 <<
" type: " << opt.
type <<
"\n" 158 <<
" mean: " << opt.
mean <<
"\n" 159 <<
" std: " << opt.
std <<
"\n" 163 cout <<
" seed: " << opt.
seed << endl;
167 cout <<
" no seed value specified" << endl;
176 cout <<
"\nRandom numbers:" << endl;
179 cout << i <<
" " << rng.value() << endl;
182 cout << endl <<
"set new seed" << endl;
186 cout <<
"\nRandom numbers:" << endl;
189 cout << i <<
" " << rng.value() << endl;
option requires an argument
static void rng_list_types(std::ostream &os)
print list of random number generators to stream.
void report(const tfxx::numeric::RNGgaussian &rng)
Namespace containing all components of module commandline. ,.
Evaluates commandline by calling long_getopt. ,You may instantiate a Commandline object by passing th...
Provide random numbers with Gaussian distribution.This class is an interface to the GSL random number...
static const char * comment_gsl_rng_ranlux
comment on GSL RNGs
struct to define options ,This struct is used to define a list of options. An example is: ...
void set(const unsigned long int &seed)
feed with seed value