std::gamma_distribution(3)

NAME
std::gamma_distribution - A gamma continuous distribution for random numbers.

SYNOPSIS

  Classes
struct param_type

  Public Types
typedef _RealType result_type

  Public Member Functions
_RealType alpha () const
_RealType beta () const
gamma_distribution (const param_type &__p)
gamma_distribution (_RealType __alpha=_RealType(1), _RealType __beta=_RealType(1))
result_type max () const
result_type min () const
template<typename _UniformRandomNumberGenerator > result_type operator() (_UniformRandomNumberGenerator &__urng, const param_type &__p)
template<typename _UniformRandomNumberGenerator > result_type operator() (_UniformRandomNumberGenerator &__urng)
void param (const param_type &__param)
param_type param () const
void reset ()

Detailed Description

  template<typename _RealType = double> class std::gamma_distribution< _RealType >
A gamma continuous distribution for random numbers. The formula for the gamma probability density function is $ p(x|lpha,ttaGamma(lpha)} (x/t^{-x/

Definition at line 3850 of file bits/random.h.

Member Typedef Documentation

  template<typename _RealType = double> typedef _RealType std::gamma_distribution< _RealType >::result_type

The type of the range of the distribution.

Definition at line 3854 of file bits/random.h.

Constructor & Destructor Documentation

  template<typename _RealType = double> std::gamma_distribution< _RealType >::gamma_distribution (_RealType __alpha = _RealType(1), _RealType __beta = _RealType(1)) [inline, explicit]

Constructs a gamma distribution with parameters $ lpha $ and $

Definition at line 3900 of file bits/random.h.

Member Function Documentation

  template<typename _RealType = double> _RealType std::gamma_distribution< _RealType >::alpha () const [inline]

Returns the $ lpha $ of the distribution.

Definition at line 3922 of file bits/random.h.

References std::gamma_distribution< _RealType >::gamma_distribution::param_type::alpha().

  template<typename _RealType = double> _RealType std::gamma_distribution< _RealType >::beta () const [inline]

Returns the $ t distribution.

Definition at line 3929 of file bits/random.h.

References std::gamma_distribution< _RealType >::gamma_distribution::param_type::beta().

  template<typename _RealType = double> result_type std::gamma_distribution< _RealType >::max () const [inline]

Returns the least upper bound value of the distribution.

Definition at line 3958 of file bits/random.h.

  template<typename _RealType = double> result_type std::gamma_distribution< _RealType >::min () const [inline]

Returns the greatest lower bound value of the distribution.

Definition at line 3951 of file bits/random.h.

  template<typename _RealType > template<typename _UniformRandomNumberGenerator > gamma_distribution< _RealType >::result_type std::gamma_distribution< _RealType >::operator() (_UniformRandomNumberGenerator & __urng, const param_type & __param) [inline]

Cheng's rejection algorithm GB for alpha >= 1 and a modification of Vaduva's rejection from Weibull algorithm due to Devroye for alpha < 1.

References: Cheng, R. C. 'The Generation of Gamma Random Variables with Non-integral Shape Parameter.' Applied Statistics, 26, 71-75, 1977.

Vaduva, I. 'Computer Generation of Gamma Gandom Variables by Rejection and Composition Procedures.' Math. Operationsforschung and Statistik, Series in Statistics, 8, 545-576, 1977.

Devroye, L. 'Non-Uniform Random Variates Generation.' Springer-Verlag, New York, 1986, Ch. IX, Sect. 3.4 (+ Errata!).

Definition at line 1964 of file bits/random.tcc.

References std::tr1::__detail::__beta(), std::gamma_distribution< _RealType >::gamma_distribution::param_type::_M_l_d, std::gamma_distribution< _RealType >::gamma_distribution::param_type::alpha(), std::gamma_distribution< _RealType >::gamma_distribution::param_type::beta(), std::exp(), std::log(), and std::pow().

  template<typename _RealType = double> void std::gamma_distribution< _RealType >::param (const param_type & __param) [inline]

Sets the parameter set of the distribution.

Parameters:
    __param The new parameter set of the distribution.

Definition at line 3944 of file bits/random.h.

  template<typename _RealType = double> param_type std::gamma_distribution< _RealType >::param () const [inline]

Returns the parameter set of the distribution.

Definition at line 3936 of file bits/random.h.

Referenced by std::operator==(), and std::operator>>().

  template<typename _RealType = double> void std::gamma_distribution< _RealType >::reset () [inline]

Resets the distribution state.

Does nothing for the gamma distribution.

Definition at line 3916 of file bits/random.h.

Author

Generated automatically by Doxygen for libstdc++ from the source code.