dl
静态 Public 成员函数 | 所有成员列表
dl::Random类 参考

#include <dl_random.h>

静态 Public 成员函数

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)
 从容器随机选择一个 更多...
 

详细描述

在文件 dl_random.h 第 17 行定义.

成员函数说明

◆ Bool()

static bool dl::Random::Bool ( )
inlinestatic

在文件 dl_random.h 第 77 行定义.

◆ Float()

template<typename T >
static T dl::Random::Float ( T  min,
T  max 
)
inlinestatic

返回[min,max)区间的 浮点数随机值

注解
如果min等于max,则返回min。如果min大于max则交换位置后比较,但会发出一条警告。

在文件 dl_random.h 第 40 行定义.

◆ Integer()

template<typename T >
static T dl::Random::Integer ( T  min,
T  max 
)
inlinestatic

返回[min,max]区间的 随机整数

注解
如果min等于max,则返回min。如果min大于max则交换位置后比较,但会发出一条警告。

在文件 dl_random.h 第 61 行定义.

◆ Select()

template<typename C >
static auto & dl::Random::Select ( C &  container)
inlinestatic

从容器随机选择一个

参数
[in]container容器(不能为空)
返回值
返回引用

在文件 dl_random.h 第 88 行定义.

◆ SetSeed()

static void dl::Random::SetSeed ( uint32_t  seed)
inlinestatic

设置随机数种子

注解
0会随机生成一个种子

在文件 dl_random.h 第 24 行定义.


该类的文档由以下文件生成: