![]() |
KSquare Utilities
|
Represents one single random number generator. More...
#include <RandomNumGenerator.h>
Public Member Functions | |
| RandomNumGenerator () | |
| RandomNumGenerator (long _seed) | |
| ~RandomNumGenerator () | |
| long | Next () |
Represents one single random number generator.
Rather than using the two global functions "lrand48" and "srand48" you can create an instance of this class that will provide the random sequence. The advantage is that you can control who has access to this sequence. That is you do not need to worry that some other code that you are calling is not also getting numbers from this sequence. This will allow you to guarantee the same sequence of numbers for the same seed.
Definition at line 20 of file RandomNumGenerator.h.
| RandomNumGenerator::RandomNumGenerator | ( | ) |
Definition at line 25 of file RandomNumGenerator.cpp.
| RandomNumGenerator::RandomNumGenerator | ( | long | _seed | ) |
Definition at line 35 of file RandomNumGenerator.cpp.
| RandomNumGenerator::~RandomNumGenerator | ( | ) |
Definition at line 45 of file RandomNumGenerator.cpp.
| long RandomNumGenerator::Next | ( | ) |
Definition at line 63 of file RandomNumGenerator.cpp.