STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
exponential_distribution< _Ty > Class Template Reference

Classes

struct  param_type
 

Public Types

typedef exponential_distribution< _Ty > _Myt
 
typedef _Ty result_type
 

Public Member Functions

 _RNG_REQUIRE_REALTYPE (exponential_distribution, _Ty)
 
 exponential_distribution (_Ty _Lambda0=_Ty(1))
 
 exponential_distribution (const param_type &_Par0)
 
_Ty lambda () const
 
param_type param () const
 
void param (const param_type &_Par0)
 
result_type() min () const
 
result_type() max () const
 
void reset ()
 
template<class _Engine >
result_type operator() (_Engine &_Eng) const
 
template<class _Engine >
result_type operator() (_Engine &_Eng, const param_type &_Par0) const
 
template<class _Elem , class _Traits >
basic_istream< _Elem, _Traits > & _Read (basic_istream< _Elem, _Traits > &_Istr)
 
template<class _Elem , class _Traits >
basic_ostream< _Elem, _Traits > & _Write (basic_ostream< _Elem, _Traits > &_Ostr) const
 

Private Member Functions

template<class _Engine >
result_type _Eval (_Engine &_Eng, const param_type &_Par0) const
 

Private Attributes

param_type _Par
 

Member Typedef Documentation

template<class _Ty = double>
typedef exponential_distribution<_Ty> exponential_distribution< _Ty >::_Myt
template<class _Ty = double>
typedef _Ty exponential_distribution< _Ty >::result_type

Constructor & Destructor Documentation

template<class _Ty = double>
exponential_distribution< _Ty >::exponential_distribution ( _Ty  _Lambda0 = _Ty(1))
inlineexplicit
3501  : _Par(_Lambda0)
3502  { // construct
3503  }
param_type _Par
Definition: random:3578
template<class _Ty = double>
exponential_distribution< _Ty >::exponential_distribution ( const param_type _Par0)
inlineexplicit
3506  : _Par(_Par0)
3507  { // construct from parameter package
3508  }
param_type _Par
Definition: random:3578

Member Function Documentation

template<class _Ty = double>
template<class _Engine >
result_type exponential_distribution< _Ty >::_Eval ( _Engine &  _Eng,
const param_type _Par0 
) const
inlineprivate
3574  { // return next value
3575  return (-_CSTD log(_Ty(1) - _NRAND(_Eng, _Ty)) / _Par0._Lambda);
3576  }
float log(float _X) __GPU_ONLY
Calculates the base-e logarithm of the argument
Definition: amp_math.h:774
#define _NRAND(eng, resty)
Definition: random:345
#define _CSTD
Definition: yvals.h:570
template<class _Ty = double>
template<class _Elem , class _Traits >
basic_istream<_Elem, _Traits>& exponential_distribution< _Ty >::_Read ( basic_istream< _Elem, _Traits > &  _Istr)
inline
3555  { // read state from _Istr
3556  _Ty _Lambda0;
3557  _In(_Istr, _Lambda0);
3558  _Par._Init(_Lambda0);
3559  return (_Istr);
3560  }
param_type _Par
Definition: random:3578
void _Init(_Ty _Lambda0)
Definition: random:3490
basic_istream< _Elem, _Traits > & _In(basic_istream< _Elem, _Traits > &_Is, _Ty &_Dx)
Definition: random:156
template<class _Ty = double>
exponential_distribution< _Ty >::_RNG_REQUIRE_REALTYPE ( exponential_distribution< _Ty >  ,
_Ty   
)
template<class _Ty = double>
template<class _Elem , class _Traits >
basic_ostream<_Elem, _Traits>& exponential_distribution< _Ty >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr) const
inline
3566  { // write state to _Ostr
3567  _Out(_Ostr, _Par._Lambda);
3568  return (_Ostr);
3569  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:174
param_type _Par
Definition: random:3578
_Ty _Lambda
Definition: random:3497
template<class _Ty = double>
_Ty exponential_distribution< _Ty >::lambda ( ) const
inline
3511  { // return lambda value
3512  return (_Par.lambda());
3513  }
param_type _Par
Definition: random:3578
_Ty lambda() const
Definition: random:3485
template<class _Ty = double>
result_type() exponential_distribution< _Ty >::max ( ) const
inline
3531  { // get largest possible result
3532  return ((numeric_limits<result_type>::max)());
3533  }
Definition: limits:102
template<class _Ty = double>
result_type() exponential_distribution< _Ty >::min ( ) const
inline
3526  { // get smallest possible result
3527  return (0);
3528  }
template<class _Ty = double>
template<class _Engine >
result_type exponential_distribution< _Ty >::operator() ( _Engine &  _Eng) const
inline
3541  { // return next value
3542  return (_Eval(_Eng, _Par));
3543  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:3573
param_type _Par
Definition: random:3578
template<class _Ty = double>
template<class _Engine >
result_type exponential_distribution< _Ty >::operator() ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
3547  { // return next value, given parameter package
3548  return (_Eval(_Eng, _Par0));
3549  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:3573
template<class _Ty = double>
param_type exponential_distribution< _Ty >::param ( ) const
inline
3516  { // return parameter package
3517  return (_Par);
3518  }
param_type _Par
Definition: random:3578
template<class _Ty = double>
void exponential_distribution< _Ty >::param ( const param_type _Par0)
inline
3521  { // set parameter package
3522  _Par = _Par0;
3523  }
param_type _Par
Definition: random:3578
template<class _Ty = double>
void exponential_distribution< _Ty >::reset ( )
inline
3536  { // clear internal state
3537  }

Member Data Documentation

template<class _Ty = double>
param_type exponential_distribution< _Ty >::_Par
private

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