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

 _RNG_REQUIRE_UINTTYPE (linear_congruential_engine, _Uint)
 
 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
650  : _Mybase(_X0)
651  { // construct from initial value
652  }
linear_congruential< _Uint, _Ax, _Cx, _Mx > _Mybase
Definition: random:647
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
657  : _Mybase()
658  { // construct from seed sequence
659  seed(_Seq);
660  }
linear_congruential< _Uint, _Ax, _Cx, _Mx > _Mybase
Definition: random:647
void seed(_Uint _X0=_Mybase::default_seed)
Definition: random:662

Member Function Documentation

template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::_RNG_REQUIRE_UINTTYPE ( linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >  ,
_Uint   
)
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
static constexpr _Uint() linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::max ( )
inlinestatic
689  { // return maximum possible generated value
690  return (_Mx != 0 ? _Mx - 1 : (numeric_limits<_Uint>::max)());
691  }
Definition: limits:102
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
static constexpr _Uint() linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::min ( )
inlinestatic
684  { // return minimum possible generated value
685  return (_Cx != 0 ? 0 : 1);
686  }
template<class _Uint , _Uint _Ax, _Uint _Cx, _Uint _Mx>
void linear_congruential_engine< _Uint, _Ax, _Cx, _Mx >::seed ( _Uint  _X0 = _Mybase::default_seed)
inline
663  { // reset sequence from numeric value
664  this->_Reset(_X0);
665  }
void _Reset(_Uint _X0)
Definition: random:571
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
672  { // reset sequence from seed sequence
673  _Uint _Arr[3 + _Nw];
674  int _Lsh = _BITS_BYTE * sizeof (_Uint); // to quiet diagnostics
675 
676  _Seq.generate(&_Arr[0], &_Arr[3 + _Nw]);
677  for (int _Idx = _Nw; 0 < --_Idx; )
678  _Arr[3 + _Idx - 1] |=
679  _Arr[3 + _Idx] << _Lsh;
680  this->_Reset(_Arr[3]);
681  }
void _Reset(_Uint _X0)
Definition: random:571
#define _BITS_BYTE
Definition: random:19
static constexpr int _Nw
Definition: random:667

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: