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

The chi squared distribution is a real valued distribution with one parameter, n. More...

#include <chi_squared_distribution.hpp>

Classes

class  param_type
 

Public Types

typedef RealType result_type
 
typedef RealType input_type
 

Public Member Functions

 chi_squared_distribution (RealType n_arg=RealType(1))
 Construct a chi_squared_distribution object. More...
 
 chi_squared_distribution (const param_type &parm)
 Construct an chi_squared_distribution object from the parameters. More...
 
template<class URNG >
RealType operator() (URNG &urng)
 Returns a random variate distributed according to the chi squared distribution. More...
 
template<class URNG >
RealType operator() (URNG &urng, const param_type &parm) const
 Returns a random variate distributed according to the chi squared distribution with parameters specified by param. More...
 
RealType n () const
 Returns the n 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
 Returns the largest value that the distribution can produce. More...
 
param_type param () const
 Returns the parameters of the distribution. More...
 
void param (const param_type &parm)
 Sets 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...
 

Friends

template<class CharT , class Traits >
std::basic_ostream< CharT,
Traits > & 
operator<< (std::basic_ostream< CharT, Traits > &os, const chi_squared_distribution &c2d)
 Writes the parameters of the distribution to a std::ostream. More...
 
template<class CharT , class Traits >
std::basic_istream< CharT,
Traits > & 
operator>> (std::basic_istream< CharT, Traits > &is, chi_squared_distribution &c2d)
 Reads the parameters of the distribution from a std::istream. More...
 
bool operator== (const chi_squared_distribution &lhs, const chi_squared_distribution &rhs)
 Returns true if the two distributions will produce the same sequence of values, given equal generators. More...
 
bool operator!= (const chi_squared_distribution &lhs, const chi_squared_distribution &rhs)
 Returns true if the two distributions could produce different sequences of values, given equal generators. More...
 

Detailed Description

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

The chi squared distribution is a real valued distribution with one parameter, n.

The distribution produces values > 0.

The distribution function is $\displaystyle P(x) = \frac{x^{(n/2)-1}e^{-x/2}}{\Gamma(n/2)2^{n/2}}$.

Member Typedef Documentation

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

Constructor & Destructor Documentation

template<class RealType = double>
boost::random::chi_squared_distribution< RealType >::chi_squared_distribution ( RealType  n_arg = RealType(1))
inlineexplicit

Construct a chi_squared_distribution object.

n is the parameter of the distribution.

Requires: t >=0 && 0 <= p <= 1

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

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

Construct an chi_squared_distribution object from the parameters.

Member Function Documentation

template<class RealType = double>
RealType min boost::random::chi_squared_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::chi_squared_distribution< RealType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Returns the largest value that the distribution can produce.

template<class RealType = double>
RealType boost::random::chi_squared_distribution< RealType >::n ( ) const
inline

Returns the n parameter of the distribution.

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

template<class RealType = double>
template<class URNG >
RealType boost::random::chi_squared_distribution< RealType >::operator() ( URNG &  urng)
inline

Returns a random variate distributed according to the chi squared distribution.

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

Returns a random variate distributed according to the chi squared distribution with parameters specified by param.

References boost::random::chi_squared_distribution< RealType >::chi_squared_distribution().

template<class RealType = double>
param_type boost::random::chi_squared_distribution< RealType >::param ( ) const
inline
template<class RealType = double>
void boost::random::chi_squared_distribution< RealType >::param ( const param_type parm)
inline
template<class RealType = double>
void boost::random::chi_squared_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 chi_squared_distribution< RealType > &  lhs,
const chi_squared_distribution< RealType > &  rhs 
)
friend

Returns true if the two distributions could produce different sequences of values, 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 chi_squared_distribution< RealType > &  c2d 
)
friend

Writes the parameters of the distribution to a std::ostream.

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

Returns true if the two distributions will produce the same sequence of values, given equal generators.

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

Reads the parameters of the distribution from a std::istream.


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