std::normal_distribution<RealType>:: normal_distribution
From cppreference.net
<
cpp
|
numeric
|
random
|
normal distribution
C++
Numerics library
| Common mathematical functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical special functions (C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical constants (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic linear algebra algorithms (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data-parallel types (SIMD) (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Floating-point environment (C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Complex numbers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numeric array (
valarray
)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pseudo-random number generation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bit manipulation (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Saturation arithmetic (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C-style checked integer arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pseudo-random number generation
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::normal_distribution
| Member functions | ||||
|
normal_distribution::normal_distribution
(C++11)
|
||||
|
(C++11)
|
||||
| Generation | ||||
|
(C++11)
|
||||
| Characteristics | ||||
|
(C++11)
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Non-member functions | ||||
|
(C++11)
(C++11)
(until C++20)
|
||||
|
(C++11)
(C++11)
|
|
normal_distribution
(
)
:
normal_distribution
(
0.0
)
{
}
|
(1) | (自 C++11 起) |
|
explicit
normal_distribution
(
RealType mean, RealType stddev
=
1.0
)
;
|
(2) | (自 C++11 起) |
|
explicit
normal_distribution
(
const
param_type
&
params
)
;
|
(3) | (自 C++11 起) |
构造一个新的分布对象。
2)
使用
mean
和
stddev
作为分布参数。
3)
使用
params
作为分布参数。
当 stddev 不大于零时,其行为是未定义的。
参数
| mean | - | μ 分布参数(均值) |
| stddev | - | σ 分布参数(标准差) |
| params | - | 分布参数集合 |
缺陷报告
下列行为变更缺陷报告被追溯应用于先前发布的 C++ 标准。
| 缺陷报告 | 适用范围 | 发布时行为 | 正确行为 |
|---|---|---|---|
| P0935R0 | C++11 | 默认构造函数为显式 | 改为隐式 |