libstdc++
std::subtract_with_carry_engine< _UIntType, __w, __s, __r > Class Template Reference

Public Types

typedef _UIntType result_type
 

Public Member Functions

template<typename _Sseq , typename = _If_seed_seq<_Sseq>>
 subtract_with_carry_engine (_Sseq &__q)
 
 subtract_with_carry_engine (result_type __sd)
 
void discard (unsigned long long __z)
 
result_type operator() ()
 
template<typename _Sseq >
_If_seed_seq< _Sseq > seed (_Sseq &__q)
 
template<typename _Sseq >
auto seed (_Sseq &__q) -> _If_seed_seq< _Sseq >
 
void seed (result_type __sd=default_seed)
 

Static Public Member Functions

static constexpr result_type max ()
 
static constexpr result_type min ()
 

Static Public Attributes

static constexpr result_type default_seed
 
static constexpr size_t long_lag
 
static constexpr size_t short_lag
 
static constexpr size_t word_size
 

Friends

template<typename _UIntType1 , size_t __w1, size_t __s1, size_t __r1, typename _CharT , typename _Traits >
std::basic_ostream< _CharT, _Traits > & operator<< (std::basic_ostream< _CharT, _Traits > &__os, const std::subtract_with_carry_engine< _UIntType1, __w1, __s1, __r1 > &__x)
 
bool operator== (const subtract_with_carry_engine &__lhs, const subtract_with_carry_engine &__rhs)
 
template<typename _UIntType1 , size_t __w1, size_t __s1, size_t __r1, typename _CharT , typename _Traits >
std::basic_istream< _CharT, _Traits > & operator>> (std::basic_istream< _CharT, _Traits > &__is, std::subtract_with_carry_engine< _UIntType1, __w1, __s1, __r1 > &__x)
 

Detailed Description

template<typename _UIntType, size_t __w, size_t __s, size_t __r>
class std::subtract_with_carry_engine< _UIntType, __w, __s, __r >

The Marsaglia-Zaman generator.

This is a model of a Generalized Fibonacci discrete random number generator, sometimes referred to as the SWC generator.

A discrete random number generator that produces pseudorandom numbers using:

\[ x_{i}\leftarrow(x_{i - s} - x_{i - r} - carry_{i-1}) \bmod m \]

The size of the state is $r$ and the maximum period of the generator is $(m^r - m^s - 1)$.

Definition at line 692 of file random.h.


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