STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Public Attributes | List of all members
_Mul_mod< _Ity, _Ty, _Ax, _Cx, _Mx > Struct Template Reference

Public Member Functions

 _Mul_mod (_Ty _Val=0)
 
_Ty operator() ()
 

Public Attributes

_Ty _Prev
 

Constructor & Destructor Documentation

template<class _Ity , class _Ty , _Max_type _Ax, _Max_type _Cx, _Max_type _Mx>
_Mul_mod< _Ity, _Ty, _Ax, _Cx, _Mx >::_Mul_mod ( _Ty  _Val = 0)
inline
360  : _Prev(_Val)
361  { // construct
362  }
_Ty _Prev
Definition: random:376
_FwdIt const _Ty _Val
Definition: algorithm:1938

Member Function Documentation

template<class _Ity , class _Ty , _Max_type _Ax, _Max_type _Cx, _Max_type _Mx>
_Ty _Mul_mod< _Ity, _Ty, _Ax, _Cx, _Mx >::operator() ( )
inline
365  { // return next value
366  static _Ty _Zero = 0; // to quiet diagnostics
367  _Ty _Divisor = (_Ty)_Mx;
368 
369  _Prev = _Mx ? ((_Ity)_Ax * _Prev + (_Ty)_Cx) % _Divisor
370  : ((_Ity)_Ax * _Prev + (_Ty)_Cx);
371  if (_Prev < _Zero)
372  _Prev += (_Ty)_Mx;
373  return (_Prev);
374  }
_Ty _Prev
Definition: random:376
return(_PAIR_TYPE(_FwdIt)(_First, _First))
if(__pUnknown!=*__ppTargetUnknown)
Definition: vccorlib.h:394

Member Data Documentation

template<class _Ity , class _Ty , _Max_type _Ax, _Max_type _Cx, _Max_type _Mx>
_Ty _Mul_mod< _Ity, _Ty, _Ax, _Cx, _Mx >::_Prev

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