std::discrete_distribution<IntType>:: discrete_distribution
|
discrete_distribution
(
)
;
|
(1) | (自 C++11 起) |
|
template
<
class
InputIt
>
discrete_distribution ( InputIt first, InputIt last ) ; |
(2) | (自 C++11 起) |
|
discrete_distribution
(
std::
initializer_list
<
double
>
weights
)
;
|
(3) | (自 C++11 起) |
|
template
<
class
UnaryOperation
>
discrete_distribution
(
std::
size_t
count,
double
xmin,
double
xmax,
|
(4) | (自 C++11 起) |
|
explicit
discrete_distribution
(
const
param_type
&
params
)
;
|
(5) | (自 C++11 起) |
构造一个新的分布对象。
[
first
,
last
)
内的权重构造分布。若
first
==
last
,效果与默认构造函数相同。
| (xmax − xmin) |
| count |
参数
| first, last | - |
定义用作权重的元素范围。
InputIterator
所引用元素的类型必须可转换为
double
|
| weights | - | 包含权重的初始化列表 |
| unary_op | - |
将被应用的一元操作函数对象。
函数签名应等效于: Ret fun ( const Type & a ) ;
签名不需要包含
const
&
。
|
| params | - | 分布参数集 |
| 类型要求 | ||
-
InputIt
必须满足
LegacyInputIterator
的要求。
|
||