|
MythTV master
|
Typedefs | |
| using | MythRandomGenerator_32 = std::mt19937 |
| using | MythRandomGenerator_64 = std::mt19937_64 |
Functions | |
| uint32_t | MythRandom () |
| generate 32 random bits More... | |
| uint64_t | MythRandom64 () |
| generate 64 random bits More... | |
| uint32_t | MythRandom (uint32_t min, uint32_t max) |
| generate a uniformly distributed random uint32_t in the closed interval [min, max]. More... | |
| int | MythRandomInt (int min, int max) |
| generate a uniformly distributed random signed int in the closed interval [min, max]. More... | |
| bool | rand_bool (uint32_t chance=2) |
| return a random bool with P(true) = 1/chance More... | |
| using MythRandomStd::MythRandomGenerator_32 = typedef std::mt19937 |
Definition at line 14 of file mythrandom.h.
| using MythRandomStd::MythRandomGenerator_64 = typedef std::mt19937_64 |
Definition at line 15 of file mythrandom.h.
|
inline |
generate 32 random bits
Definition at line 20 of file mythrandom.h.
|
inline |
generate a uniformly distributed random uint32_t in the closed interval [min, max].
The behavior is undefined if
.
An alternate name would be MythRandomU32.
Definition at line 45 of file mythrandom.h.
|
inline |
generate 64 random bits
Definition at line 31 of file mythrandom.h.
|
inline |
generate a uniformly distributed random signed int in the closed interval [min, max].
The behavior is undefined if
.
Definition at line 58 of file mythrandom.h.
|
inline |
return a random bool with P(true) = 1/chance
An input less than 2 always returns true:
This is a Bernoulli distribution with
.
Definition at line 75 of file mythrandom.h.