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 _Swc_base< _Ty, _Sx, _Rx, _Swc_traits< _Ty, _Mx, _Rx > > _Myt
 
typedef _Circ_buf< _Ty, _Rx > _Mybase
 
typedef _Swc_traits< _Ty, _Mx, _Rx >::_Seed_t _Seed_t
 

Public Member Functions

 _RNG_REQUIRE_UINTTYPE (subtract_with_carry_engine, _Ty)
 
 subtract_with_carry_engine (_Ty _X0=default_seed)
 
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt>::type>
 subtract_with_carry_engine (_Seed_seq &_Seq)
 
void seed (_Ty _Value=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 subtract_with_carry< _Ty,(_Ty(1)<< (_Wx-1))<< 1, _Sx, _Rx >
 subtract_with_carry (_Ty _X0=default_seed)
 
 subtract_with_carry (_Gen &_Gx)
 
- Public Member Functions inherited from _Swc_base< _Ty, _Sx, _Rx, _Swc_traits< _Ty, _Mx, _Rx > >
 _Swc_base ()
 
 _Swc_base (_Seed_t _X0)
 
 _Swc_base (_Gen &_Gx)
 
void seed (_Seed_t _Value=default_seed)
 
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 constexpr _Ty() min ()
 
static constexpr _Ty() max ()
 

Static Public Attributes

static constexpr _Ty _Mx = (_Ty(1) << (_Wx - 1)) << 1
 
static constexpr size_t word_size = _Wx
 
static constexpr size_t short_lag = _Sx
 
static constexpr size_t long_lag = _Rx
 
static constexpr 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 constexpr _Ty modulus
 
- Static Public Attributes inherited from _Swc_base< _Ty, _Sx, _Rx, _Swc_traits< _Ty, _Mx, _Rx > >
static constexpr size_t short_lag
 
static constexpr size_t long_lag
 
static constexpr _Seed_t default_seed
 

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, true_type)
 
void _Seed (_Gen &_Gx, bool _Readcy, false_type)
 
void _Reset (_Gen &_Gx, bool _Readcy)
 
void _Setx (int _Ix, _Ty _Xis, _Ty _Xir)
 
- 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
1103  : _Mybase(_X0)
1104  { // construct with default seed
1105  }
subtract_with_carry< _Ty, _Mx, _Sx, _Rx > _Mybase
Definition: random:1096
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt>::type>
subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::subtract_with_carry_engine ( _Seed_seq &  _Seq)
inlineexplicit
1110  : _Mybase()
1111  { // construct from seed sequence
1112  seed(_Seq);
1113  }
subtract_with_carry< _Ty, _Mx, _Sx, _Rx > _Mybase
Definition: random:1096
void seed(_Ty _Value=default_seed)
Definition: random:1115

Member Function Documentation

template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::_RNG_REQUIRE_UINTTYPE ( subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >  ,
_Ty   
)
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
static constexpr _Ty() subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::max ( )
inlinestatic
1149  { // return maximum possible generated value
1150  return (_Mx - 1);
1151  }
static constexpr _Ty _Mx
Definition: random:1091
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
static constexpr _Ty() subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::min ( )
inlinestatic
1144  { // return minimum possible generated value
1145  return (0);
1146  }
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
void subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::seed ( _Ty  _Value = default_seed)
inline
1116  { // set initial values from specified seed value
1117  this->_Seed(_Value, false, true_type());
1118  }
void _Seed(_Gen &_Gx, bool _Readcy, true_type)
Definition: random:852
_In_ _Value
Definition: corecrt_wstdlib.h:65
integral_constant< bool, true > true_type
Definition: xtr1common:41
template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt>::type>
void subtract_with_carry_engine< _Ty, _Wx, _Sx, _Rx >::seed ( _Seed_seq &  _Seq)
inline
1125  { // reset sequence from seed sequence
1126  unsigned long _Arr[_Kx * _Rx];
1127  _Seq.generate(&_Arr[0], &_Arr[_Kx * _Rx]);
1128 
1129  int _Idx0 = 0;
1130  for (int _Ix = 0; _Ix < _Rx; ++_Ix, _Idx0 += _Kx)
1131  { // pack _Kx words
1132  this->_Ax[_Ix] = _Arr[_Idx0];
1133  for (int _Jx = 0; ++_Jx < _Kx; )
1134  this->_Ax[_Ix] |= (_Ty)_Arr[_Idx0 + _Jx] << (32 * _Jx);
1135 
1136  if (_Traits::_Mod != 0)
1137  this->_Ax[_Ix] %= _Traits::_Mod;
1138  }
1139  this->_Carry = _Traits::_Reduce(this->_Ax);
1140  this->_Idx = _Rx;
1141  }
static _Cy_t _Reduce(_Ty *_Ax)
Definition: random:1018
unsigned int _Idx
Definition: random:754
_Ty _Ax[2 *_Nw]
Definition: random:755
static constexpr int _Kx
Definition: random:1120
static constexpr _Mod_t _Mod
Definition: random:968
_Swc_traits< _Ty, _Mx, _Rx >::_Cy_t _Carry
Definition: random:892

Member Data Documentation

template<class _Ty , size_t _Wx, size_t _Sx, size_t _Rx>
constexpr 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>
constexpr _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>
constexpr 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>
constexpr 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>
constexpr 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: