46 int get_int(
int low = 0,
int high = 1) const noexcept;
53 [[nodiscard]] std::vector<
int>
sample_int_n(
int low = 0,
int high = 1,
int n = 1) const;
60 [[nodiscard]] std::vector<
float>
sample_float_n(
float low = 0.0f,
float high = 1.0f,
int n = 1) const;
66 [[nodiscard]]
float get_float(
float low = 0.0f,
float high = 1.0f) const noexcept;
70 void seed(
unsigned long long seed = 0) const noexcept;
74 void seed(std::string_view sv) const noexcept;
80 int operator()(const
int low, const
int high) const noexcept
86 class randomizer_impl;
88 std::unique_ptr<randomizer_impl> m_impl;
void seed(unsigned long long seed=0) const noexcept
Seeds the random number generator with the given seed value.
int get_int(int low=0, int high=1) const noexcept
Generates a random integer within a specified range.
randomizer(randomizer &&other) noexcept
Move constructor.
std::vector< float > sample_float_n(float low=0.0f, float high=1.0f, int n=1) const
Samples n floats from a uniform distribution over [low, high).
randomizer & operator=(randomizer &&other) noexcept
Move assignment operator.
randomizer()
Default constructor.
std::vector< int > sample_int_n(int low=0, int high=1, int n=1) const
Samples n integers (with replacement) from a uniform distribution over [low, high].
randomizer & operator=(const randomizer &other)
Copy assignment operator.
float get_float(float low=0.0f, float high=1.0f) const noexcept
Generates a random float within a specified range.
randomizer(const randomizer &other)
Copy constructor.