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

Classes

struct  param_type
 

Public Types

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

Public Member Functions

 _RNG_REQUIRE_INTTYPE (geometric_distribution, _Ty)
 
 geometric_distribution (_Ty1 _P0=_Ty1(0.5))
 
 geometric_distribution (const 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 _Ty = int>
typedef geometric_distribution<_Ty> geometric_distribution< _Ty >::_Myt
template<class _Ty = int>
typedef double geometric_distribution< _Ty >::_Ty1
template<class _Ty = int>
typedef _Ty geometric_distribution< _Ty >::result_type

Constructor & Destructor Documentation

template<class _Ty = int>
geometric_distribution< _Ty >::geometric_distribution ( _Ty1  _P0 = _Ty1(0.5))
inlineexplicit
2673  : _Par(_P0)
2674  { // construct
2675  }
param_type _Par
Definition: random:2751
template<class _Ty = int>
geometric_distribution< _Ty >::geometric_distribution ( const param_type _Par0)
inlineexplicit
2678  : _Par(_Par0)
2679  { // construct from parameter package
2680  }
param_type _Par
Definition: random:2751

Member Function Documentation

template<class _Ty = int>
template<class _Engine >
result_type geometric_distribution< _Ty >::_Eval ( _Engine &  _Eng,
const param_type _Par0 
) const
inlineprivate
2746  { // return next value
2747  return ((_Ty)(_CSTD log(_NRAND(_Eng, _Ty1))
2748  / _Par0._Log_1_p));
2749  }
float log(float _X) __GPU_ONLY
Calculates the base-e logarithm of the argument
Definition: amp_math.h:774
double _Ty1
Definition: random:2630
#define _NRAND(eng, resty)
Definition: random:345
#define _CSTD
Definition: yvals.h:570
template<class _Ty = int>
template<class _Elem , class _Traits >
basic_istream<_Elem, _Traits>& geometric_distribution< _Ty >::_Read ( basic_istream< _Elem, _Traits > &  _Istr)
inline
2727  { // read state from _Istr
2728  _Ty1 _P0;
2729  _In(_Istr, _P0);
2730  _Par._Init(_P0);
2731  return (_Istr);
2732  }
param_type _Par
Definition: random:2751
double _Ty1
Definition: random:2630
basic_istream< _Elem, _Traits > & _In(basic_istream< _Elem, _Traits > &_Is, _Ty &_Dx)
Definition: random:156
void _Init(_Ty1 _P0)
Definition: random:2660
template<class _Ty = int>
geometric_distribution< _Ty >::_RNG_REQUIRE_INTTYPE ( geometric_distribution< _Ty >  ,
_Ty   
)
template<class _Ty = int>
template<class _Elem , class _Traits >
basic_ostream<_Elem, _Traits>& geometric_distribution< _Ty >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr) const
inline
2738  { // write state to _Ostr
2739  _Out(_Ostr, _Par._Px);
2740  return (_Ostr);
2741  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:174
param_type _Par
Definition: random:2751
_Ty1 _Px
Definition: random:2668
template<class _Ty = int>
result_type() geometric_distribution< _Ty >::max ( ) const
inline
2703  { // get largest possible result
2704  return ((numeric_limits<result_type>::max)());
2705  }
Definition: limits:102
template<class _Ty = int>
result_type() geometric_distribution< _Ty >::min ( ) const
inline
2698  { // get smallest possible result
2699  return (0);
2700  }
template<class _Ty = int>
template<class _Engine >
result_type geometric_distribution< _Ty >::operator() ( _Engine &  _Eng) const
inline
2713  { // return next value
2714  return (_Eval(_Eng, _Par));
2715  }
param_type _Par
Definition: random:2751
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:2745
template<class _Ty = int>
template<class _Engine >
result_type geometric_distribution< _Ty >::operator() ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
2719  { // return next value, given parameter package
2720  return (_Eval(_Eng, _Par0));
2721  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:2745
template<class _Ty = int>
_Ty1 geometric_distribution< _Ty >::p ( ) const
inline
2683  { // return probability
2684  return (_Par.p());
2685  }
param_type _Par
Definition: random:2751
_Ty1 p() const
Definition: random:2655
template<class _Ty = int>
param_type geometric_distribution< _Ty >::param ( ) const
inline
2688  { // return parameter package
2689  return (_Par);
2690  }
param_type _Par
Definition: random:2751
template<class _Ty = int>
void geometric_distribution< _Ty >::param ( const param_type _Par0)
inline
2693  { // set parameter package
2694  _Par = _Par0;
2695  }
param_type _Par
Definition: random:2751
template<class _Ty = int>
void geometric_distribution< _Ty >::reset ( )
inline
2708  { // clear internal state
2709  }

Member Data Documentation

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

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