Random number generator singleton class.
More...
#include <random.hpp>
|
|
| RNG (const RNG &)=delete |
| |
|
RNG & | operator= (const RNG &)=delete |
| |
|
| RNG (RNG &&)=delete |
| |
|
RNG & | operator= (RNG &&)=delete |
| |
| void | setSeed (unsigned seed) |
| |
| template<std::integral T> |
| T | random_int (T min, T max) |
| |
| template<std::floating_point T> |
| T | random_float (T min, T max) |
| |
Random number generator singleton class.
◆ get()
Get the instance of the random number generator
- Returns
- instance of the random number generator
◆ random_float()
template<std::floating_point T>
| T sat::RNG::random_float |
( |
T |
min, |
|
|
T |
max |
|
) |
| |
|
inline |
Generates a random float value in [min, max)
- Template Parameters
-
| T | floating point type of value |
- Parameters
-
| min | lower bound |
| max | upper bound |
- Returns
- random value
◆ random_int()
template<std::integral T>
| T sat::RNG::random_int |
( |
T |
min, |
|
|
T |
max |
|
) |
| |
|
inline |
Generates a random integer value in [min, max]
- Template Parameters
-
- Parameters
-
| min | lower bound |
| max | upper bound |
- Returns
- random value
◆ setSeed()
| void sat::RNG::setSeed |
( |
unsigned |
seed | ) |
|
Sets the random seed
- Parameters
-
The documentation for this class was generated from the following files: