#include <dl_random.h>
|
| static void | SetSeed (uint32_t seed) |
| | 设置随机数种子 更多...
|
| |
| template<typename T > |
| static T | Float (T min, T max) |
| | 返回[min,max)区间的 浮点数随机值 更多...
|
| |
| template<typename T > |
| static T | Integer (T min, T max) |
| | 返回[min,max]区间的 随机整数 更多...
|
| |
| static bool | Bool () |
| |
| template<typename C > |
| static auto & | Select (C &container) |
| | 从容器随机选择一个 更多...
|
| |
◆ Bool()
| static bool dl::Random::Bool |
( |
| ) |
|
|
inlinestatic |
◆ Float()
| static T dl::Random::Float |
( |
T |
min, |
|
|
T |
max |
|
) |
| |
|
inlinestatic |
返回[min,max)区间的 浮点数随机值
- 注解
- 如果min等于max,则返回min。如果min大于max则交换位置后比较,但会发出一条警告。
在文件 dl_random.h 第 40 行定义.
◆ Integer()
| static T dl::Random::Integer |
( |
T |
min, |
|
|
T |
max |
|
) |
| |
|
inlinestatic |
返回[min,max]区间的 随机整数
- 注解
- 如果min等于max,则返回min。如果min大于max则交换位置后比较,但会发出一条警告。
在文件 dl_random.h 第 61 行定义.
◆ Select()
| static auto & dl::Random::Select |
( |
C & |
container | ) |
|
|
inlinestatic |
◆ SetSeed()
| static void dl::Random::SetSeed |
( |
uint32_t |
seed | ) |
|
|
inlinestatic |
该类的文档由以下文件生成: