std::linear_congruential_engine< _UIntType, __a, __c, __m >(3cxx) | std::linear_congruential_engine< _UIntType, __a, __c, __m >(3cxx) |
std::linear_congruential_engine< _UIntType, __a, __c, __m > - A model of a linear congruential random number generator.
#include <random.h>
typedef _UIntType result_type
linear_congruential_engine ()
Constructs a linear_congruential_engine random number generator engine with
seed 1. template<typename _Sseq , typename =
_If_seed_seq<_Sseq>> linear_congruential_engine (_Sseq
&__q)
Constructs a linear_congruential_engine random number generator engine seeded
from the seed sequence __q. linear_congruential_engine
(result_type __s)
Constructs a linear_congruential_engine random number generator engine with
seed __s. The default seed value is 1. void discard (unsigned
long long __z)
Discard a sequence of random numbers. result_type operator() ()
Gets the next random number in the sequence. template<typename _Sseq >
_If_seed_seq< _Sseq > seed (_Sseq &__q)
Reseeds the linear_congruential_engine random number generator engine sequence
using values from the seed sequence __q. template<typename _Sseq
> auto seed (_Sseq &__q) -> _If_seed_seq< _Sseq >
void seed (result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence
to the seed __s.
static constexpr result_type max ()
Gets the largest possible value in the output range. static constexpr
result_type min ()
Gets the smallest possible value in the output range.
static constexpr result_type default_seed
static constexpr result_type increment
static constexpr result_type modulus
static constexpr result_type multiplier
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)
Writes the textual representation of the state x(i) of x to __os. bool
operator== (const linear_congruential_engine &__lhs, const
linear_congruential_engine &__rhs)
Compares two linear congruential random number generator objects of the same
type for equality. 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)
Sets the state of the engine by reading its textual representation from
__is.
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:
x_{i+1} ]
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 $1$.
Definition at line 255 of file random.h.
The type of the generated random value.
Definition at line 268 of file random.h.
Constructs a linear_congruential_engine random number generator engine with seed 1.
Definition at line 282 of file random.h.
Constructs a linear_congruential_engine random number generator engine with seed __s. The default seed value is 1.
Parameters
Definition at line 293 of file random.h.
References std::linear_congruential_engine< _UIntType, __a, __c, __m >::seed().
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence __q.
Parameters
Definition at line 304 of file random.h.
References std::linear_congruential_engine< _UIntType, __a, __c, __m >::seed().
Discard a sequence of random numbers.
Definition at line 348 of file random.h.
Gets the largest possible value in the output range.
Definition at line 341 of file random.h.
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 334 of file random.h.
Gets the next random number in the sequence.
Definition at line 358 of file random.h.
Reseeds the linear_congruential_engine random number generator engine sequence using values from the seed sequence __q.
Parameters
" Seeds the LCR engine with a value generated by __q.
Definition at line 132 of file bits/random.tcc.
References std::__lg().
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 116 of file bits/random.tcc.
Referenced by std::linear_congruential_engine< _UIntType, __a, __c, __m >::linear_congruential_engine().
Writes the textual representation of the state x(i) of x to __os.
Parameters
Returns
Compares two linear congruential random number generator objects of the same type for equality.
Parameters
Returns
Definition at line 376 of file random.h.
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
Returns
Definition at line 276 of file random.h.
An increment.
Definition at line 273 of file random.h.
The modulus.
Definition at line 275 of file random.h.
The multiplier.
Definition at line 271 of file random.h.
Generated automatically by Doxygen for libstdc++ from the source code.
Thu Feb 16 2023 | libstdc++ |