|
dl
|
随机数 更多...
#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]区间的 随机整数 | |
| template<typename T> | |
| static T | Normal (T u=0, T o=1) |
| 返回期望为u,标准差为o的正态分布随机值 | |
| static FloatType | FloatNormal (FloatType u=0_f, FloatType o=1_f) |
| static FloatType | FloatNormalX (FloatType scale=1/3_f, FloatType min=-1, FloatType max=1) |
| 返回标准正态分布的缩放值,且限制到指定值 | |
| static bool | Bool () |
| static int | Int (int min, int max) |
| 返回[min,max]区间的 int型整数 | |
| static unsigned | Uint (unsigned min, unsigned max) |
| 返回[min,max]区间的 unsigned型整数 | |
| static size_t | SizeT (size_t min, size_t max) |
| 返回[min,max]区间的 size_t型整数 | |
| template<typename C> | |
| static auto & | Select (C &container) |
| 从容器随机选择一个 | |
| template<typename C> | |
| static auto | SelectErase (C &container) |
| 从容器随机选择一个,并且从容器移除 | |
| static Point | ExPoint (const Point &p0, const Point &p1) |
| static PointU | ExPointU (const PointU &p0, const PointU &p1) |
| static Position | ExDirection () |
| static bool | Percent (int v) |
| 返回百分比命中 | |
| static float | Angle (float min=0, float max=3.1415926f *2.0f) |
| 返回角度(弧度制) | |
| static std::default_random_engine & | GetEngine () |
| 一般不使用,传给标准库接口才使用 | |
随机数
在文件 dl_random.h 第 21 行定义.
|
inlinestatic |
返回角度(弧度制)
在文件 dl_random.h 第 197 行定义.
|
inlinestatic |
在文件 dl_random.h 第 115 行定义.
|
inlinestatic |
在文件 dl_random.h 第 182 行定义.
在文件 dl_random.h 第 174 行定义.
在文件 dl_random.h 第 178 行定义.
|
inlinestatic |
在文件 dl_random.h 第 96 行定义.
|
inlinestatic |
返回标准正态分布的缩放值,且限制到指定值
在文件 dl_random.h 第 103 行定义.
|
inlinestatic |
一般不使用,传给标准库接口才使用
在文件 dl_random.h 第 203 行定义.
|
inlinestatic |
返回[min,max]区间的 int型整数
在文件 dl_random.h 第 123 行定义.
|
inlinestatic |
返回百分比命中
在文件 dl_random.h 第 190 行定义.
|
inlinestatic |
|
inlinestatic |
返回[min,max]区间的 size_t型整数
在文件 dl_random.h 第 137 行定义.
|
inlinestatic |
返回[min,max]区间的 unsigned型整数
在文件 dl_random.h 第 130 行定义.