|
RandX 1.4.3
基于 xoshiro/xoroshiro 算法族的纯头文件伪随机数生成器库
|
SFC64(Small Fast Counter)伪随机数生成器,64 位输出,周期 >= 2^64。 更多...
#include <RandX.hpp>
Public 类型 | |
| using | state_type = std::array<std::uint64_t, 4> |
| 状态类型(4×uint64) | |
| using | result_type = std::uint64_t |
| 输出类型 | |
| using | state_type = std::array<std::uint64_t, 4> |
| 状态类型(4×uint64) | |
| using | result_type = std::uint64_t |
| 输出类型 | |
Public 成员函数 | |
| constexpr | SFC64 (std::uint64_t seed=DefaultSeed) noexcept |
| 以指定种子构造引擎 | |
| template<class SeedSeq> requires (!std::same_as<std::remove_cvref_t<SeedSeq>, SFC64>) | |
| constexpr | SFC64 (SeedSeq &seq) |
| 从 std::seed_seq 播种 | |
| constexpr | SFC64 (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 | SFC64 (std::uint64_t seed=DefaultSeed) noexcept |
| 以指定种子构造引擎 | |
| template<class SeedSeq, std::enable_if_t<!std::is_same_v< std::decay_t< SeedSeq >, SFC64 > > * = nullptr> | |
| RANDX_NODISCARD_CXX20 constexpr | SFC64 (SeedSeq &seq) |
| 从 std::seed_seq 播种 | |
| constexpr | SFC64 (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 >, SFC64 > > *> | |
| constexpr | SFC64 (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 SFC64 &, const SFC64 &)=default |
| bool | operator== (const SFC64 &lhs, const SFC64 &rhs) noexcept |
| bool | operator!= (const SFC64 &lhs, const SFC64 &rhs) noexcept |
SFC64(Small Fast Counter)伪随机数生成器,64 位输出,周期 >= 2^64。
状态 32 字节(4×uint64)。由 Chris Doty-Humphrey(PractRand)设计, 速度极快,通过 PractRand 全部统计测试。满足 std::uniform_random_bit_generator 概念。
| using RandX::SFC64::result_type = std::uint64_t |
输出类型
| using RandX::SFC64::state_type = std::array<std::uint64_t, 4> |
状态类型(4×uint64)
|
explicitnodiscardconstexprnoexcept |
以指定种子构造引擎
| seed | 64 位种子值 |

|
explicitconstexpr |
从 std::seed_seq 播种
| seq | 种子序列对象 |
|
explicitnodiscardconstexprnoexcept |
从状态数组直接构造
| state | serialize() 返回的状态 |
|
inlineconstexpr |

|
constexprnoexcept |
|
constexprnoexcept |
跳过 n 个输出
| n | 跳过次数 |

|
staticnodiscardconstexprnoexcept |
输出范围上界

|
staticnodiscardconstexprnoexcept |
输出范围下界

|
constexprnoexcept |
|
nodiscardconstexprnoexcept |