A random number generator.
More...
#include <random_number_generator.h>
|
| RandomState () |
| Create and initialize random number generator with the current system time. More...
|
|
| RandomState (unsigned long seed) |
| Create and initialize random number generator with a seed. More...
|
|
double | uniform_real (double low, double high) |
| Provide a double random number from a uniform distribution between [low, high). More...
|
|
long | uniform_int (long low, long high) |
| Provide a long random number from a uniform distribution between [low, high). More...
|
|
|
static const long | MAX_INT = std::numeric_limits<long>::max() |
| Upper bound for long random numbers [..., high). More...
|
|
A random number generator.
◆ RandomState() [1/2]
koho::RandomState::RandomState |
( |
| ) |
|
Create and initialize random number generator with the current system time.
◆ RandomState() [2/2]
koho::RandomState::RandomState |
( |
unsigned long |
seed | ) |
|
Create and initialize random number generator with a seed.
- Parameters
-
◆ uniform_int()
long koho::RandomState::uniform_int |
( |
long |
low, |
|
|
long |
high |
|
) |
| |
Provide a long random number from a uniform distribution between [low, high).
- Parameters
-
[in] | low | included lower bound for random number. |
[in] | high | excluded upper bound for random number. |
- Returns
- random number.
◆ uniform_real()
double koho::RandomState::uniform_real |
( |
double |
low, |
|
|
double |
high |
|
) |
| |
Provide a double random number from a uniform distribution between [low, high).
- Parameters
-
[in] | low | included lower bound for random number. |
[in] | high | excluded upper bound for random number. |
- Returns
- random number.
◆ eng
std::mt19937 koho::RandomState::eng |
|
protected |
◆ MAX_INT
const long koho::RandomState::MAX_INT = std::numeric_limits<long>::max() |
|
static |
Upper bound for long random numbers [..., high).
The documentation for this class was generated from the following files: