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

 piecewise_constant_distribution ()
 
template<class _InIt1 , class _Init2 >
 piecewise_constant_distribution (_InIt1 _First1, _InIt1 _Last1, _Init2 _First2)
 
template<class _Fn >
 piecewise_constant_distribution (_XSTD 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 >
 discrete_distribution ()
 
 discrete_distribution (_XSTD 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
6014  { // default constructor
6015  }
template<class _Ty = double>
template<class _InIt1 , class _Init2 >
piecewise_constant_distribution< _Ty >::piecewise_constant_distribution ( _InIt1  _First1,
_InIt1  _Last1,
_Init2  _First2 
)
inline
6021  : _Par(_First1, _Last1, _First2)
6022  { // construct from [_First1, _Last1) and [_First2, ...)
6023  }
param_type _Par
Definition: random:6127
template<class _Ty = double>
template<class _Fn >
piecewise_constant_distribution< _Ty >::piecewise_constant_distribution ( _XSTD initializer_list< _Ty >  _Ilist,
_Fn  _Func 
)
inline
6028  : _Par(_Ilist, _Func)
6029  { // construct from _Ilist and function
6030  }
param_type _Par
Definition: random:6127
template<class _Ty = double>
template<class _Fn >
piecewise_constant_distribution< _Ty >::piecewise_constant_distribution ( size_t  _Count,
_Ty  _Low,
_Ty  _High,
_Fn  _Func 
)
inline
6035  : _Par(_Count, _Low, _High, _Func)
6036  { // construct from value range and function
6037  }
param_type _Par
Definition: random:6127
_Diff _Count
Definition: algorithm:1941
template<class _Ty = double>
piecewise_constant_distribution< _Ty >::piecewise_constant_distribution ( const param_type _Par0)
inlineexplicit
6040  : _Par(_Par0)
6041  { // construct from parameter package
6042  }
param_type _Par
Definition: random:6127

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
6121  { // return next value
6122  size_t _Px = (*(_Mybase *)this)(_Eng, _Par0);
6123  uniform_real<_Ty> _Dist(_Par0._Bvec[_Px], _Par0._Bvec[_Px + 1]);
6124  return (_Dist(_Eng));
6125  }
discrete_distribution< size_t > _Mybase
Definition: random:5914
Definition: random:3520
template<class _Ty = double>
template<class _Elem , class _Traits >
basic_istream<_Elem, _Traits>& piecewise_constant_distribution< _Ty >::_Read ( basic_istream< _Elem, _Traits > &  _Istr)
inline
6094  { // read state from _Istr
6095  _Mybase::_Read(_Istr, _Par);
6096 
6097  _Par._Bvec.clear();
6098  for (size_t _Idx = _Par._Pvec.size() + 1; 0 < _Idx; --_Idx)
6099  { // get a value and add to intervals vector
6100  double _Val;
6101  _In(_Istr, _Val);
6102  _Par._Bvec.push_back(_Val);
6103  }
6104  return (_Istr);
6105  }
vector< _Ty > _Bvec
Definition: random:6010
param_type _Par
Definition: random:6127
size_type size() const _NOEXCEPT
Definition: vector:1146
void clear() _NOEXCEPT
Definition: vector:1506
basic_istream< _Elem, _Traits > & _In(basic_istream< _Elem, _Traits > &_Is, _Ty &_Dx)
Definition: random:151
void push_back(value_type &&_Val)
Definition: vector:864
_Myvec _Pvec
Definition: random:5757
basic_istream< _Elem, _Traits > & _Read(basic_istream< _Elem, _Traits > &_Istr, param_type &_Par0)
Definition: random:5825
_FwdIt const _Ty _Val
Definition: algorithm:1938
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
6111  { // write state to _Ostr
6112  _Mybase::_Write(_Ostr, _Par);
6113 
6114  for (size_t _Idx = 0; _Idx < _Par._Bvec.size(); ++_Idx)
6115  _Out(_Ostr, _Par._Bvec[_Idx]);
6116  return (_Ostr);
6117  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:169
vector< _Ty > _Bvec
Definition: random:6010
param_type _Par
Definition: random:6127
size_type size() const _NOEXCEPT
Definition: vector:1146
basic_ostream< _Elem, _Traits > & _Write(basic_ostream< _Elem, _Traits > &_Ostr, const param_type &_Par0) const
Definition: random:5844
template<class _Ty = double>
vector<_Ty> piecewise_constant_distribution< _Ty >::densities ( ) const
inline
6050  { // return densities vector
6051  return (_Par.densities());
6052  }
param_type _Par
Definition: random:6127
vector< _Ty > densities() const
Definition: random:5996
template<class _Ty = double>
vector<_Ty> piecewise_constant_distribution< _Ty >::intervals ( ) const
inline
6045  { // return intervals vector
6046  return (_Par.intervals());
6047  }
param_type _Par
Definition: random:6127
vector< _Ty > intervals() const
Definition: random:5991
template<class _Ty = double>
result_type() piecewise_constant_distribution< _Ty >::max ( ) const
inline
6070  { // return maximum possible generated value
6071  return (_Par._Bvec.back());
6072  }
reference back()
Definition: vector:1232
vector< _Ty > _Bvec
Definition: random:6010
param_type _Par
Definition: random:6127
template<class _Ty = double>
result_type() piecewise_constant_distribution< _Ty >::min ( ) const
inline
6065  { // return minimum possible generated value
6066  return (_Par._Bvec.front());
6067  }
vector< _Ty > _Bvec
Definition: random:6010
param_type _Par
Definition: random:6127
reference front()
Definition: vector:1222
template<class _Ty = double>
template<class _Engine >
result_type piecewise_constant_distribution< _Ty >::operator() ( _Engine &  _Eng) const
inline
6080  { // return next value
6081  return (_Eval(_Eng, _Par));
6082  }
param_type _Par
Definition: random:6127
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:6120
template<class _Ty = double>
template<class _Engine >
result_type piecewise_constant_distribution< _Ty >::operator() ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
6086  { // return next value, given parameter package
6087  return (_Eval(_Eng, _Par0));
6088  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:6120
template<class _Ty = double>
param_type piecewise_constant_distribution< _Ty >::param ( ) const
inline
6055  { // return parameter package
6056  return (_Par);
6057  }
param_type _Par
Definition: random:6127
template<class _Ty = double>
void piecewise_constant_distribution< _Ty >::param ( const param_type _Par0)
inline
6060  { // set parameter package
6061  _Par = _Par0;
6062  }
param_type _Par
Definition: random:6127
template<class _Ty = double>
void piecewise_constant_distribution< _Ty >::reset ( )
inline
6075  { // clear internal state
6076  }

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: