|
MSTL 1.4.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 () | |
| 默认构造函数 默认使用当前时间戳值作为种子。 | |
| random_lcd (const seed_type seed) | |
| 带种子构造函数 | |
| random_lcd (const random_lcd &)=default | |
| 拷贝构造函数 | |
| random_lcd & | operator= (const random_lcd &)=default |
| 拷贝赋值运算符 | |
| random_lcd (random_lcd &&)=default | |
| 移动构造函数 | |
| random_lcd & | operator= (random_lcd &&)=default |
| 移动赋值运算符 | |
| int | next_int (const int max) |
| 生成[0, max)范围内的随机整数 | |
| int | next_int (const int min, const int max) |
| 生成[min, max)范围内的随机整数 | |
| int | next_int () |
| 生成[0, INT32_MAX)范围内的随机整数 | |
| double | next_double () |
| 生成[0.0, 1.0)范围内的随机双精度浮点数 | |
| double | next_double (const double min, const double max) |
| 生成[min, max)范围内的随机双精度浮点数 | |
| double | next_double (const double max) |
| 生成[0.0, max)范围内的随机双精度浮点数 | |
|
inlineexplicit |
|
inline |
生成[0.0, 1.0)范围内的随机双精度浮点数
在文件 random.hpp 第 89 行定义.
被这些函数引用 next_double() , 以及 next_double().
|
inline |
生成[0.0, max)范围内的随机双精度浮点数
| max | 上限(不包含) |
在文件 random.hpp 第 110 行定义.
引用了 max() , 以及 next_double().
|
inline |
生成[min, max)范围内的随机双精度浮点数
| min | 下限(包含) |
| max | 上限(不包含) |
在文件 random.hpp 第 101 行定义.
引用了 max(), min() , 以及 next_double().
|
inline |
生成[0, INT32_MAX)范围内的随机整数
在文件 random.hpp 第 81 行定义.
引用了 numeric_traits< T, Dummy >::max() , 以及 next_int().
|
inline |
生成[0, max)范围内的随机整数
| max | 上限(不包含) |
在文件 random.hpp 第 61 行定义.
引用了 max().
被这些函数引用 next_int(), next_int() , 以及 shuffle().
|
inline |
生成[min, max)范围内的随机整数
| min | 下限(包含) |
| max | 上限(不包含) |
在文件 random.hpp 第 73 行定义.
引用了 max(), min() , 以及 next_int().