다음을 통해 공유


poisson_distribution::poisson_distribution

분포를 생성합니다.

poisson_distribution(RealType mean0 = RealType(1.0));
explicit binomial_distribution(const param_type& par0);

매개 변수

  • mean0
    평균 분포의 매개 변수입니다.

  • par0
    매개 변수 패키지 배포를 구성 하는 데 사용 합니다.

설명

전제 조건:0.0 < mean0

첫 번째 생성자는 개체를 저장된 값 생성 stored_mean 의 값은 mean0.

두 번째 생성자는 개체를 매개 변수로 저장 된 초기화 구문 par0.

예제

 

// std_tr1__random__poisson_distribution_construct.cpp 
// compile with: /EHsc 
#include <random> 
#include <iostream> 
 
typedef std::mt19937 Myeng; 
typedef std::poisson_distribution<int, double> Mydist; 
int main() 
    { 
    Myeng eng; 
    Mydist dist(3.5); 
    Mydist::input_type engval = eng(); 
    Mydist::result_type distval = dist(eng); 
 
    distval = distval;  // to quiet "unused" warnings 
    engval = engval; 
 
    std::cout << "mean == " << dist.mean() << 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

참고 항목

참조

<random>

poisson_distribution Class