|
RandX 1.4.3
基于 xoshiro/xoroshiro 算法族的纯头文件伪随机数生成器库
|
SplitMix64 伪随机数生成器,64 位输出,周期 2^64。 更多...
#include <RandX.hpp>
Public 类型 | |
| using | state_type = std::uint64_t |
| 状态类型(1×uint64) | |
| using | result_type = std::uint64_t |
| 输出类型 | |
| using | state_type = std::uint64_t |
| 状态类型(1×uint64) | |
| using | result_type = std::uint64_t |
| 输出类型 | |
Public 成员函数 | |
| constexpr | SplitMix64 (state_type state=DefaultSeed) noexcept |
| 以指定状态构造引擎 | |
| template<class SeedSeq> requires (!std::same_as<std::remove_cvref_t<SeedSeq>, SplitMix64>) | |
| constexpr | SplitMix64 (SeedSeq &seq) |
| 从 std::seed_seq 播种 | |
| constexpr result_type | operator() () noexcept |
| 生成下一个 64 位随机数 | |
| constexpr void | discard (unsigned long long n) noexcept |
| 跳过 n 个输出 | |
| template<std::size_t N> | |
| constexpr std::array< std::uint64_t, N > | generateSeedSequence () noexcept |
| 生成 N 个高质量的 64 位种子序列 | |
| constexpr state_type | serialize () const noexcept |
| 序列化引擎状态 | |
| constexpr void | deserialize (state_type state) noexcept |
| 从状态恢复引擎 | |
| RANDX_NODISCARD_CXX20 constexpr | SplitMix64 (state_type state=DefaultSeed) noexcept |
| 以指定状态构造引擎 | |
| template<class SeedSeq, std::enable_if_t<!std::is_same_v< std::decay_t< SeedSeq >, SplitMix64 > > * = nullptr> | |
| RANDX_NODISCARD_CXX20 constexpr | SplitMix64 (SeedSeq &seq) |
| 从 std::seed_seq 播种 | |
| constexpr result_type | operator() () noexcept |
| 生成下一个 64 位随机数 | |
| constexpr void | discard (unsigned long long n) noexcept |
| 跳过 n 个输出 | |
| template<std::size_t N> | |
| constexpr std::array< std::uint64_t, N > | generateSeedSequence () noexcept |
| 生成 N 个高质量的 64 位种子序列 | |
| 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 >, SplitMix64 > > *> | |
| constexpr | SplitMix64 (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 SplitMix64 &, const SplitMix64 &)=default |
| bool | operator== (const SplitMix64 &lhs, const SplitMix64 &rhs) noexcept |
| bool | operator!= (const SplitMix64 &lhs, const SplitMix64 &rhs) noexcept |
SplitMix64 伪随机数生成器,64 位输出,周期 2^64。
状态 8 字节(1×uint64)。主要用于种子扩展与哈希, 可将单个 64 位种子展开为高质量的状态序列。 原始实现:http://prng.di.unimi.it/splitmix64.c
| using RandX::SplitMix64::result_type = std::uint64_t |
输出类型
| using RandX::SplitMix64::state_type = std::uint64_t |
状态类型(1×uint64)
|
explicitconstexprnoexcept |
以指定状态构造引擎
| state | 64 位初始状态值 |

|
explicitconstexpr |
从 std::seed_seq 播种
| seq | 种子序列对象 |
|
inlineconstexpr |
|
constexprnoexcept |
|
constexprnoexcept |
跳过 n 个输出
| n | 跳过次数 |

|
nodiscardconstexprnoexcept |
生成 N 个高质量的 64 位种子序列
| N | 生成的种子数量 |

|
staticnodiscardconstexprnoexcept |
输出范围上界

|
staticnodiscardconstexprnoexcept |
输出范围下界

|
constexprnoexcept |
|
nodiscardconstexprnoexcept |
|
friend |
|
friend |