random::random_engine¶
| Type | Class |
| Namespace | conjure::core::random |
| Include File Path | engine/include/conjure/core/random.h |
| Source File Path | engine/src/core/time/random.cpp |
| API ↗ | Time, events and random |
Syntax¶
Constructors¶
| Access | Signature | Description |
|---|---|---|
| public | random_engine(); | |
| public | explicit random_engine(
u64 seedValue); | |
| public | random_engine(
const random_engine &) = default; | |
| public | random_engine(
random_engine &&) noexcept = default; |
Destructors¶
| Access | Signature | Description |
|---|---|---|
| public | ~random_engine(); |
Variables¶
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mEngine | engine | engine(DEFAULT_ | |
| private | mSeed | u64 | DEFAULT_SEED |
Functions¶
Public¶
current_seed¶
current_seed¶[[nodiscard]] u64 current_seed() const noexcept;The seed the current sequence started from.
discard¶
discard¶void discard(
u64 count) noexcept;Advances the sequence by the given number of draws without producing values.
max¶
max¶[[nodiscard]] static constexpr result_type max() noexcept;Largest value operator() can return, as required by std::uniform_random_bit_generator.
min¶
min¶[[nodiscard]] static constexpr result_type min() noexcept;Smallest value operator() can return, as required by std::uniform_random_bit_generator.
raw¶
raw¶[[nodiscard]] engine &raw() noexcept;The wrapped engine, for callers that need the standard interface directly.
uniform¶
uniform¶template <typename T> [[nodiscard]] T uniform(
T minimum,
T maximum);Uniform integer in [min, max] or floating point value in [min, max).
unit_vector3¶
unit_vector3¶template <typename Vector3 = std::array<f32, 3>> [[nodiscard]] Vector3 unit_vector3();A uniformly distributed point on the unit sphere. Two engine draws; x and y may differ in the last bit between platforms (see the free random::unit_vector3).
Operator Overloads¶
Public¶
operator=¶
operator=¶random_engine &operator=(
const random_engine &) = default;random_engine &operator=(
random_engine &&) noexcept = default;operator==¶
operator==¶[[nodiscard]] bool operator==(
const random_engine &other) const noexcept;True when both engines are in the same state and will produce the same sequence.