29 Numerics library [numerics]

29.6 Random number generation [rand]

29.6.8 Random number distribution class templates [rand.dist]

29.6.8.4 Poisson distributions [rand.dist.pois]

29.6.8.4.3 Class template gamma_­distribution [rand.dist.pois.gamma]

gamma_­distribution Случайное распределение числа производит случайные числа , x>0 распределенные в соответствии с функцией плотности вероятности

p(x|α,β)=ex/ββαΓ(α)xα1.

template<class RealType = double>
  class gamma_distribution {
  public:
    // types
    using result_type = RealType;
    using param_type  = unspecified;

    // constructors and reset functions
    explicit gamma_distribution(RealType alpha = 1.0, RealType beta = 1.0);
    explicit gamma_distribution(const param_type& parm);
    void reset();

    // generating functions
    template<class URBG>
      result_type operator()(URBG& g);
    template<class URBG>
      result_type operator()(URBG& g, const param_type& parm);

    // property functions
    RealType alpha() const;
    RealType beta() const;
    param_type param() const;
    void param(const param_type& parm);
    result_type min() const;
    result_type max() const;
  };

explicit gamma_distribution(RealType alpha = 1.0, RealType beta = 1.0);

Requires: 0<alpha и 0<beta.

Effects: Строит gamma_­distribution объект; alpha и beta соответствуют параметрам распределения.

RealType alpha() const;

Returns: Значение alpha параметра, с которым был построен объект.

RealType beta() const;

Returns: Значение beta параметра, с которым был построен объект.