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< _Ty > Class Template Reference

Classes

struct  param_type
 

Public Types

typedef poisson_distribution< _Ty > _Myt
 
typedef double _Ty1
 
typedef _Ty result_type
 

Public Member Functions

 poisson_distribution (_Ty1 _Mean0=_Ty1(1))
 
 poisson_distribution (const 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 _Ty = int>
typedef poisson_distribution<_Ty> poisson_distribution< _Ty >::_Myt
template<class _Ty = int>
typedef double poisson_distribution< _Ty >::_Ty1
template<class _Ty = int>
typedef _Ty poisson_distribution< _Ty >::result_type

Constructor & Destructor Documentation

template<class _Ty = int>
poisson_distribution< _Ty >::poisson_distribution ( _Ty1  _Mean0 = _Ty1(1))
inlineexplicit
2846  : _Par(_Mean0)
2847  { // construct
2848  }
param_type _Par
Definition: random:2940
template<class _Ty = int>
poisson_distribution< _Ty >::poisson_distribution ( const param_type _Par0)
inlineexplicit
2851  : _Par(_Par0)
2852  { // construct from parameter package
2853  }
param_type _Par
Definition: random:2940

Member Function Documentation

template<class _Ty = int>
template<class _Engine >
result_type poisson_distribution< _Ty >::_Eval ( _Engine &  _Eng,
const param_type _Par0 
) const
inlineprivate
2919  { // return next value
2920  if (_Par0._Mean < 12.0)
2921  return (_Par0._Small(_Eng));
2922  for (; ; )
2923  { // generate and reject
2924  _Ty _Res;
2925  _Ty1 _Yx;
2926  for (; ; )
2927  { // generate a tentative value
2928  _Yx = (_Ty1)_CSTD tan(_Pi * _NRAND(_Eng, _Ty1));
2929  _Res = (_Ty)(_Par0._Sqrt * _Yx + _Par0._Mean);
2930  if (static_cast<_Ty>(0) <= _Res)
2931  break;
2932  }
2933  if (_NRAND(_Eng, _Ty1) <= 0.9 * (1.0 + _Yx * _Yx)
2934  * _CSTD exp(_Res * _Par0._Logm
2935  - _XLgamma(_Res + 1.0) - _Par0._G1))
2936  return (_Res);
2937  }
2938  }
double _Ty1
Definition: random:2794
static constexpr long double _Pi
Definition: random:77
_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:323
#define _CSTD
Definition: yvals.h:570
float tan(float _X) __GPU_ONLY
Calculates the tangent value of the argument
Definition: amp_math.h:1128
template<class _Ty = int>
template<class _Elem , class _Traits >
basic_istream<_Elem, _Traits>& poisson_distribution< _Ty >::_Read ( basic_istream< _Elem, _Traits > &  _Istr)
inline
2900  { // read state from _Istr
2901  _Ty1 _Mean0;
2902  _In(_Istr, _Mean0);
2903  _Par._Init(_Mean0);
2904  return (_Istr);
2905  }
double _Ty1
Definition: random:2794
void _Init(_Ty1 _Mean0)
Definition: random:2825
basic_istream< _Elem, _Traits > & _In(basic_istream< _Elem, _Traits > &_Is, _Ty &_Dx)
Definition: random:133
param_type _Par
Definition: random:2940
template<class _Ty = int>
template<class _Elem , class _Traits >
basic_ostream<_Elem, _Traits>& poisson_distribution< _Ty >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr) const
inline
2911  { // write state to _Ostr
2912  _Out(_Ostr, _Par._Mean);
2913  return (_Ostr);
2914  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:151
param_type _Par
Definition: random:2940
_Ty1 _Mean
Definition: random:2836
template<class _Ty = int>
result_type() poisson_distribution< _Ty >::max ( ) const
inline
2876  { // get largest possible result
2877  return ((numeric_limits<result_type>::max)());
2878  }
Definition: limits:101
template<class _Ty = int>
_Ty1 poisson_distribution< _Ty >::mean ( ) const
inline
2856  { // return mean value
2857  return (_Par.mean());
2858  }
_Ty1 mean() const
Definition: random:2820
param_type _Par
Definition: random:2940
template<class _Ty = int>
result_type() poisson_distribution< _Ty >::min ( ) const
inline
2871  { // get smallest possible result
2872  return (0);
2873  }
template<class _Ty = int>
template<class _Engine >
result_type poisson_distribution< _Ty >::operator() ( _Engine &  _Eng) const
inline
2886  { // return next value
2887  return (_Eval(_Eng, _Par));
2888  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:2918
param_type _Par
Definition: random:2940
template<class _Ty = int>
template<class _Engine >
result_type poisson_distribution< _Ty >::operator() ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
2892  { // return next value, given parameter package
2893  return (_Eval(_Eng, _Par0));
2894  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:2918
template<class _Ty = int>
param_type poisson_distribution< _Ty >::param ( ) const
inline
2861  { // return parameter package
2862  return (_Par);
2863  }
param_type _Par
Definition: random:2940
template<class _Ty = int>
void poisson_distribution< _Ty >::param ( const param_type _Par0)
inline
2866  { // set parameter package
2867  _Par = _Par0;
2868  }
param_type _Par
Definition: random:2940
template<class _Ty = int>
void poisson_distribution< _Ty >::reset ( )
inline
2881  { // clear internal state
2882  }

Member Data Documentation

template<class _Ty = int>
param_type poisson_distribution< _Ty >::_Par
private

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