25 RandnScalar::RandnScalar()
31 RandnScalar::RandnScalar(
int seed)
37 RandnScalar::~RandnScalar()
43 void RandnScalar::init()
46 int t=(int)time(
nullptr);
50 void RandnScalar::init(
int s)
53 executeBoxMuller =
true;
58 double RandnScalar::get(
double u,
double sigma)
65 return y[0] * sigma + u;
69 executeBoxMuller =
true;
70 return y[1] * sigma + u;
74 void RandnScalar::boxMuller()
84 w = x1 * x1 + x2 * x2;
87 w = sqrt( (-2.0 * log( w ) ) / w );