STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
piecewise_constant_distribution< _Ty > Class Template Reference
Inheritance diagram for piecewise_constant_distribution< _Ty >:
discrete_distribution< size_t >

Classes

struct  param_type
 

Public Types

typedef piecewise_constant_distribution< _Ty > _Myt
 
typedef discrete_distribution< size_t_Mybase
 
typedef _Mybase::param_type _Mypbase
 
typedef _Mypbase::_Noinit _Noinit
 
typedef _Ty result_type
 
- Public Types inherited from discrete_distribution< size_t >
typedef discrete_distribution< size_t_Myt
 
typedef vector< double > _Myvec
 
typedef size_t result_type
 

Public Member Functions

 _RNG_REQUIRE_REALTYPE (piecewise_constant_distribution, _Ty)
 
 piecewise_constant_distribution ()
 
template<class _InIt1 , class _InIt2 >
 piecewise_constant_distribution (_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2)
 
template<class _Fn >
 piecewise_constant_distribution (initializer_list< _Ty > _Ilist, _Fn _Func)
 
template<class _Fn >
 piecewise_constant_distribution (size_t _Count, _Ty _Low, _Ty _High, _Fn _Func)
 
 piecewise_constant_distribution (const param_type &_Par0)
 
vector< _Ty > intervals () const
 
vector< _Ty > densities () 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
 
template<class _Engine >
result_type _Eval (_Engine &_Eng, const param_type &_Par0) const
 
- Public Member Functions inherited from discrete_distribution< size_t >
 _RNG_REQUIRE_INTTYPE (discrete_distribution, size_t)
 
 discrete_distribution ()
 
 discrete_distribution (_InIt _First, _InIt _Last)
 
 discrete_distribution (initializer_list< double > _Ilist)
 
 discrete_distribution (size_t _Count, double _Low, double _High, _Fn _Func)
 
 discrete_distribution (const param_type &_Par0)
 
_Myvec probabilities () const
 
param_type param () const
 
void param (const param_type &_Par0)
 
result_type() min () const
 
result_type() max () const
 
void reset ()
 
result_type operator() (_Engine &_Eng) const
 
result_type operator() (_Engine &_Eng, const param_type &_Par0) const
 
basic_istream< _Elem, _Traits > & _Read (basic_istream< _Elem, _Traits > &_Istr, param_type &_Par0)
 
basic_ostream< _Elem, _Traits > & _Write (basic_ostream< _Elem, _Traits > &_Ostr, const param_type &_Par0) const
 

Public Attributes

param_type _Par
 
- Public Attributes inherited from discrete_distribution< size_t >
param_type _Par
 

Member Typedef Documentation

template<class _Ty = double>
typedef discrete_distribution<size_t> piecewise_constant_distribution< _Ty >::_Mybase
template<class _Ty = double>
typedef _Mybase::param_type piecewise_constant_distribution< _Ty >::_Mypbase
template<class _Ty = double>
typedef piecewise_constant_distribution<_Ty> piecewise_constant_distribution< _Ty >::_Myt
template<class _Ty = double>
typedef _Mypbase::_Noinit piecewise_constant_distribution< _Ty >::_Noinit
template<class _Ty = double>
typedef _Ty piecewise_constant_distribution< _Ty >::result_type

Constructor & Destructor Documentation

template<class _Ty = double>
piecewise_constant_distribution< _Ty >::piecewise_constant_distribution ( )
inline
5917  { // default constructor
5918  }
template<class _Ty = double>
template<class _InIt1 , class _InIt2 >
piecewise_constant_distribution< _Ty >::piecewise_constant_distribution ( _InIt1  _First1,
_InIt1  _Last1,
_InIt2  _First2 
)
inline
5924  : _Par(_First1, _Last1, _First2)
5925  { // construct from [_First1, _Last1) and [_First2, ...)
5926  }
param_type _Par
Definition: random:6030
template<class _Ty = double>
template<class _Fn >
piecewise_constant_distribution< _Ty >::piecewise_constant_distribution ( initializer_list< _Ty >  _Ilist,
_Fn  _Func 
)
inline
5931  : _Par(_Ilist, _Func)
5932  { // construct from _Ilist and function
5933  }
param_type _Par
Definition: random:6030
template<class _Ty = double>
template<class _Fn >
piecewise_constant_distribution< _Ty >::piecewise_constant_distribution ( size_t  _Count,
_Ty  _Low,
_Ty  _High,
_Fn  _Func 
)
inline
5938  : _Par(_Count, _Low, _High, _Func)
5939  { // construct from value range and function
5940  }
param_type _Par
Definition: random:6030
_Diff _Count
Definition: algorithm:1941
template<class _Ty = double>
piecewise_constant_distribution< _Ty >::piecewise_constant_distribution ( const param_type _Par0)
inlineexplicit
5943  : _Par(_Par0)
5944  { // construct from parameter package
5945  }
param_type _Par
Definition: random:6030

Member Function Documentation

template<class _Ty = double>
template<class _Engine >
result_type piecewise_constant_distribution< _Ty >::_Eval ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
6024  { // return next value
6025  size_t _Px = (*(_Mybase *)this)(_Eng, _Par0);
6026  uniform_real<_Ty> _Dist(_Par0._Bvec[_Px], _Par0._Bvec[_Px + 1]);
6027  return (_Dist(_Eng));
6028  }
discrete_distribution< size_t > _Mybase
Definition: random:5816
Definition: random:3241
template<class _Ty = double>
template<class _Elem , class _Traits >
basic_istream<_Elem, _Traits>& piecewise_constant_distribution< _Ty >::_Read ( basic_istream< _Elem, _Traits > &  _Istr)
inline
5997  { // read state from _Istr
5998  _Mybase::_Read(_Istr, _Par);
5999 
6000  _Par._Bvec.clear();
6001  for (size_t _Idx = _Par._Pvec.size() + 1; 0 < _Idx; --_Idx)
6002  { // get a value and add to intervals vector
6003  double _Val;
6004  _In(_Istr, _Val);
6005  _Par._Bvec.push_back(_Val);
6006  }
6007  return (_Istr);
6008  }
vector< _Ty > _Bvec
Definition: random:5913
param_type _Par
Definition: random:6030
size_type size() const _NOEXCEPT
Definition: vector:1708
void clear() _NOEXCEPT
Definition: vector:1613
basic_istream< _Elem, _Traits > & _In(basic_istream< _Elem, _Traits > &_Is, _Ty &_Dx)
Definition: random:156
_Myvec _Pvec
Definition: random:5640
basic_istream< _Elem, _Traits > & _Read(basic_istream< _Elem, _Traits > &_Istr, param_type &_Par0)
Definition: random:5714
void push_back(const _Ty &_Val)
Definition: vector:945
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty = double>
piecewise_constant_distribution< _Ty >::_RNG_REQUIRE_REALTYPE ( piecewise_constant_distribution< _Ty >  ,
_Ty   
)
template<class _Ty = double>
template<class _Elem , class _Traits >
basic_ostream<_Elem, _Traits>& piecewise_constant_distribution< _Ty >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr) const
inline
6014  { // write state to _Ostr
6015  _Mybase::_Write(_Ostr, _Par);
6016 
6017  for (size_t _Idx = 0; _Idx < _Par._Bvec.size(); ++_Idx)
6018  _Out(_Ostr, _Par._Bvec[_Idx]);
6019  return (_Ostr);
6020  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:174
vector< _Ty > _Bvec
Definition: random:5913
param_type _Par
Definition: random:6030
size_type size() const _NOEXCEPT
Definition: vector:1708
basic_ostream< _Elem, _Traits > & _Write(basic_ostream< _Elem, _Traits > &_Ostr, const param_type &_Par0) const
Definition: random:5733
template<class _Ty = double>
vector<_Ty> piecewise_constant_distribution< _Ty >::densities ( ) const
inline
5953  { // return densities vector
5954  return (_Par.densities());
5955  }
param_type _Par
Definition: random:6030
vector< _Ty > densities() const
Definition: random:5898
template<class _Ty = double>
vector<_Ty> piecewise_constant_distribution< _Ty >::intervals ( ) const
inline
5948  { // return intervals vector
5949  return (_Par.intervals());
5950  }
param_type _Par
Definition: random:6030
vector< _Ty > intervals() const
Definition: random:5893
template<class _Ty = double>
result_type() piecewise_constant_distribution< _Ty >::max ( ) const
inline
5973  { // return maximum possible generated value
5974  return (_Par._Bvec.back());
5975  }
vector< _Ty > _Bvec
Definition: random:5913
param_type _Par
Definition: random:6030
_Ty & back()
Definition: vector:1811
template<class _Ty = double>
result_type() piecewise_constant_distribution< _Ty >::min ( ) const
inline
5968  { // return minimum possible generated value
5969  return (_Par._Bvec.front());
5970  }
vector< _Ty > _Bvec
Definition: random:5913
param_type _Par
Definition: random:6030
_Ty & front()
Definition: vector:1783
template<class _Ty = double>
template<class _Engine >
result_type piecewise_constant_distribution< _Ty >::operator() ( _Engine &  _Eng) const
inline
5983  { // return next value
5984  return (_Eval(_Eng, _Par));
5985  }
param_type _Par
Definition: random:6030
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:6023
template<class _Ty = double>
template<class _Engine >
result_type piecewise_constant_distribution< _Ty >::operator() ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
5989  { // return next value, given parameter package
5990  return (_Eval(_Eng, _Par0));
5991  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:6023
template<class _Ty = double>
param_type piecewise_constant_distribution< _Ty >::param ( ) const
inline
5958  { // return parameter package
5959  return (_Par);
5960  }
param_type _Par
Definition: random:6030
template<class _Ty = double>
void piecewise_constant_distribution< _Ty >::param ( const param_type _Par0)
inline
5963  { // set parameter package
5964  _Par = _Par0;
5965  }
param_type _Par
Definition: random:6030
template<class _Ty = double>
void piecewise_constant_distribution< _Ty >::reset ( )
inline
5978  { // clear internal state
5979  }

Member Data Documentation

template<class _Ty = double>
param_type piecewise_constant_distribution< _Ty >::_Par

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