std::negative_binomial_distribution<IntType>:: negative_binomial_distribution
From cppreference.net
<
cpp
|
numeric
|
random
|
negative binomial 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::negative_binomial_distribution
| Member functions | ||||
|
negative_binomial_distribution::negative_binomial_distribution
|
||||
| Generation | ||||
| Characteristics | ||||
| Non-member functions | ||||
|
(C++11)
(C++11)
(until C++20)
|
||||
|
(C++11)
(C++11)
|
|
negative_binomial_distribution
(
)
:
negative_binomial_distribution
(
1
)
{
}
|
(1) | (C++11 이후) |
|
explicit
negative_binomial_distribution
(
IntType k,
double
p
=
0.5
)
;
|
(2) | (C++11 이후) |
|
explicit
negative_binomial_distribution
(
const
param_type
&
params
)
;
|
(3) | (C++11 이후) |
새로운 분포 객체를 생성합니다.
2)
분포 매개변수로
k
와
p
를 사용합니다.
3)
params
를 분포 매개변수로 사용합니다.
매개변수
| k | - | k 분포 매개변수 (시행 성공 횟수) |
| p | - | p 분포 매개변수 (시행이 true 를 생성할 확률) |
| params | - | 분포 매개변수 집합 |
참고 사항
다음 조건을 충족해야 합니다: 0 < p ≤ 1 그리고 0 < k .
만약
p == 1
인 경우,
operator()
오버로드 중
param_type
객체를 받지 않는 버전에 대한 후속 호출은 정의되지 않은 동작을 유발합니다.
기본 생성된
std::negative_binomial_distribution
은 기본 생성된
std::geometric_distribution
과 동등합니다.
결함 보고서
다음의 동작 변경 결함 보고서들은 이전에 발표된 C++ 표준에 소급 적용되었습니다.
| DR | 적용 대상 | 게시된 동작 | 올바른 동작 |
|---|---|---|---|
| P0935R0 | C++11 | default constructor was explicit | made implicit |