A discrete random number generator that produces pseudorandom numbers using
.
The size of the state is
and the maximum period of the generator is
.
N1688[4.13] says "the template parameter _IntType shall denote an integral type large enough to store values up to m."
Definition at line 668 of file random.
| typedef _IntType std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::result_type |
| std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::subtract_with_carry | ( | ) | [inline] |
Constructs a default-initialized % subtract_with_carry random number generator.
| std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::subtract_with_carry | ( | unsigned long | __value | ) | [inline, explicit] |
Constructs an explicitly seeded % subtract_with_carry random number generator.
| std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::subtract_with_carry | ( | _Gen & | __g | ) | [inline] |
| result_type std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::max | ( | ) | const [inline] |
| result_type std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::min | ( | ) | const [inline] |
| subtract_with_carry< _IntType, __m, __s, __r >::result_type std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::operator() | ( | ) |
Gets the next random number in the sequence.
Definition at line 362 of file random.tcc.
References std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::short_lag.
| void std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::seed | ( | _Gen & | __g | ) | [inline] |
Seeds the initial state
of the % subtract_with_carry random number generator.
| void std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::seed | ( | unsigned long | __value = 19780503 |
) |
Seeds the initial state
of the random number generator.
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
, sets
to
respectively. If
set carry to 1, otherwise sets carry to 0.
Definition at line 320 of file random.tcc.
References std::tr1::subtract_with_carry< _IntType, __m, __s, __r >::long_lag.
| bool operator!= | ( | const subtract_with_carry< _IntType, __m, __s, __r > & | __lhs, | |
| const subtract_with_carry< _IntType, __m, __s, __r > & | __rhs | |||
| ) | [friend] |
Compares two % subtract_with_carry random number generator objects of the same type for inequality.
| __lhs | A % subtract_with_carry random number generator object. | |
| __rhs | Another % subtract_with_carry random number generator object. |
| std::basic_ostream<_CharT, _Traits>& operator<< | ( | std::basic_ostream< _CharT, _Traits > & | __os, | |
| const subtract_with_carry< _IntType1, __m1, __s1, __r1 > & | __x | |||
| ) | [friend] |
Inserts the current state of a % subtract_with_carry random number generator engine __x into the output stream __os.
| __os | An output stream. | |
| __x | A % subtract_with_carry random number generator engine. |
__x inserted or in an error state. | bool operator== | ( | const subtract_with_carry< _IntType, __m, __s, __r > & | __lhs, | |
| const subtract_with_carry< _IntType, __m, __s, __r > & | __rhs | |||
| ) | [friend] |
Compares two % subtract_with_carry random number generator objects of the same type for equality.
| __lhs | A % subtract_with_carry random number generator object. | |
| __rhs | Another % subtract_with_carry random number generator object. |
| std::basic_istream<_CharT, _Traits>& operator>> | ( | std::basic_istream< _CharT, _Traits > & | __is, | |
| subtract_with_carry< _IntType1, __m1, __s1, __r1 > & | __x | |||
| ) | [friend] |
Extracts the current state of a % subtract_with_carry random number generator engine __x from the input stream __is.
| __is | An input stream. | |
| __x | A % subtract_with_carry random number generator engine. |
__x extracted or in an error state.
1.5.1