#include <Random.h>
Before any random operations are performed, it is advisable to call the static init() method.
Static Public Methods | |
| double | uniform () |
| Get a double-precision number from a uniformly distributed source of pseudo-random numbers. | |
| double | uniform (double min, double max) |
| Get a double-precision number from a uniformly distributed source of pseudo-random numbers. | |
| double | uniform (double upperBound) |
| Get a double-precision number from a uniformly distributed source of pseudo-random numbers. | |
| long | uniform (long upperBound) |
| Get a pseudo-random, uniformly distributed integer. | |
| double | gaussian () |
| Get a double-precision pseudo-random number from a Gaussian distribution with zero mean and unit variance. | |
| double | gaussian (double mean, double std) |
| Get a double-precision pseudo-random number from a Gaussian distribution with the given mean and standard deviation. | |
| void | init () |
| Initialize the random number generator from system clock. | |
| void | init (long seed) |
| Initialize the random number generator with your favourite value. | |
| template<class T> void | shuffle (util::List< T > &lst) |
| Rearrange the elements in lst in a random way. | |
|
||||||||||||
|
Get a double-precision pseudo-random number from a Gaussian distribution with the given mean and standard deviation.
|
|
|
Get a double-precision pseudo-random number from a Gaussian distribution with zero mean and unit variance.
|
|
|
Initialize the random number generator from system clock. Note that successive inits within the same second have no effect. Note also that this method must be called before any random numbers are generated if you don't want a similar sequence each time the program is run. |
|
||||||||||
|
Rearrange the elements in lst in a random way.
|
|
|
Get a pseudo-random, uniformly distributed integer.
|
|
|
Get a double-precision number from a uniformly distributed source of pseudo-random numbers.
|
|
||||||||||||
|
Get a double-precision number from a uniformly distributed source of pseudo-random numbers.
|
|
|
Get a double-precision number from a uniformly distributed source of pseudo-random numbers.
|