gamma_distribution::gamma_distribution
분포를 생성합니다.
gamma_distribution(result_type alpha0 = result_type(1.0));
result_type beta0 = result_type(1.0));
explicit gamma_distribution(const param_type& par0);
매개 변수
alpha0
알파 메일 매개 변수입니다.beta0
Beta 분포의 매개 변수입니다.par0
매개 변수 패키지 배포를 구성 하는 데 사용 합니다.
설명
전제 조건:0.0 < alpha0
첫 번째 생성자는 개체를 저장된 값 생성 stored_alpha 의 값은 alpha0 및 저장된 값 stored_beta 의 값은 beta0.
두 번째 생성자는 개체를 매개 변수로 저장 된 초기화 구문 par0.
예제
// std_tr1__random__gamma_distribution_construct.cpp
// compile with: /EHsc
#include <random>
#include <iostream>
typedef std::ranlux64_base_01 Myeng;
typedef std::gamma_distribution<double> Mydist;
int main()
{
Myeng eng;
Mydist dist(1.5);
Mydist::input_type engval = eng();
Mydist::result_type distval = dist(eng);
distval = distval; // to quiet "unused" warnings
engval = engval;
std::cout << "alpha == " << dist.alpha() << std::endl;
dist.reset(); // discard any cached values
std::cout << "a random value == " << dist(eng) << std::endl;
std::cout << "a random value == " << dist(eng) << std::endl;
std::cout << "a random value == " << dist(eng) << std::endl;
return (0);
}
요구 사항
헤더: <random>
네임 스페이스: std