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

Classes

struct  param_type
 

Public Types

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

Public Member Functions

 geometric_distribution (_Ty1 _P0=_Ty1(0.5))
 
 geometric_distribution (param_type _Par0)
 
_Ty1 p () 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 geometric_distribution<_Ty0, _Ty1> geometric_distribution< _Ty0, _Ty1 >::_Myt
template<class _Ty0 = int, class _Ty1 = double>
typedef _Ty1 geometric_distribution< _Ty0, _Ty1 >::input_type
template<class _Ty0 = int, class _Ty1 = double>
typedef _Ty0 geometric_distribution< _Ty0, _Ty1 >::result_type

Constructor & Destructor Documentation

template<class _Ty0 = int, class _Ty1 = double>
geometric_distribution< _Ty0, _Ty1 >::geometric_distribution ( _Ty1  _P0 = _Ty1(0.5))
inlineexplicit
2995  : _Par(_P0)
2996  { // construct
2997  }
param_type _Par
Definition: random:3073
template<class _Ty0 = int, class _Ty1 = double>
geometric_distribution< _Ty0, _Ty1 >::geometric_distribution ( param_type  _Par0)
inlineexplicit
3000  : _Par(_Par0)
3001  { // construct from parameter package
3002  }
param_type _Par
Definition: random:3073

Member Function Documentation

template<class _Ty0 = int, class _Ty1 = double>
template<class _Engine >
result_type geometric_distribution< _Ty0, _Ty1 >::_Eval ( _Engine &  _Eng,
const param_type _Par0 
) const
inlineprivate
3068  { // return next value
3069  return ((_Ty0)(_CSTD log(_NRAND(_Eng, _Ty1))
3070  / _Par0._Log_1_p));
3071  }
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:74
#define _CSTD
Definition: yvals.h:559
template<class _Ty0 = int, class _Ty1 = double>
template<class _Elem , class _Traits >
basic_istream<_Elem, _Traits>& geometric_distribution< _Ty0, _Ty1 >::_Read ( basic_istream< _Elem, _Traits > &  _Istr)
inline
3049  { // read state from _Istr
3050  _Ty1 _P0;
3051  _In(_Istr, _P0);
3052  _Par._Init(_P0);
3053  return (_Istr);
3054  }
param_type _Par
Definition: random:3073
basic_istream< _Elem, _Traits > & _In(basic_istream< _Elem, _Traits > &_Is, _Ty &_Dx)
Definition: random:151
void _Init(_Ty1 _P0)
Definition: random:2982
template<class _Ty0 = int, class _Ty1 = double>
template<class _Elem , class _Traits >
basic_ostream<_Elem, _Traits>& geometric_distribution< _Ty0, _Ty1 >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr) const
inline
3060  { // write state to _Ostr
3061  _Out(_Ostr, _Par._Px);
3062  return (_Ostr);
3063  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:169
_Ty1 _Px
Definition: random:2990
param_type _Par
Definition: random:3073
template<class _Ty0 = int, class _Ty1 = double>
result_type() geometric_distribution< _Ty0, _Ty1 >::max ( ) const
inline
3025  { // get largest possible result
3026  return ((numeric_limits<result_type>::max)());
3027  }
Definition: limits:79
template<class _Ty0 = int, class _Ty1 = double>
result_type() geometric_distribution< _Ty0, _Ty1 >::min ( ) const
inline
3020  { // get smallest possible result
3021  return (0);
3022  }
template<class _Ty0 = int, class _Ty1 = double>
template<class _Engine >
result_type geometric_distribution< _Ty0, _Ty1 >::operator() ( _Engine &  _Eng) const
inline
3035  { // return next value
3036  return (_Eval(_Eng, _Par));
3037  }
param_type _Par
Definition: random:3073
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:3067
template<class _Ty0 = int, class _Ty1 = double>
template<class _Engine >
result_type geometric_distribution< _Ty0, _Ty1 >::operator() ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
3041  { // return next value, given parameter package
3042  return (_Eval(_Eng, _Par0));
3043  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:3067
template<class _Ty0 = int, class _Ty1 = double>
_Ty1 geometric_distribution< _Ty0, _Ty1 >::p ( ) const
inline
3005  { // return probability
3006  return (_Par.p());
3007  }
param_type _Par
Definition: random:3073
_Ty1 p() const
Definition: random:2977
template<class _Ty0 = int, class _Ty1 = double>
param_type geometric_distribution< _Ty0, _Ty1 >::param ( ) const
inline
3010  { // return parameter package
3011  return (_Par);
3012  }
param_type _Par
Definition: random:3073
template<class _Ty0 = int, class _Ty1 = double>
void geometric_distribution< _Ty0, _Ty1 >::param ( const param_type _Par0)
inline
3015  { // set parameter package
3016  _Par = _Par0;
3017  }
param_type _Par
Definition: random:3073
template<class _Ty0 = int, class _Ty1 = double>
void geometric_distribution< _Ty0, _Ty1 >::reset ( )
inline
3030  { // clear internal state
3031  }

Member Data Documentation

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

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