|
template<typename _UIntType1 , _UIntType1 __a1, _UIntType1 __c1, _UIntType1 __m1, typename _CharT , typename _Traits > |
std::basic_ostream< _CharT, _Traits > & | operator<< (std::basic_ostream< _CharT, _Traits > &__os, const std::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr) |
|
bool | operator== (const linear_congruential_engine &__lhs, const linear_congruential_engine &__rhs) |
|
template<typename _UIntType1 , _UIntType1 __a1, _UIntType1 __c1, _UIntType1 __m1, typename _CharT , typename _Traits > |
std::basic_istream< _CharT, _Traits > & | operator>> (std::basic_istream< _CharT, _Traits > &__is, std::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr) |
|
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
class std::linear_congruential_engine< _UIntType, __a, __c, __m >
A model of a linear congruential random number generator.
A random number generator that produces pseudorandom numbers via linear function:
The template parameter _UIntType
must be an unsigned integral type large enough to store values up to (__m-1). If the template parameter __m
is 0, the modulus __m
used is std::numeric_limits<_UIntType>::max() plus 1. Otherwise, the template parameters __a
and __c
must be less than __m
.
The size of the state is .
Definition at line 236 of file random.h.
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
template<typename _Sseq , typename = typename std::enable_if<!std::is_same<_Sseq, linear_congruential_engine>::value> ::type>
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence __q
.
- Parameters
-
Definition at line 276 of file random.h.
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
Gets the smallest possible value in the output range.
The minimum depends on the __c
parameter: if it is zero, the minimum generated must be > 0, otherwise 0 is allowed.
Definition at line 306 of file random.h.
template<typename _UIntType , _UIntType __a, _UIntType __c, _UIntType __m>
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s
.
- Parameters
-
Seeds the LCR with integral value __s
, adjusted so that the ring identity is never a member of the convergence set.
Definition at line 120 of file bits/random.tcc.
template<typename _UIntType , _UIntType __a, _UIntType __c, _UIntType __m>
template<typename _Sseq >
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
template<typename _UIntType1 , _UIntType1 __a1, _UIntType1 __c1, _UIntType1 __m1, typename _CharT , typename _Traits >
Writes the textual representation of the state x(i) of x to __os
.
- Parameters
-
__os | The output stream. |
__lcr | A % linear_congruential_engine random number generator. |
- Returns
- __os.
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
template<typename _UIntType1 , _UIntType1 __a1, _UIntType1 __c1, _UIntType1 __m1, typename _CharT , typename _Traits >
Sets the state of the engine by reading its textual representation from __is
.
The textual representation must have been previously written using an output stream whose imbued locale and whose type's template specialization arguments _CharT and _Traits were the same as those of __is
.
- Parameters
-
__is | The input stream. |
__lcr | A % linear_congruential_engine random number generator. |
- Returns
- __is.