libstdc++
|
#include <random.h>
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=0u) |
Static Public Member Functions | |
static constexpr result_type | max () |
static constexpr result_type | min () |
Static Public Attributes | |
static constexpr uint_least32_t | 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) |
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:
The size of the state is
typedef _UIntType std::subtract_with_carry_engine< _UIntType, __w, __s, __r >::result_type |
|
inline |
|
inlineexplicit |
Constructs an explicitly seeded subtract_with_carry_engine random number generator.
Definition at line 734 of file random.h.
References std::subtract_with_carry_engine< _UIntType, __w, __s, __r >::seed().
|
inlineexplicit |
Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence __q
.
__q | the seed sequence. |
Definition at line 745 of file random.h.
References std::subtract_with_carry_engine< _UIntType, __w, __s, __r >::seed().
|
inline |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
subtract_with_carry_engine< _UIntType, __w, __s, __r >::result_type std::subtract_with_carry_engine< _UIntType, __w, __s, __r >::operator() |
Gets the next random number in the sequence.
Definition at line 597 of file bits/random.tcc.
_If_seed_seq< _Sseq > std::subtract_with_carry_engine< _UIntType, __w, __s, __r >::seed | ( | _Sseq & | __q | ) |
Seeds the initial state
auto std::subtract_with_carry_engine< _UIntType, __w, __s, __r >::seed | ( | _Sseq & | __q | ) | -> _If_seed_seq<_Sseq> |
Definition at line 570 of file bits/random.tcc.
void std::subtract_with_carry_engine< _UIntType, __w, __s, __r >::seed | ( | result_type | __sd = 0u | ) |
Seeds the initial state
N1688[4.19] modifies this as follows. If __value
== 0, sets value to 19780503. In any case, with a linear congruential generator lcg(i) having parameters
Definition at line 541 of file bits/random.tcc.
Referenced by std::subtract_with_carry_engine< _UIntType, __w, __s, __r >::subtract_with_carry_engine().
|
friend |
Inserts the current state of a % subtract_with_carry_engine random number generator engine __x
into the output stream __os
.
__os | An output stream. |
__x | A % subtract_with_carry_engine random number generator engine. |
__x
inserted or in an error state.
|
friend |
Compares two % subtract_with_carry_engine random number generator objects of the same type for equality.
__lhs | A % subtract_with_carry_engine random number generator object. |
__rhs | Another % subtract_with_carry_engine random number generator object. |
|
friend |
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x
from the input stream __is
.
__is | An input stream. |
__x | A % subtract_with_carry_engine random number generator engine. |
__x
extracted or in an error state.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |