.TH "std::subtract_with_carry_engine< _UIntType, __w, __s, __r >" 3cxx "Sun Feb 7 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::subtract_with_carry_engine< _UIntType, __w, __s, __r > \- The Marsaglia-Zaman 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 "template> \fBsubtract_with_carry_engine\fP (_Sseq &__q)" .br .RI "Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence \fC__q\fP\&. " .ti -1c .RI "\fBsubtract_with_carry_engine\fP (\fBresult_type\fP __sd)" .br .RI "Constructs an explicitly seeded subtract_with_carry_engine random number generator\&. " .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 "Seeds the initial state $x_0$ of the % subtract_with_carry_engine random number generator\&. " .ti -1c .RI "template auto \fBseed\fP (_Sseq &__q) \-> _If_seed_seq< _Sseq >" .br .ti -1c .RI "void \fBseed\fP (\fBresult_type\fP __sd=default_seed)" .br .RI "Seeds the initial state $x_0$ of the random number generator\&. " .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static constexpr \fBresult_type\fP \fBmax\fP ()" .br .RI "Gets the inclusive maximum value of the range of random integers returned by this generator\&. " .ti -1c .RI "static constexpr \fBresult_type\fP \fBmin\fP ()" .br .RI "Gets the inclusive minimum value of the range of random integers returned by this generator\&. " .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 size_t \fBlong_lag\fP" .br .ti -1c .RI "static constexpr size_t \fBshort_lag\fP" .br .ti -1c .RI "static constexpr size_t \fBword_size\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::subtract_with_carry_engine\fP< _UIntType1, __w1, __s1, __r1 > &__x)" .br .RI "Inserts the current state of a % subtract_with_carry_engine random number generator engine \fC__x\fP into the output stream \fC__os\fP\&. " .ti -1c .RI "bool \fBoperator==\fP (const \fBsubtract_with_carry_engine\fP &__lhs, const \fBsubtract_with_carry_engine\fP &__rhs)" .br .RI "Compares two % subtract_with_carry_engine 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::subtract_with_carry_engine\fP< _UIntType1, __w1, __s1, __r1 > &__x)" .br .RI "Extracts the current state of a % subtract_with_carry_engine random number generator engine \fC__x\fP from the input stream \fC__is\fP\&. " .in -1c .SH "Detailed Description" .PP .SS "template .br class std::subtract_with_carry_engine< _UIntType, __w, __s, __r >" The Marsaglia-Zaman generator\&. This is a model of a Generalized Fibonacci discrete random number generator, sometimes referred to as the SWC generator\&. .PP A discrete random number generator that produces pseudorandom numbers using: \[ x_{i}\leftarrow(x_{i - s} - x_{i - r} - carry_{i-1}) \bmod m \] .PP The size of the state is $r$ and the maximum period of the generator is $(m^r - m^s - 1)$\&. .PP Definition at line 681 of file random\&.h\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.