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
poisson_distribution< _Ty0, _Ty1 > Class Template Reference

Classes

struct  param_type
 

Public Types

typedef poisson_distribution< _Ty0, _Ty1 > _Myt
 
typedef _Ty1 input_type
 
typedef _Ty0 result_type
 

Public Member Functions

 poisson_distribution (_Ty1 _Mean0=_Ty1(1))
 
 poisson_distribution (param_type _Par0)
 
_Ty1 mean () 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 _Ty0 = int, class _Ty1 = double>
typedef poisson_distribution<_Ty0, _Ty1> poisson_distribution< _Ty0, _Ty1 >::_Myt
template<class _Ty0 = int, class _Ty1 = double>
typedef _Ty1 poisson_distribution< _Ty0, _Ty1 >::input_type
template<class _Ty0 = int, class _Ty1 = double>
typedef _Ty0 poisson_distribution< _Ty0, _Ty1 >::result_type

Constructor & Destructor Documentation

template<class _Ty0 = int, class _Ty1 = double>
poisson_distribution< _Ty0, _Ty1 >::poisson_distribution ( _Ty1  _Mean0 = _Ty1(1))
inlineexplicit
3182  : _Par(_Mean0)
3183  { // construct
3184  }
param_type _Par
Definition: random:3277
template<class _Ty0 = int, class _Ty1 = double>
poisson_distribution< _Ty0, _Ty1 >::poisson_distribution ( param_type  _Par0)
inlineexplicit
3187  : _Par(_Par0)
3188  { // construct from parameter package
3189  }
param_type _Par
Definition: random:3277

Member Function Documentation

template<class _Ty0 = int, class _Ty1 = double>
template<class _Engine >
result_type poisson_distribution< _Ty0, _Ty1 >::_Eval ( _Engine &  _Eng,
const param_type _Par0 
) const
inlineprivate
3255  { // return next value
3256  if (_Par0._Mean < 12.0)
3257  return (_Par0._Small(_Eng));
3258  for (; ; )
3259  { // generate and reject
3260  _Ty0 _Res;
3261  _Ty1 _Yx;
3262  static _Ty0 _Zero = 0; // to quiet diagnostics
3263  for (; ; )
3264  { // generate a tentative value
3265  _Yx = (_Ty1)_CSTD tan(_Pi * _NRAND(_Eng, _Ty1));
3266  _Res = (_Ty0)(_Par0._Sqrt * _Yx + _Par0._Mean);
3267  if (_Zero <= _Res)
3268  break;
3269  }
3270  if (_NRAND(_Eng, _Ty1) <= 0.9 * (1.0 + _Yx * _Yx)
3271  * _CSTD exp(_Res * _Par0._Logm
3272  - _XLgamma(_Res + 1.0) - _Par0._G1))
3273  return (_Res);
3274  }
3275  }
_CRTIMP2_PURE float __CLRCALL_PURE_OR_CDECL _XLgamma(float)
float exp(float _X) __GPU_ONLY
Calculates the base-e exponential of the argument
Definition: amp_math.h:471
#define _NRAND(eng, resty)
Definition: random:74
static const long double _Pi
Definition: random:62
#define _CSTD
Definition: yvals.h:559
float tan(float _X) __GPU_ONLY
Calculates the tangent value of the argument
Definition: amp_math.h:1128
template<class _Ty0 = int, class _Ty1 = double>
template<class _Elem , class _Traits >
basic_istream<_Elem, _Traits>& poisson_distribution< _Ty0, _Ty1 >::_Read ( basic_istream< _Elem, _Traits > &  _Istr)
inline
3236  { // read state from _Istr
3237  _Ty1 _Mean0;
3238  _In(_Istr, _Mean0);
3239  _Par._Init(_Mean0);
3240  return (_Istr);
3241  }
basic_istream< _Elem, _Traits > & _In(basic_istream< _Elem, _Traits > &_Is, _Ty &_Dx)
Definition: random:151
param_type _Par
Definition: random:3277
void _Init(_Ty1 _Mean0)
Definition: random:3163
template<class _Ty0 = int, class _Ty1 = double>
template<class _Elem , class _Traits >
basic_ostream<_Elem, _Traits>& poisson_distribution< _Ty0, _Ty1 >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr) const
inline
3247  { // write state to _Ostr
3248  _Out(_Ostr, _Par._Mean);
3249  return (_Ostr);
3250  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:169
param_type _Par
Definition: random:3277
_Ty1 _Mean
Definition: random:3174
template<class _Ty0 = int, class _Ty1 = double>
result_type() poisson_distribution< _Ty0, _Ty1 >::max ( ) const
inline
3212  { // get largest possible result
3213  return ((numeric_limits<result_type>::max)());
3214  }
Definition: limits:79
template<class _Ty0 = int, class _Ty1 = double>
_Ty1 poisson_distribution< _Ty0, _Ty1 >::mean ( ) const
inline
3192  { // return mean value
3193  return (_Par.mean());
3194  }
_Ty1 mean() const
Definition: random:3158
param_type _Par
Definition: random:3277
template<class _Ty0 = int, class _Ty1 = double>
result_type() poisson_distribution< _Ty0, _Ty1 >::min ( ) const
inline
3207  { // get smallest possible result
3208  return (0);
3209  }
template<class _Ty0 = int, class _Ty1 = double>
template<class _Engine >
result_type poisson_distribution< _Ty0, _Ty1 >::operator() ( _Engine &  _Eng) const
inline
3222  { // return next value
3223  return (_Eval(_Eng, _Par));
3224  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:3254
param_type _Par
Definition: random:3277
template<class _Ty0 = int, class _Ty1 = double>
template<class _Engine >
result_type poisson_distribution< _Ty0, _Ty1 >::operator() ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
3228  { // return next value, given parameter package
3229  return (_Eval(_Eng, _Par0));
3230  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:3254
template<class _Ty0 = int, class _Ty1 = double>
param_type poisson_distribution< _Ty0, _Ty1 >::param ( ) const
inline
3197  { // return parameter package
3198  return (_Par);
3199  }
param_type _Par
Definition: random:3277
template<class _Ty0 = int, class _Ty1 = double>
void poisson_distribution< _Ty0, _Ty1 >::param ( const param_type _Par0)
inline
3202  { // set parameter package
3203  _Par = _Par0;
3204  }
param_type _Par
Definition: random:3277
template<class _Ty0 = int, class _Ty1 = double>
void poisson_distribution< _Ty0, _Ty1 >::reset ( )
inline
3217  { // clear internal state
3218  }

Member Data Documentation

template<class _Ty0 = int, class _Ty1 = double>
param_type poisson_distribution< _Ty0, _Ty1 >::_Par
private

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