22 RandnScalar::RandnScalar()
28 RandnScalar::RandnScalar(
int seed)
34 RandnScalar::~RandnScalar()
40 void RandnScalar::init()
43 int t=(int)time(
nullptr);
47 void RandnScalar::init(
int s)
50 executeBoxMuller =
true;
55 double RandnScalar::get(
double u,
double sigma)
62 return y[0] * sigma + u;
66 executeBoxMuller =
true;
67 return y[1] * sigma + u;
71 void RandnScalar::boxMuller()
81 w = x1 * x1 + x2 * x2;
84 w = sqrt( (-2.0 * log( w ) ) / w );
RandScalar * implementation(void *t)
contains the definition of a Vector type
A random number generator, uniform in the range 0-1.
void init()
Initialize the random generator using current time (time(0)).
double get()
Generate a random number from a uniform distribution.