Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::random::gamma_distribution< RealType > Class Template Reference

The gamma distribution is a continuous distribution with two parameters alpha and beta. More...

#include <gamma_distribution.hpp>

Classes

class  param_type
 

Public Types

typedef RealType input_type
 
typedef RealType result_type
 

Public Member Functions

 BOOST_STATIC_ASSERT (!std::numeric_limits< RealType >::is_integer)
 
 gamma_distribution (const result_type &alpha_arg=result_type(1.0), const result_type &beta_arg=result_type(1.0))
 Creates a new gamma_distribution with parameters "alpha" and "beta". More...
 
 gamma_distribution (const param_type &parm)
 Constructs a gamma_distribution from its parameters. More...
 
RealType alpha () const
 Returns the "alpha" paramter of the distribution. More...
 
RealType beta () const
 Returns the "beta" parameter of the distribution. More...
 
RealType min BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Returns the smallest value that the distribution can produce. More...
 
RealType max BOOST_PREVENT_MACRO_SUBSTITUTION () const
 
param_type param () const
 Returns the parameters of the distribution. More...
 
void param (const param_type &parm)
 Sets the parameters of the distribution. More...
 
void reset ()
 Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. More...
 
template<class Engine >
result_type operator() (Engine &eng)
 Returns a random variate distributed according to the gamma distribution. More...
 
template<class URNG >
RealType operator() (URNG &urng, const param_type &parm) const
 

Friends

template<class CharT , class Traits >
std::basic_ostream< CharT,
Traits > & 
operator<< (std::basic_ostream< CharT, Traits > &os, const gamma_distribution &gd)
 Writes a gamma_distribution to a std::ostream. More...
 
template<class CharT , class Traits >
std::basic_istream< CharT,
Traits > & 
operator>> (std::basic_istream< CharT, Traits > &is, gamma_distribution &gd)
 Reads a gamma_distribution from a std::istream. More...
 
bool operator== (const gamma_distribution &lhs, const gamma_distribution &rhs)
 Returns true if the two distributions will produce identical sequences of random variates given equal generators. More...
 
bool operator!= (const gamma_distribution &lhs, const gamma_distribution &rhs)
 Returns true if the two distributions can produce different sequences of random variates, given equal generators. More...
 

Detailed Description

template<class RealType = double>
class boost::random::gamma_distribution< RealType >

The gamma distribution is a continuous distribution with two parameters alpha and beta.

It produces values > 0.

It has $\displaystyle p(x) = x^{\alpha-1}\frac{e^{-x/\beta}}{\beta^\alpha\Gamma(\alpha)}$.

Member Typedef Documentation

template<class RealType = double>
typedef RealType boost::random::gamma_distribution< RealType >::input_type
template<class RealType = double>
typedef RealType boost::random::gamma_distribution< RealType >::result_type

Constructor & Destructor Documentation

template<class RealType = double>
boost::random::gamma_distribution< RealType >::gamma_distribution ( const result_type alpha_arg = result_type(1.0),
const result_type beta_arg = result_type(1.0) 
)
inlineexplicit

Creates a new gamma_distribution with parameters "alpha" and "beta".

Requires: alpha > 0 && beta > 0

References BOOST_ASSERT, and boost::unit_test::framework::init().

Referenced by boost::random::gamma_distribution< RealType >::operator()().

template<class RealType = double>
boost::random::gamma_distribution< RealType >::gamma_distribution ( const param_type parm)
inlineexplicit

Constructs a gamma_distribution from its parameters.

References boost::unit_test::framework::init().

Member Function Documentation

template<class RealType = double>
RealType boost::random::gamma_distribution< RealType >::alpha ( ) const
inline

Returns the "alpha" paramter of the distribution.

template<class RealType = double>
RealType boost::random::gamma_distribution< RealType >::beta ( ) const
inline

Returns the "beta" parameter of the distribution.

template<class RealType = double>
RealType min boost::random::gamma_distribution< RealType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Returns the smallest value that the distribution can produce.

template<class RealType = double>
RealType max boost::random::gamma_distribution< RealType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline
template<class RealType = double>
boost::random::gamma_distribution< RealType >::BOOST_STATIC_ASSERT ( !std::numeric_limits< RealType >::is_integer  )
template<class RealType = double>
template<class Engine >
result_type boost::random::gamma_distribution< RealType >::operator() ( Engine &  eng)
inline

Returns a random variate distributed according to the gamma distribution.

References boost::math::ef::exp(), boost::math::ef::log(), pow(), boost::geometry::math::sqrt(), boost::math::ef::tan(), boost::flyweights::x, and boost::polygon::y().

template<class RealType = double>
template<class URNG >
RealType boost::random::gamma_distribution< RealType >::operator() ( URNG &  urng,
const param_type parm 
) const
inline
template<class RealType = double>
param_type boost::random::gamma_distribution< RealType >::param ( ) const
inline

Returns the parameters of the distribution.

Referenced by boost::random::chi_squared_distribution< RealType >::param().

template<class RealType = double>
void boost::random::gamma_distribution< RealType >::param ( const param_type parm)
inline
template<class RealType = double>
void boost::random::gamma_distribution< RealType >::reset ( void  )
inline

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

Friends And Related Function Documentation

template<class RealType = double>
bool operator!= ( const gamma_distribution< RealType > &  lhs,
const gamma_distribution< RealType > &  rhs 
)
friend

Returns true if the two distributions can produce different sequences of random variates, given equal generators.

template<class RealType = double>
template<class CharT , class Traits >
std::basic_ostream<CharT,Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  os,
const gamma_distribution< RealType > &  gd 
)
friend

Writes a gamma_distribution to a std::ostream.

template<class RealType = double>
bool operator== ( const gamma_distribution< RealType > &  lhs,
const gamma_distribution< RealType > &  rhs 
)
friend

Returns true if the two distributions will produce identical sequences of random variates given equal generators.

template<class RealType = double>
template<class CharT , class Traits >
std::basic_istream<CharT,Traits>& operator>> ( std::basic_istream< CharT, Traits > &  is,
gamma_distribution< RealType > &  gd 
)
friend

Reads a gamma_distribution from a std::istream.


The documentation for this class was generated from the following file: