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

Classes

struct  param_type
 

Public Types

typedef negative_binomial_distribution< _Ty > _Myt
 
typedef _Ty result_type
 

Public Member Functions

 negative_binomial_distribution (_Ty _K0=1, double _P0=0.5)
 
 negative_binomial_distribution (const param_type &_Par0)
 
_Ty k () const
 
double 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 negative_binomial_distribution<_Ty> negative_binomial_distribution< _Ty >::_Myt
template<class _Ty = int>
typedef _Ty negative_binomial_distribution< _Ty >::result_type

Constructor & Destructor Documentation

template<class _Ty = int>
negative_binomial_distribution< _Ty >::negative_binomial_distribution ( _Ty  _K0 = 1,
double  _P0 = 0.5 
)
inlineexplicit
5390  : _Par(_K0, _P0)
5391  { // construct
5392  }
param_type _Par
Definition: random:5481
template<class _Ty = int>
negative_binomial_distribution< _Ty >::negative_binomial_distribution ( const param_type _Par0)
inlineexplicit
5395  : _Par(_Par0)
5396  { // construct from parameter package
5397  }
param_type _Par
Definition: random:5481

Member Function Documentation

template<class _Ty = int>
template<class _Engine >
result_type negative_binomial_distribution< _Ty >::_Eval ( _Engine &  _Eng,
const param_type _Par0 
) const
inlineprivate
5471  { // return pseudo-random value
5472  double _V1;
5474  dist1(_Par0._Kx, (1 - _Par0._Px) / (_Par0._Px));
5475  _V1 = dist1(_Eng);
5476  poisson_distribution<_Ty> dist2(_V1);
5477 
5478  return (dist2(_Eng));
5479  }
Definition: random:2790
Definition: random:3812
template<class _Ty = int>
template<class _Elem , class _Traits >
basic_istream<_Elem, _Traits>& negative_binomial_distribution< _Ty >::_Read ( basic_istream< _Elem, _Traits > &  _Istr)
inline
5449  { // read state from _Istr
5450  _Ty _K0;
5451  double _P0;
5452  _In(_Istr, _P0);
5453  _In(_Istr, _K0);
5454  _Par._Init(_K0, _P0);
5455  return (_Istr);
5456  }
basic_istream< _Elem, _Traits > & _In(basic_istream< _Elem, _Traits > &_Is, _Ty &_Dx)
Definition: random:133
void _Init(_Ty _K0, double _P0)
Definition: random:5372
param_type _Par
Definition: random:5481
template<class _Ty = int>
template<class _Elem , class _Traits >
basic_ostream<_Elem, _Traits>& negative_binomial_distribution< _Ty >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr) const
inline
5462  { // write state to _Ostr
5463  _Out(_Ostr, _Par._Px);
5464  _Out(_Ostr, _Par._Kx);
5465  return (_Ostr);
5466  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:151
double _Px
Definition: random:5385
param_type _Par
Definition: random:5481
template<class _Ty = int>
_Ty negative_binomial_distribution< _Ty >::k ( ) const
inline
5400  { // return k value
5401  return (_Par.k());
5402  }
_Ty k() const
Definition: random:5362
param_type _Par
Definition: random:5481
template<class _Ty = int>
result_type() negative_binomial_distribution< _Ty >::max ( ) const
inline
5425  { // get largest possible result
5426  return ((numeric_limits<result_type>::max)());
5427  }
Definition: limits:101
template<class _Ty = int>
result_type() negative_binomial_distribution< _Ty >::min ( ) const
inline
5420  { // get smallest possible result
5421  return (0);
5422  }
template<class _Ty = int>
template<class _Engine >
result_type negative_binomial_distribution< _Ty >::operator() ( _Engine &  _Eng) const
inline
5435  { // return next value
5436  return (_Eval(_Eng, _Par));
5437  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:5470
param_type _Par
Definition: random:5481
template<class _Ty = int>
template<class _Engine >
result_type negative_binomial_distribution< _Ty >::operator() ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
5441  { // return next value, given parameter package
5442  return (_Eval(_Eng, _Par0));
5443  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:5470
template<class _Ty = int>
double negative_binomial_distribution< _Ty >::p ( ) const
inline
5405  { // return probability
5406  return (_Par.p());
5407  }
double p() const
Definition: random:5367
param_type _Par
Definition: random:5481
template<class _Ty = int>
param_type negative_binomial_distribution< _Ty >::param ( ) const
inline
5410  { // return parameter package
5411  return (_Par);
5412  }
param_type _Par
Definition: random:5481
template<class _Ty = int>
void negative_binomial_distribution< _Ty >::param ( const param_type _Par0)
inline
5415  { // set parameter package
5416  _Par = _Par0;
5417  }
param_type _Par
Definition: random:5481
template<class _Ty = int>
void negative_binomial_distribution< _Ty >::reset ( )
inline
5430  { // clear internal state
5431  }

Member Data Documentation

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

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