Get random values from default RNG.
More...
#include <Random.h>
|
| static real | sample () |
| | Get a uniform random value in [0, 1].
|
| |
| template<std::size_t N, typename T = real> |
| static std::array< T, N > | sampleND () |
| | Similar to sample(), except the sample is N-dimensional.
|
| |
| static std::size_t | index (std::size_t lowerBound, std::size_t upperBound) |
| | Get a uniform random integer value in [lowerBound, upperBound).
|
| |
| static uint32 | bits32 () |
| |
| static uint64 | bits64 () |
| |
Get random values from default RNG.
◆ bits32()
| uint32 ph::math::Random::bits32 |
( |
| ) |
|
|
static |
- Returns
- 32 uniform random bits.
◆ bits64()
| uint64 ph::math::Random::bits64 |
( |
| ) |
|
|
static |
- Returns
- 64 uniform random bits.
◆ index()
| std::size_t ph::math::Random::index |
( |
std::size_t | lowerBound, |
|
|
std::size_t | upperBound ) |
|
inlinestatic |
Get a uniform random integer value in [lowerBound, upperBound).
- Note
- Thread-safe. Each thread gets a different sequence.
◆ sample()
| real ph::math::Random::sample |
( |
| ) |
|
|
static |
Get a uniform random value in [0, 1].
- Note
- Thread-safe. Each thread gets a different sequence.
◆ sampleND()
template<std::size_t N, typename T >
| std::array< T, N > ph::math::Random::sampleND |
( |
| ) |
|
|
inlinestatic |
Similar to sample(), except the sample is N-dimensional.
The documentation for this class was generated from the following files: