[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/numeric/random/linear_congruential_engine [Back]  [Original]

std::linear_congruential_engine cppreference.com
cppreference.com

std::linear_congruential_engine

cppreference.com

<metanoindex/>

 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
(C++17)
(C++20)
(C++11)
(C++11)
(C++17)
(C++17)
(C++20)
(C++20)
(C++11)
(C++17)
(C++20)
(C++23)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
 
 
 
<tbody> </tbody>
template< class UIntType, UIntType a, UIntType c, UIntType m > class linear_congruential_engine;
( C++11)
linear_congruential_engine . LCG 1 .
:
A linear_congruential_engine produces unsigned integer pseudorandom numbers. The state of a LCG is of size 1 and consists of a single integer.
Google.
. .
LCG x
i+1
(ax
i
+c) mod m
.
:
The transition algorithm of the LCG function is x
i+1
(ax
i
+c) mod m
.
Google.
. .

-

result_type
. , .
:
The integral type generated by the engine. Results are undefined if this is not an unsigned integral type.
Google.
. .

-

:
Construction and Seeding
Google.
. .
c
(public -) []
:
sets the current state of the engine
Google.
. .

(public -) []
:
Generation
Google.
. .

(public -) []
:
advances the engine's state by a specified amount
Google.
. .

(public -) []
:
Characteristics
Google.
. .
[static]
:
gets the smallest possible value in the output range
Google.
. .

(public static -) []
[static]

(public static -) []

,

(C++11)(C++11)( C++20)

() []
/
() []

constexpr UIntType multiplier
[static]
() .
:
the multiplier term (a).
Google.
. .

(public static -)
constexpr UIntType increment
[static]
() .
:
the increment term (c).
Google.
. .

(public static -)
constexpr UIntType modulus
[static]
() .
:
the modulus term (m).
Google.
. .

(public static -)
constexpr UIntType default_seed
[static]
(1) .
:
the default seed (1).
Google.
. .

(public static -)

Web Proxy Viewer  |  New URL  |  Original Page