.TH "std::linear_congruential< _UIntType, __a, __c, __m >" 3cxx "Thu Aug 2 2012" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::linear_congruential< _UIntType, __a, __c, __m > \- .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\fP (unsigned long __x0=1)" .br .ti -1c .RI "template \fBlinear_congruential\fP (_Gen &__g)" .br .ti -1c .RI "\fBresult_type\fP \fBmax\fP () const " .br .ti -1c .RI "\fBresult_type\fP \fBmin\fP () const " .br .ti -1c .RI "\fBresult_type\fP \fBoperator()\fP ()" .br .ti -1c .RI "void \fBseed\fP (unsigned long __s=1)" .br .ti -1c .RI "template void \fBseed\fP (_Gen &__g)" .br .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static const _UIntType \fBincrement\fP" .br .ti -1c .RI "static const _UIntType \fBmodulus\fP" .br .ti -1c .RI "static const _UIntType \fBmultiplier\fP" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "bool \fBoperator!=\fP (const \fBlinear_congruential\fP &__lhs, const \fBlinear_congruential\fP &__rhs)" .br .ti -1c .RI "template \fBstd::basic_ostream\fP< _CharT, .br _Traits > & \fBoperator<<\fP (\fBstd::basic_ostream\fP< _CharT, _Traits > &__os, const \fBlinear_congruential\fP< _UIntType1, __a1, __c1, __m1 > &__lcr)" .br .ti -1c .RI "bool \fBoperator==\fP (const \fBlinear_congruential\fP &__lhs, const \fBlinear_congruential\fP &__rhs)" .br .ti -1c .RI "template \fBstd::basic_istream\fP< _CharT, .br _Traits > & \fBoperator>>\fP (\fBstd::basic_istream\fP< _CharT, _Traits > &__is, \fBlinear_congruential\fP< _UIntType1, __a1, __c1, __m1 > &__lcr)" .br .in -1c .SH "Detailed Description" .PP .SS "templateclass std::linear_congruential< _UIntType, __a, __c, __m >" A model of a linear congruential random number generator\&. A random number generator that produces pseudorandom numbers using the 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 \fBstd::numeric_limits<_UIntType>::max()\fP 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 346 of file tr1_impl/random\&. .SH "Member Typedef Documentation" .PP .SS "template typedef _UIntType \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::\fBresult_type\fP" The type of the generated random value\&. .PP Definition at line 353 of file tr1_impl/random\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::\fBlinear_congruential\fP (unsigned long__x0 = \fC1\fP)\fC [inline]\fP, \fC [explicit]\fP" Constructs a linear_congruential random number generator engine with seed \fC__s\fP\&. The default seed value is 1\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP The initial seed value\&. .RE .PP .PP Definition at line 369 of file tr1_impl/random\&. .PP References std::linear_congruential< _UIntType, __a, __c, __m >::seed()\&. .SS "template template \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::\fBlinear_congruential\fP (_Gen &__g)\fC [inline]\fP" Constructs a linear_congruential random number generator engine seeded from the generator function \fC__g\fP\&. .PP \fBParameters:\fP .RS 4 \fI__g\fP The seed generator function\&. .RE .PP .PP Definition at line 379 of file tr1_impl/random\&. .PP References std::linear_congruential< _UIntType, __a, __c, __m >::seed()\&. .SH "Member Function Documentation" .PP .SS "template \fBresult_type\fP \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::max () const\fC [inline]\fP" Gets the largest possible value in the output range\&. .PP Definition at line 416 of file tr1_impl/random\&. .SS "template \fBresult_type\fP \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::min () const\fC [inline]\fP" Gets the smallest possible value in the output range\&. .PP The minimum depends on the \fC__c\fP parameter: if it is zero, the minimum generated must be > 0, otherwise 0 is allowed\&. .PP Definition at line 409 of file tr1_impl/random\&. .SS "template \fBlinear_congruential\fP< _UIntType, __a, __c, __m >::\fBresult_type\fP \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::operator() ()" Gets the next random number in the sequence\&. .PP Gets the next generated value in sequence\&. .PP Definition at line 130 of file random\&.tcc\&. .SS "template void \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::seed (unsigned long__x0 = \fC1\fP)" Reseeds the linear_congruential random number generator engine sequence to the seed __s\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP The new seed\&. .RE .PP Seeds the LCR with integral value \fC__x0\fP, adjusted so that the ring identity is never a member of the convergence set\&. .PP Definition at line 98 of file random\&.tcc\&. .PP Referenced by std::linear_congruential< _UIntType, __a, __c, __m >::linear_congruential()\&. .SS "template template void \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::seed (_Gen &__g)\fC [inline]\fP" Reseeds the linear_congruential random number generator engine sequence using values from the generator function \fC__g\fP\&. .PP \fBParameters:\fP .RS 4 \fI__g\fP the seed generator function\&. .RE .PP .PP Definition at line 399 of file tr1_impl/random\&. .PP References std::linear_congruential< _UIntType, __a, __c, __m >::seed()\&. .PP Referenced by std::linear_congruential< _UIntType, __a, __c, __m >::seed()\&. .SH "Friends And Related Function Documentation" .PP .SS "template bool operator!= (const \fBlinear_congruential\fP< _UIntType, __a, __c, __m > &__lhs, const \fBlinear_congruential\fP< _UIntType, __a, __c, __m > &__rhs)\fC [friend]\fP" Compares two linear congruential random number generator objects of the same type for inequality\&. .PP \fBParameters:\fP .RS 4 \fI__lhs\fP A linear congruential random number generator object\&. .br \fI__rhs\fP Another linear congruential random number generator obj\&. .RE .PP \fBReturns:\fP .RS 4 true if the two objects are not equal, false otherwise\&. .RE .PP .PP Definition at line 449 of file tr1_impl/random\&. .SS "template template \fBstd::basic_ostream\fP<_CharT, _Traits>& operator<< (\fBstd::basic_ostream\fP< _CharT, _Traits > &__os, const \fBlinear_congruential\fP< _UIntType1, __a1, __c1, __m1 > &__lcr)\fC [friend]\fP" Writes the textual representation of the state x(i) of x to \fC__os\fP\&. .PP \fBParameters:\fP .RS 4 \fI__os\fP The output stream\&. .br \fI__lcr\fP A % \fBlinear_congruential\fP random number generator\&. .RE .PP \fBReturns:\fP .RS 4 __os\&. .RE .PP .SS "template bool operator== (const \fBlinear_congruential\fP< _UIntType, __a, __c, __m > &__lhs, const \fBlinear_congruential\fP< _UIntType, __a, __c, __m > &__rhs)\fC [friend]\fP" Compares two linear congruential random number generator objects of the same type for equality\&. .PP \fBParameters:\fP .RS 4 \fI__lhs\fP A linear congruential random number generator object\&. .br \fI__rhs\fP Another linear congruential random number generator obj\&. .RE .PP \fBReturns:\fP .RS 4 true if the two objects are equal, false otherwise\&. .RE .PP .PP Definition at line 435 of file tr1_impl/random\&. .SS "template template \fBstd::basic_istream\fP<_CharT, _Traits>& operator>> (\fBstd::basic_istream\fP< _CharT, _Traits > &__is, \fBlinear_congruential\fP< _UIntType1, __a1, __c1, __m1 > &__lcr)\fC [friend]\fP" Sets the state of the engine by reading its textual representation from \fC__is\fP\&. .PP 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 \fC__is\fP\&. .PP \fBParameters:\fP .RS 4 \fI__is\fP The input stream\&. .br \fI__lcr\fP A % \fBlinear_congruential\fP random number generator\&. .RE .PP \fBReturns:\fP .RS 4 __is\&. .RE .PP .SH "Member Data Documentation" .PP .SS "template const _UIntType \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::increment\fC [static]\fP" An increment\&. .PP Definition at line 358 of file tr1_impl/random\&. .SS "template const _UIntType \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::\fBmodulus\fP\fC [static]\fP" The modulus\&. .PP Definition at line 360 of file tr1_impl/random\&. .SS "template const _UIntType \fBstd::linear_congruential\fP< _UIntType, __a, __c, __m >::multiplier\fC [static]\fP" The multiplier\&. .PP Definition at line 356 of file tr1_impl/random\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.