std::binomial_distribution<IntType>:: param
From cppreference.net
<
cpp
|
numeric
|
random
|
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::binomial_distribution
| Member functions | ||||
| Generation | ||||
| Characteristics | ||||
|
binomial_distribution::param
|
||||
| Non-member functions | ||||
|
(C++11)
(C++11)
(until C++20)
|
||||
|
(C++11)
(C++11)
|
|
param_type param
(
)
const
;
|
(1) | (C++11 이후) |
|
void
param
(
const
param_type
&
params
)
;
|
(2) | (C++11 이후) |
관련 분포 매개변수 집합을 관리합니다.
1)
관련 매개변수 집합을 반환합니다.
2)
관련 매개변수 집합을
params
로 설정합니다.
목차 |
매개변수
| params | - | 연관된 매개변수 집합의 새로운 내용 |
반환값
1)
연관된 매개변수 집합.
2)
(없음)
복잡도
상수.
예제
이 코드 실행
#include <iostream> #include <random> int main() { std::random_device rd; std::mt19937 gen(rd()); using BinomialDist = std::binomial_distribution<>; BinomialDist bino_dis(1, 0.5); std::cout << "A sample of Binomial( 1, 0.5): " << bino_dis(gen) << '\n'; // Use another parameter set bino_dis.param(BinomialDist::param_type(100,0.9)); std::cout << "A sample of Binomial(100, 0.9): " << bino_dis(gen) << '\n'; }
가능한 출력:
A sample of Binomial( 1, 0.5): 0 A sample of Binomial(100, 0.9): 94