STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
linear_congruential_engine< _Uint, _Ax, _Cx, _Mx > Class Template Reference
Inheritance diagram for linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >:
linear_congruential< _Uint, _Ax, _Cx, _Mx >

Public Types

typedef linear_congruential_engine< _Uint, _Ax, _Cx, _Mx > _Myt
 
typedef linear_congruential< _Uint, _Ax, _Cx, _Mx > _Mybase
 
- Public Types inherited from linear_congruential< _Uint, _Ax, _Cx, _Mx >
typedef linear_congruential< _Uint, _Ax, _Cx, _Mx > _Myt
 
typedef _Uint result_type
 

Public Member Functions

 linear_congruential_engine (_Uint _X0=_Mybase::default_seed)
 
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt>::type>
 linear_congruential_engine (_Seed_seq &_Seq)
 
void seed (_Uint _X0=_Mybase::default_seed)
 
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt>::type>
void seed (_Seed_seq &_Seq)
 
- Public Member Functions inherited from linear_congruential< _Uint, _Ax, _Cx, _Mx >
 linear_congruential (_Uint _X0=default_seed)
 
template<class _Gen , class = typename _Enable_if_seed_seq<_Gen, _Myt>::type>
 linear_congruential (_Gen &_Gx)
 
void seed (_Uint _X0=default_seed)
 
template<class _Gen >
void seed (_Gen &_Gx, bool=false)
 
_Uint() min () const
 
_Uint() max () const
 
_Uint operator() ()
 
void discard (unsigned long long _Nskip)
 
bool _Equals (const _Myt &_Right) const
 
template<class _Elem , class _Traits >
basic_ostream< _Elem, _Traits > & _Write (basic_ostream< _Elem, _Traits > &_Ostr) const
 

Static Public Member Functions

static constexpr _Uint() min ()
 
static constexpr _Uint() max ()
 

Static Public Attributes

static constexpr int _Nw = (_BITS_BYTE * sizeof (_Uint) + 31) / 32
 
- Static Public Attributes inherited from linear_congruential< _Uint, _Ax, _Cx, _Mx >
static constexpr _Uint multiplier = _Ax
 
static constexpr _Uint increment = _Cx
 
static constexpr _Uint modulus = _Mx
 
static constexpr _Uint default_seed = 1U
 

Additional Inherited Members

- Protected Member Functions inherited from linear_congruential< _Uint, _Ax, _Cx, _Mx >
template<class _Gen >
void _Seed (_Gen &_Gx, true_type)
 
template<class _Gen >
void _Seed (_Gen &_Gx, false_type)
 
void _Reset (_Uint _X0)
 
- Protected Attributes inherited from linear_congruential< _Uint, _Ax, _Cx, _Mx >
_Select< _Uint, _Ax, _Cx, _Mx >::type _Imp
 

Member Typedef Documentation

template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
typedef linear_congruential<_Uint, _Ax, _Cx, _Mx> linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::_Mybase
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
typedef linear_congruential_engine<_Uint, _Ax, _Cx, _Mx> linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::_Myt

Constructor & Destructor Documentation

template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::linear_congruential_engine ( _Uint  _X0 = _Mybase::default_seed)
inlineexplicit
627  : linear_congruential<_Uint, _Ax, _Cx, _Mx>(_X0) // TRANSITION, VSO#184864
628  { // construct from initial value
629  }
Definition: random:465
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt>::type>
linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::linear_congruential_engine ( _Seed_seq &  _Seq)
inlineexplicit
634  : linear_congruential<_Uint, _Ax, _Cx, _Mx>() // TRANSITION, VSO#184864
635  { // construct from seed sequence
636  seed(_Seq);
637  }
Definition: random:465
void seed(_Uint _X0=_Mybase::default_seed)
Definition: random:639

Member Function Documentation

template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
static constexpr _Uint() linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::max ( )
inlinestatic
666  { // return maximum possible generated value
667  return (_Mx != 0 ? _Mx - 1 : (numeric_limits<_Uint>::max)());
668  }
Definition: limits:101
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
static constexpr _Uint() linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::min ( )
inlinestatic
661  { // return minimum possible generated value
662  return (_Cx != 0 ? 0 : 1);
663  }
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
void linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::seed ( _Uint  _X0 = _Mybase::default_seed)
inline
640  { // reset sequence from numeric value
641  this->_Reset(_X0);
642  }
void _Reset(_Uint _X0)
Definition: random:549
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt>::type>
void linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::seed ( _Seed_seq &  _Seq)
inline
649  { // reset sequence from seed sequence
650  _Uint _Arr[3 + _Nw];
651  int _Lsh = _BITS_BYTE * sizeof (_Uint); // to quiet diagnostics
652 
653  _Seq.generate(&_Arr[0], &_Arr[3 + _Nw]);
654  for (int _Idx = _Nw; 0 < --_Idx; )
655  _Arr[3 + _Idx - 1] |=
656  _Arr[3 + _Idx] << _Lsh;
657  this->_Reset(_Arr[3]);
658  }
void _Reset(_Uint _X0)
Definition: random:549
#define _BITS_BYTE
Definition: random:19
static constexpr int _Nw
Definition: random:644

Member Data Documentation

template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
constexpr int linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::_Nw = (_BITS_BYTE * sizeof (_Uint) + 31) / 32
static

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