|
RandX 1.4.3
基于 xoshiro/xoroshiro 算法族的纯头文件伪随机数生成器库
|
RomuDuoJr 伪随机数生成器,64 位输出,周期估计 >= 2^51。 更多...
#include <RandX.hpp>
Public 类型 | |
| using | state_type = std::array<std::uint64_t, 2> |
| 状态类型(2×uint64) | |
| using | result_type = std::uint64_t |
| 输出类型 | |
| using | state_type = std::array<std::uint64_t, 2> |
| 状态类型(2×uint64) | |
| using | result_type = std::uint64_t |
| 输出类型 | |
Public 成员函数 | |
| constexpr | RomuDuoJr (std::uint64_t seed=DefaultSeed) noexcept |
| 以指定种子构造引擎 | |
| template<class SeedSeq> requires (!std::same_as<std::remove_cvref_t<SeedSeq>, RomuDuoJr>) | |
| constexpr | RomuDuoJr (SeedSeq &seq) |
| 从 std::seed_seq 播种 | |
| constexpr | RomuDuoJr (state_type state) noexcept |
| 从状态数组直接构造 | |
| constexpr result_type | operator() () noexcept |
| 生成下一个 64 位随机数 | |
| constexpr void | discard (unsigned long long n) noexcept |
| 跳过 n 个输出 | |
| constexpr state_type | serialize () const noexcept |
| 序列化引擎状态 | |
| constexpr void | deserialize (state_type state) noexcept |
| 从状态恢复引擎 | |
| constexpr | RomuDuoJr (std::uint64_t seed=DefaultSeed) noexcept |
| 以指定种子构造引擎 | |
| template<class SeedSeq, std::enable_if_t<!std::is_same_v< std::decay_t< SeedSeq >, RomuDuoJr > > * = nullptr> | |
| RANDX_NODISCARD_CXX20 constexpr | RomuDuoJr (SeedSeq &seq) |
| 从 std::seed_seq 播种 | |
| constexpr | RomuDuoJr (state_type state) noexcept |
| 从状态数组直接构造 | |
| constexpr result_type | operator() () noexcept |
| 生成下一个 64 位随机数 | |
| constexpr void | discard (unsigned long long n) noexcept |
| 跳过 n 个输出 | |
| constexpr state_type | serialize () const noexcept |
| 序列化引擎状态 | |
| constexpr void | deserialize (state_type state) noexcept |
| 从状态恢复引擎 | |
| template<class SeedSeq, std::enable_if_t<!std::is_same_v< std::decay_t< SeedSeq >, RomuDuoJr > > *> | |
| constexpr | RomuDuoJr (SeedSeq &seq) |
静态 Public 成员函数 | |
| static constexpr result_type | min () noexcept |
| 输出范围下界 | |
| static constexpr result_type | max () noexcept |
| 输出范围上界 | |
| static constexpr result_type | min () noexcept |
| 输出范围下界 | |
| static constexpr result_type | max () noexcept |
| 输出范围上界 | |
友元 | |
| auto | operator<=> (const RomuDuoJr &, const RomuDuoJr &)=default |
| bool | operator== (const RomuDuoJr &lhs, const RomuDuoJr &rhs) noexcept |
| bool | operator!= (const RomuDuoJr &lhs, const RomuDuoJr &rhs) noexcept |
RomuDuoJr 伪随机数生成器,64 位输出,周期估计 >= 2^51。
状态 16 字节(2×uint64)。由 Mark Overton 设计, 极简极快,适合非关键模拟场景。满足 std::uniform_random_bit_generator 概念。
| using RandX::RomuDuoJr::result_type = std::uint64_t |
输出类型
| using RandX::RomuDuoJr::state_type = std::array<std::uint64_t, 2> |
状态类型(2×uint64)
|
explicitnodiscardconstexprnoexcept |
以指定种子构造引擎
| seed | 64 位种子值 |

|
explicitconstexpr |
从 std::seed_seq 播种
| seq | 种子序列对象 |
|
explicitnodiscardconstexprnoexcept |
从状态数组直接构造
| state | serialize() 返回的状态 |
|
inlineconstexpr |
|
constexprnoexcept |
|
constexprnoexcept |
跳过 n 个输出
| n | 跳过次数 |

|
staticnodiscardconstexprnoexcept |
输出范围上界

|
staticnodiscardconstexprnoexcept |
输出范围下界

|
constexprnoexcept |
|
nodiscardconstexprnoexcept |