Class XoshiroScalar
Defined in File xoshiro_scalar.hpp
Class Documentation
-
class XoshiroScalar
A class implementing the XoshiroScalar random number generator.
Public Types
-
using result_type = std::uint64_t
Public Functions
-
inline explicit constexpr XoshiroScalar(const result_type seed) noexcept
Constructs the XoshiroScalar generator with a given seed.
- Parameters:
seed – The seed value.
-
inline explicit constexpr XoshiroScalar(const result_type seed, const result_type thread_id) noexcept
Constructs the XoshiroScalar generator with a given seed and thread ID.
- Parameters:
seed – The seed value.
thread_id – The thread ID.
-
inline explicit constexpr XoshiroScalar(const result_type seed, const result_type thread_id, const result_type cluster_id) noexcept
Constructs the XoshiroScalar generator with a given seed and thread ID.
- Parameters:
seed – The seed value.
thread_id – The thread ID.
cluster_id – The cluster ID.
- inline constexpr result_type (operator())() noexcept
Generates the next random number.
- Returns:
The next random number.
- inline constexpr double() uniform () noexcept
Generates a uniform random number in the range [0, 1).
- Returns:
A uniform random number.
-
inline constexpr std::array<result_type, 4> getState() const noexcept
Returns the state of the generator.
- Returns:
The state of the generator.
-
inline constexpr void setState(const std::array<result_type, 4> &state) noexcept
-
inline constexpr void jump() noexcept
Jump function for the generator. It is equivalent to 2^128 calls to next(). It can be used to generate 2^128 non-overlapping subsequences for simd computations.
-
inline constexpr void mid_jump() noexcept
Jump function for the generator. It is equivalent to 2^160 calls to next(). It can be used to generate 2^96 non-overlapping subsequences for parallel computations.
Public Static Functions
- static inline constexpr auto() min () noexcept
- static inline constexpr auto() max () noexcept
-
static inline constexpr result_type stateSize() noexcept
Returns the size of the state array.
- Returns:
The size of the state array.
-
using result_type = std::uint64_t