|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
线性同余随机数生成器 更多...
#include <random.hpp>
Public 类型 | |
| using | seed_type = uint32_t |
| 种子类型 | |
Public 成员函数 | |
| random_lcd () noexcept | |
| 默认构造函数 默认使用当前时间戳值作为种子。 | |
| random_lcd (const seed_type seed) noexcept | |
| 带种子构造函数 | |
| template<typename T> | |
| T | next_int (T max) noexcept |
| 生成 [0, max) 范围内的随机整数 | |
| template<typename T> | |
| T | next_int (T min, T max) noexcept |
| 生成 [min, max) 范围内的随机整数 | |
| template<typename T> | |
| T | next_int () noexcept |
| 生成完整范围的随机整数 | |
| uint64_t | next_uint64 (uint64_t max) noexcept |
| 生成 [0, max) 范围内的随机 64 位整数 | |
| uint64_t | next_uint64 () noexcept |
| 生成完整范围的随机 64 位整数 | |
| template<typename T> | |
| T | next_float () noexcept |
| 生成 [0, 1) 范围内的随机浮点数 | |
| template<typename T> | |
| T | next_float (T min, T max) noexcept |
| 生成 [min, max) 范围内的随机浮点数 | |
| template<typename T> | |
| T | next_float (T max) noexcept |
| 生成 [0, max) 范围内的随机浮点数 | |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
生成 [0, 1) 范围内的随机浮点数
| T | 浮点类型 |
在文件 random.hpp 第 177 行定义.
引用了 generate(), is_floating_point_v , 以及 numeric_traits< T, Dummy >::max().
被这些函数引用 next_float() , 以及 next_float().
|
inlinenoexcept |
生成 [0, max) 范围内的随机浮点数
| T | 浮点类型 |
| max | 上限(不包含) |
在文件 random.hpp 第 206 行定义.
引用了 max() , 以及 next_float().
|
inlinenoexcept |
生成 [min, max) 范围内的随机浮点数
| T | 浮点类型 |
| min | 下限(包含) |
| max | 上限(不包含) |
在文件 random.hpp 第 192 行定义.
引用了 max(), min() , 以及 next_float().
|
inlinenoexcept |
|
inlinenoexcept |
生成 [0, max) 范围内的随机整数
| T | 整形类型 |
| max | 上限(不包含) |
在文件 random.hpp 第 107 行定义.
引用了 is_integral_v , 以及 max().
被这些函数引用 next_int() , 以及 shuffle().
|
inlinenoexcept |
生成 [min, max) 范围内的随机整数
| T | 整形类型 |
| min | 下限(包含) |
| max | 上限(不包含) |
在文件 random.hpp 第 130 行定义.
引用了 max(), min() , 以及 next_int().
|
inlinenoexcept |
生成 [0, max) 范围内的随机 64 位整数
| max | 上限(不包含) |
在文件 random.hpp 第 153 行定义.
引用了 max().