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

Public Types

typedef int _Cy_t
 
typedef unsigned int _UCy_t
 
typedef _Ty _Mod_t
 
typedef _Ty _Seed_t
 

Static Public Member Functions

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

Static Public Attributes

static constexpr _Cy_t _Cy = 1
 
static constexpr _Mod_t _Mod = _Mx
 
static constexpr _Ty _Max = _Mx - 1
 

Member Typedef Documentation

template<class _Ty, _Ty _Mx, size_t _Nw>
typedef int _Swc_traits< _Ty, _Mx, _Nw >::_Cy_t
template<class _Ty, _Ty _Mx, size_t _Nw>
typedef _Ty _Swc_traits< _Ty, _Mx, _Nw >::_Mod_t
template<class _Ty, _Ty _Mx, size_t _Nw>
typedef _Ty _Swc_traits< _Ty, _Mx, _Nw >::_Seed_t
template<class _Ty, _Ty _Mx, size_t _Nw>
typedef unsigned int _Swc_traits< _Ty, _Mx, _Nw >::_UCy_t

Member Function Documentation

template<class _Ty, _Ty _Mx, size_t _Nw>
static int _Swc_traits< _Ty, _Mx, _Nw >::_Get_wc ( )
inlinestatic
949  { // compute number of 32-bit words per element
950  int _Kx;
951 
952  if (_Mx == 0)
953  _Kx = (_BITS_BYTE * sizeof (_Ty) + 31) / 32;
954  else
955  { // compute number of 32-bit words required
956  _ULonglong _Val = (_ULonglong)1 << 32;
957  for (_Kx = 1; 0 < _Val && _Val < _Mx; ++_Kx)
958  _Val = _Val << 32;
959  }
960  return (_Kx);
961  }
_In_ int _Val
Definition: vcruntime_string.h:62
#define _BITS_BYTE
Definition: random:19
_ULONGLONG _ULonglong
Definition: yvals.h:593
template<class _Ty, _Ty _Mx, size_t _Nw>
static _Cy_t _Swc_traits< _Ty, _Mx, _Nw >::_Reduce ( _Ty *  _Ax)
inlinestatic
987  { // reduce values to allowed range
988  if (_Mx != 0)
989  for (int _Ix = 0; _Ix < _Nw; ++_Ix)
990  _Ax[_Ix] = _Ax[_Ix] % _Mx;
991  return (_Ax[_Nw - 1] == 0);
992  }
template<class _Ty, _Ty _Mx, size_t _Nw>
template<class _Gen >
static _Cy_t _Swc_traits< _Ty, _Mx, _Nw >::_Reset ( _Gen &  _Gx,
_Ty *  _Ax,
bool  _Readcy 
)
inlinestatic
965  { // set initial values of _Ax from generator _Gx
966  // return value of _Cy from range if _Readcy is true,
967  // otherwise compute from last value
968  int _Kx = _Get_wc();
969 
970  for (int _Ix = 0; _Ix < _Nw; ++_Ix)
971  { // pack _Kx words
972  _Ax[_Ix] = _Gx();
973  for (int _Jx = 0; ++_Jx < _Kx; )
974  _Ax[_Ix] |= (_Ty)_Gx() << (32 * _Jx);
975  }
976 
977  _Cy_t _Ans = _Reduce(_Ax);
978  if (!_Readcy)
979  return (_Ans);
980  else
981  return (_Gx());
982  }
static _Cy_t _Reduce(_Ty *_Ax)
Definition: random:986
int _Cy_t
Definition: random:939
static int _Get_wc()
Definition: random:948
template<class _Ty, _Ty _Mx, size_t _Nw>
template<class _Elem , class _Traits >
static void _Swc_traits< _Ty, _Mx, _Nw >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr,
const _Circ_buf< _Ty, _Nw > &  _Buf,
_Cy_t  _Cy 
)
inlinestatic
999  { // write state to _Ostr
1000  int _Kx = _Get_wc();
1001 
1002  for (int _Ix = 0; _Ix < _Nw; ++_Ix)
1003  for (int _Jx = 1; _Jx <= _Kx; ++_Jx)
1004  { // unpack into _Kx words
1005  unsigned int _Word =
1006  (unsigned int)(_Buf._At(_Ix) >> ((_Kx - _Jx) * 32));
1007  _Ostr << _Word << ' ';
1008  }
1009  _Ostr << _Cy;
1010  }
static constexpr _Cy_t _Cy
Definition: random:944
_Ty _At(int _Ix) const
Definition: random:677
unsigned int
Definition: vccorlib.h:2468
static int _Get_wc()
Definition: random:948

Member Data Documentation

template<class _Ty, _Ty _Mx, size_t _Nw>
constexpr _Cy_t _Swc_traits< _Ty, _Mx, _Nw >::_Cy = 1
static
template<class _Ty, _Ty _Mx, size_t _Nw>
constexpr _Ty _Swc_traits< _Ty, _Mx, _Nw >::_Max = _Mx - 1
static
template<class _Ty, _Ty _Mx, size_t _Nw>
constexpr _Mod_t _Swc_traits< _Ty, _Mx, _Nw >::_Mod = _Mx
static

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