OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
The CLASSIC random generator. More...
#include <ClassicRandom.h>
Public Member Functions | |
Random () | |
Constructor with default seed. More... | |
Random (int seed) | |
Constructor with given seed. More... | |
~Random () | |
void | reseed (int seed=123456789) |
Set a new seed. More... | |
double | uniform () |
Uniform distribution. More... | |
void | gauss (double &gr1, double &gr2) |
Gaussian distribution. More... | |
int | integer () |
Uniform distribution. More... | |
void | init55 (int seed) |
Initialise random number generator. More... | |
Private Member Functions | |
void | irngen () |
Private Attributes | |
int | irn [nr] |
int | next |
The CLASSIC random generator.
Definition at line 36 of file ClassicRandom.h.
Random::Random | ( | ) |
Constructor with default seed.
Definition at line 28 of file ClassicRandom.cpp.
References init55().
Random::Random | ( | int | seed | ) |
Constructor with given seed.
Definition at line 37 of file ClassicRandom.cpp.
References init55(), and Options::seed.
Random::~Random | ( | ) |
Definition at line 43 of file ClassicRandom.cpp.
void Random::gauss | ( | double & | gr1, |
double & | gr2 | ||
) |
Gaussian distribution.
Definition at line 64 of file ClassicRandom.cpp.
References log(), sqrt(), and uniform().
Referenced by Expressions::gauss(), and Expressions::Tgauss().
void Random::init55 | ( | int | seed | ) |
Initialise random number generator.
Definition at line 91 of file ClassicRandom.cpp.
References next, and Options::seed.
Referenced by Option::execute(), Random(), and reseed().
int Random::integer | ( | ) |
|
private |
void Random::reseed | ( | int | seed = 123456789 | ) |
Set a new seed.
Definition at line 48 of file ClassicRandom.cpp.
References init55(), and Options::seed.
double Random::uniform | ( | ) |
Uniform distribution.
Definition at line 54 of file ClassicRandom.cpp.
Referenced by gauss(), and Expressions::ranf().
|
private |
Definition at line 75 of file ClassicRandom.h.
|
private |
Definition at line 78 of file ClassicRandom.h.