My Project
|
Random number generator. More...
#include <GslRandGenerator.hh>
Public Member Functions | |
GslRandGenerator () | |
GslRandGenerator (unsigned long seed) | |
~GslRandGenerator () | |
unsigned long | PutMin () |
unsigned long | PutMax () |
unsigned long | PutRand () |
unsigned long | PutNextSeed () |
unsigned long | PutRand (UInt4 Max) |
Double | PutDouble () |
Random number generator.
This class generates random numbers. The type of the random numbers is "unsigned long", and The type of long and int is the same on current Linux systems.
Constructor. EPOC time, Unix time is used as a random seed in this method. Don't construct this class method in a second. If you want to construct this class method in the same second, use the other constructor.
GslRandGenerator::GslRandGenerator | ( | unsigned long | seed | ) |
Constructor. This method can receive random seed. The seed will be obtained from PutNextSeed() belonging had been constructed class objects.
Destructor
Double GslRandGenerator::PutDouble | ( | ) | [inline] |
Returns a random number in double type. The value of the return number will be 0.0-1.0, but it is generated by PutRand()/PutMax().
unsigned long GslRandGenerator::PutMax | ( | ) | [inline] |
Returns maximum number of the candidates returned by PutRand().
unsigned long GslRandGenerator::PutMin | ( | ) | [inline] |
Returns minimum number of the candidates returned by PutRand().
unsigned long GslRandGenerator::PutNextSeed | ( | ) | [inline] |
Returns a random number generated in this class. The return value will be used in the next constructor. See the manual of the constructor.
unsigned long GslRandGenerator::PutRand | ( | ) | [inline] |
Returns a random number generated in this class.
unsigned long GslRandGenerator::PutRand | ( | UInt4 | Max | ) |
Returns a rundom number generated in this class. The range of the return value is 0 to Max, and the maximum value is Max.