OSFEG-C++  1.4.6
OpenSF Error Generation Library
Random Class Reference

Random numbers engine with additional distributions. More...

#include <Random.h>

Public Member Functions

 Random (int32_t seed)
 constructor to set the seed
 
 Random ()
 constructor to autogenerate a seed
 
 Random (int32_t seed, bool f)
 constructor to set the seed and the modified state
 
 Random (const Random &r)=default
 copy constructor (copies current state)
 
Randomoperator= (const Random &r)=default
 overloaded assignment (replaces state)
 
int32_t getSeed ()
 Return the current seed value.
 
Utility functions
void reset (int32_t seed)
 reset the seed explicitly
 
void reset ()
 reset seed from current process id
 
Continuous Distributions
double beta (double v, double w, double xMin=0., double xMax=1.)
 Beta (v > 0. and w > 0.)
 
double gamma (double a, double b, double c)
 
double exponential (double a=0., double c=1.)
 
double normal (double mu=0., double sigma=1.)
 Normal (Gaussian)
 
double uniform (double xMin=0., double xMax=1.)
 Uniform on [xMin,xMax)
 
Discrete Distributions
int poisson (double mu)
 Poisson.
 
int uniformDiscrete (int i, int j)
 

Friends

bool operator== (const Random &a, const Random &b)
 

Compare internal state of generators


 
bool operator!= (const Random &a, const Random &b)
 

Compare internal state of generators


 

Detailed Description

Random numbers engine with additional distributions.

See also
Ref: Richard Saucier, "Computer Generation of Statistical Distributions," ARL-TR-2168, US Army Research Laboratory, Aberdeen Proving Ground, MD, 21005-5068, March 2000.
Ref: Tausworthe, Robert C., "Random Numbers Generated by Linear Recurrence Modulo Two," Mathematics of Computation, vol. 19, pp. 201-209, 1965.

Member Function Documentation

◆ exponential()

double Random::exponential ( double  a = 0.,
double  c = 1. 
)

Exponential location a, shape c

◆ gamma()

double Random::gamma ( double  a,
double  b,
double  c 
)

Gamma location a, scale b, shape c

◆ uniformDiscrete()

int Random::uniformDiscrete ( int  i,
int  j 
)

Uniform Discrete inclusive i to j


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