class
#include <esp/core/Random.h>
Random
Public types
-
using ptr = std::
shared_ptr<Random> -
using uptr = std::
unique_ptr<Random> -
using cptr = std::
shared_ptr<const Random> -
using ucptr = std::
unique_ptr<const Random>
Public static functions
-
template<typename... Targs>static auto create(Targs && ... args) -> ptr
-
template<typename... Targs>static auto create_unique(Targs && ... args) -> uptr
Constructors, destructors, conversion operators
-
Random(unsigned int seed = std::
random_device()()) explicit
Public functions
-
void seed(uint32_
t newSeed) - Seed the random generator state with the given number.
- auto uniform_int() -> int
-
auto uniform_uint() -> uint32_
t - auto uniform_float_01() -> float
- Return randomly sampled float distributed uniformly in [0, 1)
- auto normal_float_01() -> float
- Return randomly sampled float distributed normally (mean=0, std=1)
- auto uniform_float(float a, float b) -> float
- Return randomly sampled float distributed uniformly in [a, b)
- auto uniform_int(int a, int b) -> int
- Return randomly sampled int distributed uniformly in [a, b)
Protected variables
Function documentation
int esp:: core:: Random:: uniform_int()
Return randomly sampled int distributed uniformly in [0, std::numeric_limits<int>::max()]
uint32_ t esp:: core:: Random:: uniform_uint()
Return randomly sampled uint32_t distributed uniformly in [0, std::numeric_limits<uint32_t>::max()]