TF++, Miscellaneous classes and modules in C++:
tfxx::numeric::RNGgaussian Class Reference

Provide random numbers with Gaussian distribution.This class is an interface to the GSL random number generator. More...

#include <rng.h>

Classes

class  UTException
 exception class for RNG indicating request for unkown type More...
 

Public Member Functions

 RNGgaussian (const double &std=1., const double &mean=0., const char *type="default")
 initialize random number generator More...
 
 ~RNGgaussian ()
 
double operator() () const
 returns a random number More...
 
double value () const
 returns a random number More...
 
void set (const unsigned long int &seed)
 feed with seed value More...
 
void set ()
 use time as seed value More...
 
std::string type () const
 return type of random number generator More...
 
unsigned long int seed () const
 return last seed value More...
 
double std () const
 return standard deviation More...
 
double mean () const
 return mean More...
 

Static Public Member Functions

static void rng_list_types (std::ostream &os)
 print list of random number generators to stream. More...
 

Static Public Attributes

static const char * comment_gsl_rng_ranlux
 comment on GSL RNGs More...
 

Private Attributes

double Mstd
 store standard deviation and mean value More...
 
double Mmean
 
gsl_rng * MR
 pointer to RNG More...
 
unsigned long int Mseed
 memorize last seed value More...
 

Detailed Description

Provide random numbers with Gaussian distribution.

This class is an interface to the GSL random number generator.

See also
https://www.gnu.org/software/gsl/doc/html/rng.html
Note
This class specifically returns values based on a normal distribution. If for some reason a second class shall be provided to return values based on a uniform distribution, only the value() member function will be different. It then would be appropriate to define an abstract base class from which RNGgaussion and RNGuniform are derived.

Definition at line 78 of file rng.h.


The documentation for this class was generated from the following files: