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
subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx > Class Template Reference
Inheritance diagram for subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >:
subtract_with_carry< _Ty,(_Ty(1)<< (_Wx-1))<< 1, _Sx, _Rx > _Swc_base< _Ty, _Sx, _Rx, _Swc_traits< _Ty, _Mx, _Rx > > _Circ_buf< _Ty, _Rx >

Public Types

typedef subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx > _Myt
 
typedef subtract_with_carry< _Ty, _Mx, _Sx, _Rx > _Mybase
 
typedef _Mybase::_Traits _Traits
 
typedef _Ty result_type
 
- Public Types inherited from subtract_with_carry< _Ty,(_Ty(1)<< (_Wx-1))<< 1, _Sx, _Rx >
typedef subtract_with_carry< _Ty, _Mx, _Sx, _Rx > _Myt
 
typedef _Swc_base< _Ty, _Sx, _Rx, _Swc_traits< _Ty, _Mx, _Rx > > _Mybase
 
- Public Types inherited from _Swc_base< _Ty, _Sx, _Rx, _Swc_traits< _Ty, _Mx, _Rx > >
typedef _Ty result_type
 
typedef _Swc_traits< _Ty, _Mx, _Rx > _Traits
 
typedef _Circ_buf< _Ty, _Rx > _Mybase
 
typedef _Swc_traits< _Ty, _Mx, _Rx >::_Seed_t _Seed_t
 

Public Member Functions

 subtract_with_carry_engine (_Ty _X0=default_seed)
 
 subtract_with_carry_engine (const _Myt &_Right)
 
 subtract_with_carry_engine (_Myt &_Right)
 
template<class _Seed_seq , class = typename enable_if< !is_convertible<_Seed_seq, _Ty>::value, void>::type>
 subtract_with_carry_engine (_Seed_seq &_Seq)
 
void seed (unsigned long _Value=19780503U)
 
template<class _Seed_seq >
enable_if< !is_convertible< _Seed_seq, _Ty >::value, void >::type seed (_Seed_seq &_Seq)
 
- Public Member Functions inherited from subtract_with_carry< _Ty,(_Ty(1)<< (_Wx-1))<< 1, _Sx, _Rx >
 subtract_with_carry (_Ty _X0=default_seed)
 
 subtract_with_carry (const _Myt &_Right)
 
 subtract_with_carry (_Myt &_Right)
 
 subtract_with_carry (_Gen &_Gx)
 
- Public Member Functions inherited from _Swc_base< _Ty, _Sx, _Rx, _Swc_traits< _Ty, _Mx, _Rx > >
 _Swc_base ()
 
 _Swc_base (typename _Swc_traits< _Ty, _Mx, _Rx >::_Seed_t _X0)
 
 _Swc_base (_Gen &_Gx)
 
void seed (unsigned long _Value=19780503U)
 
void seed (_Gen &_Gx, bool _Readcy=false)
 
result_type() min () const
 
result_type() max () const
 
result_type operator() ()
 
void discard (unsigned long long _Nskip)
 
bool _Equals (const _Swc_base &_Right) const
 
basic_ostream< _Elem, _Traits > & _Write (basic_ostream< _Elem, _Traits > &_Ostr) const
 
- Public Member Functions inherited from _Circ_buf< _Ty, _Rx >
_Ty _At (int _Ix) const
 
bool _Equals (const _Circ_buf &_Right) const
 
unsigned int _Base (int _Ix=0) const
 

Static Public Member Functions

static _Ty() min ()
 
static _Ty() max ()
 

Static Public Attributes

static const _Ty _Mx = (_Ty(1) << (_Wx - 1)) << 1
 
static const size_t word_size = _Wx
 
static const size_t short_lag = _Sx
 
static const size_t long_lag = _Rx
 
static const _Ty default_seed = 19780503U
 
static const int _Kx = (_BITS_BYTE * sizeof (_Ty) + 31) / 32
 
- Static Public Attributes inherited from subtract_with_carry< _Ty,(_Ty(1)<< (_Wx-1))<< 1, _Sx, _Rx >
static const _Ty modulus
 
static const _Ty default_seed
 
- Static Public Attributes inherited from _Swc_base< _Ty, _Sx, _Rx, _Swc_traits< _Ty, _Mx, _Rx > >
static const size_t short_lag
 
static const size_t long_lag
 

Additional Inherited Members

- Public Attributes inherited from _Circ_buf< _Ty, _Rx >
unsigned int _Idx
 
_Ty _Ax [2 *_Nw]
 
- Protected Member Functions inherited from _Swc_base< _Ty, _Sx, _Rx, _Swc_traits< _Ty, _Mx, _Rx > >
void _Seed (_Gen &_Gx, bool _Readcy, const true_type &)
 
void _Seed (_Gen &_Gx, bool _Readcy, const false_type &)
 
void _Reset (_Gen &_Gx, bool _Readcy)
 
void _Setx (int _Ix, _Ty _First, _Ty _Second)
 
- Protected Attributes inherited from _Swc_base< _Ty, _Sx, _Rx, _Swc_traits< _Ty, _Mx, _Rx > >
_Swc_traits< _Ty, _Mx, _Rx >::_Cy_t _Carry
 

Member Typedef Documentation

template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
typedef subtract_with_carry<_Ty, _Mx, _Sx, _Rx> subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::_Mybase
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
typedef subtract_with_carry_engine<_Ty, _Wx, _Sx, _Rx> subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::_Myt
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
typedef _Mybase::_Traits subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::_Traits
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
typedef _Ty subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::result_type

Constructor & Destructor Documentation

template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::subtract_with_carry_engine ( _Ty  _X0 = default_seed)
inlineexplicit
1110  : _Mybase(_X0)
1111  { // construct with default seed
1112  }
subtract_with_carry< _Ty, _Mx, _Sx, _Rx > _Mybase
Definition: random:1103
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::subtract_with_carry_engine ( const _Myt _Right)
inline
1115  { // construct by copying
1116  *this = _Right;
1117  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::subtract_with_carry_engine ( _Myt _Right)
inline
1120  { // construct by copying
1121  *this = _Right;
1122  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
template<class _Seed_seq , class = typename enable_if< !is_convertible<_Seed_seq, _Ty>::value, void>::type>
subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::subtract_with_carry_engine ( _Seed_seq &  _Seq)
inlineexplicit
1129  { // construct from seed sequence
1130  seed(_Seq);
1131  }
void seed(unsigned long _Value=19780503U)
Definition: random:1133

Member Function Documentation

template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
static _Ty() subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::max ( )
inlinestatic
1169  { // return maximum possible generated value
1170  return (_Mx - 1);
1171  }
static const _Ty _Mx
Definition: random:1098
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
static _Ty() subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::min ( )
inlinestatic
1164  { // return minimum possible generated value
1165  return (0);
1166  }
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
void subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::seed ( unsigned long  _Value = 19780503U)
inline
1134  { // set initial values from specified seed value
1135  this->_Seed(_Value, false, true_type());
1136  }
void _Seed(_Gen &_Gx, bool _Readcy, const true_type &)
Definition: random:871
_CRTIMP _In_ int _Value
Definition: setjmp.h:190
integral_constant< bool, true > true_type
Definition: xtr1common:47
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
template<class _Seed_seq >
enable_if< !is_convertible<_Seed_seq, _Ty>::value, void>::type subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::seed ( _Seed_seq &  _Seq)
inline
1145  { // reset sequence from seed sequence
1146  unsigned long _Arr[_Kx * _Rx];
1147  _Seq.generate(&_Arr[0], &_Arr[_Kx * _Rx]);
1148 
1149  int _Idx0 = 0;
1150  for (int _Ix = 0; _Ix < _Rx; ++_Ix, _Idx0 += _Kx)
1151  { // pack _Kx words
1152  this->_Ax[_Ix] = _Arr[_Idx0];
1153  for (int _Jx = 0; ++_Jx < _Kx; )
1154  this->_Ax[_Ix] |= (_Ty)_Arr[_Idx0 + _Jx] << (32 * _Jx);
1155 
1156  if (_Traits::_Mod != 0)
1157  this->_Ax[_Ix] %= _Traits::_Mod;
1158  }
1159  this->_Carry = _Traits::_Reduce(this->_Ax);
1160  this->_Idx = _Rx;
1161  }
static _Cy_t _Reduce(_Ty *_Ax)
Definition: random:1018
unsigned int _Idx
Definition: random:777
_Ty _Ax[2 *_Nw]
Definition: random:778
static const _Mod_t _Mod
Definition: random:979
static const int _Kx
Definition: random:1138
_Swc_traits< _Ty, _Mx, _Rx >::_Cy_t _Carry
Definition: random:904

Member Data Documentation

template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
const int subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::_Kx = (_BITS_BYTE * sizeof (_Ty) + 31) / 32
static
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
const _Ty subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::_Mx = (_Ty(1) << (_Wx - 1)) << 1
static
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
const _Ty subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::default_seed = 19780503U
static
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
const size_t subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::long_lag = _Rx
static
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
const size_t subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::short_lag = _Sx
static
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
const size_t subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::word_size = _Wx
static

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