.TH "std::linear_congruential_engine< _UIntType, __a, __c, __m >" 3cxx "Sun Feb 7 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::linear_congruential_engine< _UIntType, __a, __c, __m > \- A model of a linear congruential random number generator\&. .SH SYNOPSIS .br .PP .SS "Public Types" .in +1c .ti -1c .RI "typedef _UIntType \fBresult_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBlinear_congruential_engine\fP ()" .br .RI "Constructs a linear_congruential_engine random number generator engine with seed 1\&. " .ti -1c .RI "template> \fBlinear_congruential_engine\fP (_Sseq &__q)" .br .RI "Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence \fC__q\fP\&. " .ti -1c .RI "\fBlinear_congruential_engine\fP (\fBresult_type\fP __s)" .br .RI "Constructs a linear_congruential_engine random number generator engine with seed \fC__s\fP\&. The default seed value is 1\&. " .ti -1c .RI "void \fBdiscard\fP (unsigned long long __z)" .br .RI "Discard a sequence of random numbers\&. " .ti -1c .RI "\fBresult_type\fP \fBoperator()\fP ()" .br .RI "Gets the next random number in the sequence\&. " .ti -1c .RI "template _If_seed_seq< _Sseq > \fBseed\fP (_Sseq &__q)" .br .RI "Reseeds the linear_congruential_engine random number generator engine sequence using values from the seed sequence \fC__q\fP\&. " .ti -1c .RI "template auto \fBseed\fP (_Sseq &__q) \-> _If_seed_seq< _Sseq >" .br .ti -1c .RI "void \fBseed\fP (\fBresult_type\fP __s=default_seed)" .br .RI "Reseeds the linear_congruential_engine random number generator engine sequence to the seed \fC__s\fP\&. " .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static constexpr \fBresult_type\fP \fBmax\fP ()" .br .RI "Gets the largest possible value in the output range\&. " .ti -1c .RI "static constexpr \fBresult_type\fP \fBmin\fP ()" .br .RI "Gets the smallest possible value in the output range\&. " .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static constexpr \fBresult_type\fP \fBdefault_seed\fP" .br .ti -1c .RI "static constexpr \fBresult_type\fP \fBincrement\fP" .br .ti -1c .RI "static constexpr \fBresult_type\fP \fBmodulus\fP" .br .ti -1c .RI "static constexpr \fBresult_type\fP \fBmultiplier\fP" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "template \fBstd::basic_ostream\fP< _CharT, _Traits > & \fBoperator<<\fP (\fBstd::basic_ostream\fP< _CharT, _Traits > &__os, const \fBstd::linear_congruential_engine\fP< _UIntType1, __a1, __c1, __m1 > &__lcr)" .br .RI "Writes the textual representation of the state x(i) of x to \fC__os\fP\&. " .ti -1c .RI "bool \fBoperator==\fP (const \fBlinear_congruential_engine\fP &__lhs, const \fBlinear_congruential_engine\fP &__rhs)" .br .RI "Compares two linear congruential random number generator objects of the same type for equality\&. " .ti -1c .RI "template \fBstd::basic_istream\fP< _CharT, _Traits > & \fBoperator>>\fP (\fBstd::basic_istream\fP< _CharT, _Traits > &__is, \fBstd::linear_congruential_engine\fP< _UIntType1, __a1, __c1, __m1 > &__lcr)" .br .RI "Sets the state of the engine by reading its textual representation from \fC__is\fP\&. " .in -1c .SH "Detailed Description" .PP .SS "template .br 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}\leftarrow(ax_{i} + c) \bmod m \] .PP The template parameter \fC_UIntType\fP must be an unsigned integral type large enough to store values up to (__m-1)\&. If the template parameter \fC__m\fP is 0, the modulus \fC__m\fP used is std::numeric_limits<_UIntType>::max() plus 1\&. Otherwise, the template parameters \fC__a\fP and \fC__c\fP must be less than \fC__m\fP\&. .PP The size of the state is $1$\&. .PP Definition at line 244 of file random\&.h\&. .SH "Member Function Documentation" .PP .SS "template template auto \fBstd::linear_congruential_engine\fP< _UIntType, __a, __c, __m >::seed (_Sseq & __q) \-> _If_seed_seq<_Sseq> " Seeds the LCR engine with a value generated by \fC__q\fP\&. .PP Definition at line 132 of file bits/random\&.tcc\&. .PP References std::__lg()\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.