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

 _RNG_REQUIRE_INTTYPE (poisson_distribution, _Ty)
 
 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
2877  : _Par(_Mean0)
2878  { // construct
2879  }
param_type _Par
Definition: random:2971
template<class _Ty = int>
poisson_distribution< _Ty >::poisson_distribution ( const param_type _Par0)
inlineexplicit
2882  : _Par(_Par0)
2883  { // construct from parameter package
2884  }
param_type _Par
Definition: random:2971

Member Function Documentation

template<class _Ty = int>
template<class _Engine >
result_type poisson_distribution< _Ty >::_Eval ( _Engine &  _Eng,
const param_type _Par0 
) const
inlineprivate
2950  { // return next value
2951  if (_Par0._Mean < 12.0)
2952  return (_Par0._Small(_Eng));
2953  for (; ; )
2954  { // generate and reject
2955  _Ty _Res;
2956  _Ty1 _Yx;
2957  for (; ; )
2958  { // generate a tentative value
2959  _Yx = (_Ty1)_CSTD tan(_Pi * _NRAND(_Eng, _Ty1));
2960  _Res = (_Ty)(_Par0._Sqrt * _Yx + _Par0._Mean);
2961  if (static_cast<_Ty>(0) <= _Res)
2962  break;
2963  }
2964  if (_NRAND(_Eng, _Ty1) <= 0.9 * (1.0 + _Yx * _Yx)
2965  * _CSTD exp(_Res * _Par0._Logm
2966  - _XLgamma(_Res + 1.0) - _Par0._G1))
2967  return (_Res);
2968  }
2969  }
double _Ty1
Definition: random:2826
constexpr long double _Pi
Definition: random:100
_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:345
#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
2931  { // read state from _Istr
2932  _Ty1 _Mean0;
2933  _In(_Istr, _Mean0);
2934  _Par._Init(_Mean0);
2935  return (_Istr);
2936  }
double _Ty1
Definition: random:2826
void _Init(_Ty1 _Mean0)
Definition: random:2856
basic_istream< _Elem, _Traits > & _In(basic_istream< _Elem, _Traits > &_Is, _Ty &_Dx)
Definition: random:156
param_type _Par
Definition: random:2971
template<class _Ty = int>
poisson_distribution< _Ty >::_RNG_REQUIRE_INTTYPE ( poisson_distribution< _Ty >  ,
_Ty   
)
template<class _Ty = int>
template<class _Elem , class _Traits >
basic_ostream<_Elem, _Traits>& poisson_distribution< _Ty >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr) const
inline
2942  { // write state to _Ostr
2943  _Out(_Ostr, _Par._Mean);
2944  return (_Ostr);
2945  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:174
param_type _Par
Definition: random:2971
_Ty1 _Mean
Definition: random:2867
template<class _Ty = int>
result_type() poisson_distribution< _Ty >::max ( ) const
inline
2907  { // get largest possible result
2908  return ((numeric_limits<result_type>::max)());
2909  }
Definition: limits:102
template<class _Ty = int>
_Ty1 poisson_distribution< _Ty >::mean ( ) const
inline
2887  { // return mean value
2888  return (_Par.mean());
2889  }
_Ty1 mean() const
Definition: random:2851
param_type _Par
Definition: random:2971
template<class _Ty = int>
result_type() poisson_distribution< _Ty >::min ( ) const
inline
2902  { // get smallest possible result
2903  return (0);
2904  }
template<class _Ty = int>
template<class _Engine >
result_type poisson_distribution< _Ty >::operator() ( _Engine &  _Eng) const
inline
2917  { // return next value
2918  return (_Eval(_Eng, _Par));
2919  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:2949
param_type _Par
Definition: random:2971
template<class _Ty = int>
template<class _Engine >
result_type poisson_distribution< _Ty >::operator() ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
2923  { // return next value, given parameter package
2924  return (_Eval(_Eng, _Par0));
2925  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:2949
template<class _Ty = int>
param_type poisson_distribution< _Ty >::param ( ) const
inline
2892  { // return parameter package
2893  return (_Par);
2894  }
param_type _Par
Definition: random:2971
template<class _Ty = int>
void poisson_distribution< _Ty >::param ( const param_type _Par0)
inline
2897  { // set parameter package
2898  _Par = _Par0;
2899  }
param_type _Par
Definition: random:2971
template<class _Ty = int>
void poisson_distribution< _Ty >::reset ( )
inline
2912  { // clear internal state
2913  }

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: