|
RandX 1.4.3
基于 xoshiro/xoroshiro 算法族的纯头文件伪随机数生成器库
|
Xoroshiro128** 伪随机数生成器,64 位输出,周期 2^128-1。 更多...
#include <RandX.hpp>


Public 类型 | |
| using | result_type |
| using | state_type |
| < 输出类型 | |
| Public 类型 继承自 RandX::detail::EngineBase< Xoroshiro128StarStar, std::uint64_t, 2 > | |
| using | result_type |
| using | state_type |
Public 成员函数 | |
| constexpr | Xoroshiro128StarStar () noexcept |
| < 状态类型(2×uint64) | |
| constexpr | Xoroshiro128StarStar (std::uint64_t seed) noexcept |
| 以指定种子构造引擎 | |
| template<class SeedSeq> requires (!std::same_as<std::remove_cvref_t<SeedSeq>, Xoroshiro128StarStar>) | |
| constexpr | Xoroshiro128StarStar (SeedSeq &seq) |
| 从 std::seed_seq 播种 | |
| constexpr | Xoroshiro128StarStar (state_type state) noexcept |
| 从状态数组直接构造 | |
| constexpr result_type | operator() () noexcept |
| 生成下一个 64 位随机数 | |
| constexpr void | jump () noexcept |
| 前进 2^64 步,用于创建并行子序列 | |
| constexpr void | longJump () noexcept |
| 前进 2^96 步,用于创建更稀疏的并行子序列 | |
| constexpr | Xoroshiro128StarStar () noexcept |
| < 状态类型(2×uint64) | |
| RANDX_NODISCARD_CXX20 constexpr | Xoroshiro128StarStar (std::uint64_t seed) noexcept |
| 以指定种子构造引擎 | |
| template<class SeedSeq, std::enable_if_t<!std::is_same_v< std::decay_t< SeedSeq >, Xoroshiro128StarStar > > * = nullptr> | |
| RANDX_NODISCARD_CXX20 constexpr | Xoroshiro128StarStar (SeedSeq &seq) |
| 从 std::seed_seq 播种 | |
| RANDX_NODISCARD_CXX20 constexpr | Xoroshiro128StarStar (state_type state) noexcept |
| 从状态数组直接构造 | |
| constexpr result_type | operator() () noexcept |
| 生成下一个 64 位随机数 | |
| constexpr void | jump () noexcept |
| 前进 2^64 步,用于创建并行子序列 | |
| constexpr void | longJump () noexcept |
| 前进 2^96 步,用于创建更稀疏的并行子序列 | |
| Public 成员函数 继承自 RandX::detail::EngineBase< Xoroshiro128StarStar, std::uint64_t, 2 > | |
| constexpr void | discard (unsigned long long z) noexcept |
| constexpr state_type | serialize () const noexcept |
| constexpr void | deserialize (const state_type &s) noexcept |
| constexpr void | discard (unsigned long long z) noexcept |
| constexpr state_type | serialize () const noexcept |
| constexpr void | deserialize (const state_type &s) noexcept |
额外继承的成员函数 | |
| 静态 Public 成员函数 继承自 RandX::detail::EngineBase< Xoroshiro128StarStar, std::uint64_t, 2 > | |
| static constexpr result_type | min () noexcept |
| static constexpr result_type | max () noexcept |
| static constexpr result_type | min () noexcept |
| static constexpr result_type | max () noexcept |
| Protected 成员函数 继承自 RandX::detail::EngineBase< Xoroshiro128StarStar, std::uint64_t, 2 > | |
| EngineBase ()=default | |
| constexpr | EngineBase (const state_type &state) noexcept |
| constexpr | EngineBase (SeedSeq &seq) |
| constexpr | EngineBase (std::uint64_t seed) noexcept |
| constexpr void | jumpPoly (const std::uint64_t(&poly)[K]) noexcept |
| EngineBase ()=default | |
| constexpr | EngineBase (const state_type &state) noexcept |
| constexpr | EngineBase (SeedSeq &seq) |
| constexpr | EngineBase (std::uint64_t seed) noexcept |
| constexpr void | jumpPoly (const std::uint64_t(&poly)[K]) noexcept |
| Protected 属性 继承自 RandX::detail::EngineBase< Xoroshiro128StarStar, std::uint64_t, 2 > | |
| state_type | s_ |
| 静态 Protected 属性 继承自 RandX::detail::EngineBase< Xoroshiro128StarStar, std::uint64_t, 2 > | |
| static constexpr int | Bits |
Xoroshiro128** 伪随机数生成器,64 位输出,周期 2^128-1。
状态 16 字节(2×uint64),内存占用更小,统计质量更优, 适合内存受限场景。满足 std::uniform_random_bit_generator 概念。 原始实现:http://prng.di.unimi.it/xoroshiro128starstar.c(版本 1.0)
| using RandX::detail::EngineBase< Xoroshiro128StarStar, std::uint64_t, N >::result_type |
| using RandX::detail::EngineBase< Xoroshiro128StarStar, std::uint64_t, N >::state_type |
< 输出类型
|
inlineconstexprnoexcept |
< 状态类型(2×uint64)
默认构造(使用 DefaultSeed)
|
inlineexplicitconstexprnoexcept |
以指定种子构造引擎
| seed | 64 位种子值 |
|
inlineexplicitconstexpr |
从 std::seed_seq 播种
| seq | 种子序列对象 |
|
inlineexplicitconstexprnoexcept |
从状态数组直接构造
| state | serialize() 返回的状态 |
|
constexprnoexcept |
|
constexprnoexcept |
|
constexprnoexcept |