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)
 
 linear_congruential_engine (const _Myt &_Right)
 
 linear_congruential_engine (_Myt &_Right)
 
template<class _Seed_seq , class = typename enable_if< !is_convertible<_Seed_seq, _Uint>::value, void>:: type>
 linear_congruential_engine (_Seed_seq &_Seq)
 
void seed (_Uint _X0=_Mybase::default_seed)
 
template<class _Seed_seq >
enable_if< !is_convertible< _Seed_seq, _Uint >::value, void >::type seed (_Seed_seq &_Seq)
 
- Public Member Functions inherited from linear_congruential< _Uint, _Ax, _Cx, _Mx >
 linear_congruential (_Uint _X0=default_seed)
 
 linear_congruential (const linear_congruential &_Right)
 
 linear_congruential (linear_congruential &_Right)
 
template<class _Gen >
 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 _Uint() min ()
 
static _Uint() max ()
 

Static Public Attributes

static const int _Nw = (_BITS_BYTE * sizeof (_Uint) + 31) / 32
 
- Static Public Attributes inherited from linear_congruential< _Uint, _Ax, _Cx, _Mx >
static const _Uint multiplier = _Ax
 
static const _Uint increment = _Cx
 
static const _Uint modulus = _Mx
 
static const _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, const true_type &)
 
template<class _Gen >
void _Seed (_Gen &_Gx, const 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
660  : _Mybase(_X0)
661  { // construct from initial value
662  }
linear_congruential< _Uint, _Ax, _Cx, _Mx > _Mybase
Definition: random:657
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::linear_congruential_engine ( const _Myt _Right)
inline
665  { // construct by copying
666  *this = _Right;
667  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::linear_congruential_engine ( _Myt _Right)
inline
670  { // construct by copying
671  *this = _Right;
672  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
template<class _Seed_seq , class = typename enable_if< !is_convertible<_Seed_seq, _Uint>::value, void>:: type>
linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::linear_congruential_engine ( _Seed_seq &  _Seq)
inlineexplicit
679  { // construct from seed sequence
680  seed(_Seq);
681  }
void seed(_Uint _X0=_Mybase::default_seed)
Definition: random:683

Member Function Documentation

template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
static _Uint() linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::max ( )
inlinestatic
712  { // return maximum possible generated value
713  return (_Mx != 0 ? _Mx - 1 : (numeric_limits<_Uint>::max)());
714  }
Definition: limits:79
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
static _Uint() linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::min ( )
inlinestatic
707  { // return minimum possible generated value
708  return (_Cx != 0 ? 0 : 1);
709  }
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
void linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::seed ( _Uint  _X0 = _Mybase::default_seed)
inline
684  { // reset sequence from numeric value
685  this->_Reset(_X0);
686  }
void _Reset(_Uint _X0)
Definition: random:581
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
template<class _Seed_seq >
enable_if< !is_convertible<_Seed_seq, _Uint>::value, void>::type linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::seed ( _Seed_seq &  _Seq)
inline
695  { // reset sequence from seed sequence
696  _Uint _Arr[3 + _Nw];
697  int _Lsh = _BITS_BYTE * sizeof (_Uint); // to quiet diagnostics
698 
699  _Seq.generate(&_Arr[0], &_Arr[3 + _Nw]);
700  for (int _Idx = _Nw; 0 < --_Idx; )
701  _Arr[3 + _Idx - 1] |=
702  _Arr[3 + _Idx] << _Lsh;
703  this->_Reset(_Arr[3]);
704  }
void _Reset(_Uint _X0)
Definition: random:581
static const int _Nw
Definition: random:688
#define _BITS_BYTE
Definition: random:19

Member Data Documentation

template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
const 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: