STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Static Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
_Swc_01_traits< _Ty, _Wx, _Rx > Struct Template Reference

Public Types

typedef _Ty _Cy_t
 
typedef _Ty _Mod_t
 
typedef unsigned int _Seed_t
 

Static Public Member Functions

template<class _Gen >
static _Cy_t _Reset (_Gen &_Gx, _Ty *_Ax, bool _Readcy)
 
template<class _Elem , class _Traits >
static void _Write (basic_ostream< _Elem, _Traits > &_Ostr, const _Circ_buf< _Ty, _Rx > &_Buf, _Cy_t _Cy)
 

Static Public Attributes

static const _Cy_t _Cy
 
static const _Mod_t _Mod = 1
 
static const _Ty _Max = 1
 
static const int _Nwords = (_Wx + 31) / 32
 

Static Private Attributes

static const _Ty _Scale1
 
static const unsigned long _Mask
 

Member Typedef Documentation

template<class _Ty , size_t _Wx, size_t _Rx>
typedef _Ty _Swc_01_traits< _Ty, _Wx, _Rx >::_Cy_t
template<class _Ty , size_t _Wx, size_t _Rx>
typedef _Ty _Swc_01_traits< _Ty, _Wx, _Rx >::_Mod_t
template<class _Ty , size_t _Wx, size_t _Rx>
typedef unsigned int _Swc_01_traits< _Ty, _Wx, _Rx >::_Seed_t

Member Function Documentation

template<class _Ty , size_t _Wx, size_t _Rx>
template<class _Gen >
static _Cy_t _Swc_01_traits< _Ty, _Wx, _Rx >::_Reset ( _Gen &  _Gx,
_Ty *  _Ax,
bool  _Readcy 
)
inlinestatic
1191  { // set initial values of _Ax from generator _Gx
1192  // return value of _Cy from range if _Readcy is true,
1193  // otherwise from last value
1194  for (int _Ix = 0; _Ix < _Rx; ++_Ix)
1195  { // read values
1196  _Ty _Factor = 1;
1197  _Ty _Val = 0;
1198  for (int _Jx = 0; _Jx < _Nwords - 1; ++_Jx)
1199  { // read components of value
1200  _Factor /= (_Ty)_Two32;
1201  _Val += _Gx() * _Factor;
1202  }
1203  _Ty _Temp = ((unsigned long)_Gx() & _Mask) / _Scale1;
1204  _Val += (_Temp - (unsigned long)_Temp) * _Factor;
1205  _Ax[_Ix] = _Val;
1206  }
1207  if (!_Readcy)
1208  return (_Ax[_Rx - 1] != 0 ? 0 : _Cy);
1209  else
1210  return (_Gx() == 0 ? 0 : _Cy);
1211  }
static const long double _Two32
Definition: random:64
static const unsigned long _Mask
Definition: random:1237
static const _Ty _Scale1
Definition: random:1236
static const int _Nwords
Definition: random:1187
static const _Cy_t _Cy
Definition: random:1184
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty , size_t _Wx, size_t _Rx>
template<class _Elem , class _Traits >
static void _Swc_01_traits< _Ty, _Wx, _Rx >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr,
const _Circ_buf< _Ty, _Rx > &  _Buf,
_Cy_t  _Cy 
)
inlinestatic
1217  { // write state to _Ostr
1218  for (int _Ix = 0; _Ix < _Rx; ++_Ix)
1219  { // write values
1220  _Ty _Val = _Buf._At(_Ix);
1221  unsigned long _Temp;
1222  for (int _Jx = 0; _Jx < _Nwords - 1; ++_Jx)
1223  { // write components of value
1224  _Val *= (_Ty)_Two32;
1225  _Temp = (unsigned long)_Val;
1226  _Val -= _Temp;
1227  _Ostr << _Temp << ' ';
1228  }
1229  _Temp = (unsigned long)(_Val * _Scale1);
1230  _Ostr << _Temp << ' ';
1231  }
1232  _Ostr << (_Cy ? 1 : 0);
1233  }
static const long double _Two32
Definition: random:64
static const _Ty _Scale1
Definition: random:1236
_Ty _At(int _Ix) const
Definition: random:723
static const int _Nwords
Definition: random:1187
static const _Cy_t _Cy
Definition: random:1184
_FwdIt const _Ty _Val
Definition: algorithm:1938

Member Data Documentation

template<class _Ty , size_t _Wx, size_t _Rx>
const _Swc_01_traits< _Ty, _Wx, _Rx >::_Cy_t _Swc_01_traits< _Ty, _Wx, _Rx >::_Cy
static
Initial value:
template<class _Ty, size_t _Wx, size_t _Rx>
const unsigned long _Swc_01_traits< _Ty, _Wx, _Rx >::_Mask
staticprivate
Initial value:
=
~((~0UL) << (_Wx % 32))
template<class _Ty, size_t _Wx, size_t _Rx>
const _Ty _Swc_01_traits< _Ty, _Wx, _Rx >::_Max = 1
static
template<class _Ty, size_t _Wx, size_t _Rx>
const _Swc_01_traits< _Ty, _Wx, _Rx >::_Mod_t _Swc_01_traits< _Ty, _Wx, _Rx >::_Mod = 1
static
template<class _Ty, size_t _Wx, size_t _Rx>
const int _Swc_01_traits< _Ty, _Wx, _Rx >::_Nwords = (_Wx + 31) / 32
static
template<class _Ty, size_t _Wx, size_t _Rx>
const _Ty _Swc_01_traits< _Ty, _Wx, _Rx >::_Scale1
staticprivate
Initial value:
=
(_Ty)_CSTD ldexp(1.0, _Wx % 32)

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