Template Struct XoshiroState

Struct Documentation

template<class Arch>
struct XoshiroState

SIMD state for the vectorized Xoshiro256++ generator. Contains the 4 SIMD register state and all PRNG operations.

Template Parameters:

Arch – The xsimd architecture type.

Public Types

using result_type = std::uint64_t
using simd_type = xsimd::batch<result_type, Arch>

Public Functions

inline constexpr void seed(result_type seed_val, result_type thread_id = 0, result_type cluster_id = 0) noexcept

Seed the SIMD state from a scalar seed, with optional thread and cluster offsets.

inline constexpr simd_type next() noexcept
inline constexpr void populate_cache(std::array<result_type, CACHE_SIZE> &cache) noexcept
inline constexpr void jump() noexcept

Jump function. Equivalent to 2^128 calls to next().

inline constexpr void mid_jump() noexcept

Mid-jump function. Equivalent to 2^160 calls to next().

inline constexpr void long_jump() noexcept

Long-jump function. Equivalent to 2^192 calls to next().

inline constexpr std::array<result_type, RNG_WIDTH> getState(const std::size_t index) const noexcept
inline void get_flat_state(result_type *out) const noexcept
inline void set_flat_state(const result_type *in) noexcept

Public Members

std::array<simd_type, RNG_WIDTH> s = {}

Public Static Attributes

static constexpr std::uint8_t RNG_WIDTH = 4
static constexpr std::uint8_t SIMD_WIDTH = simd_type::size
static constexpr std::uint16_t CACHE_SIZE = std::numeric_limits<std::uint8_t>::max() + 1