Is a random number engine that uses subtract with carry algorithm.
[edit] Template parameters UIntType - The result type generated by the generator. The effect is undefined if this is not one of unsigned short, unsigned int, unsigned long, or unsigned long long. w - the word size, in bits, of the state sequence s - the short lag r - the long lagIf w is not in [
1,
std::numeric_limits<UIntType>::digits]
, or s is not in [
1,
r)
, the program is ill-formed.
The size of the states of subtract_with_carry_engine
is \(\scriptsize O(r)\)O(r), each of them consists of two parts:
[
â0â,
2
w
)
.Given that \(\scriptsize X_j\)Xj stands for the \(\scriptsize j\mod r\)j mod rth value (starting from 0) of X, the transition algorithm of subtract_with_carry_engine
(\(\scriptsize TA(x_i)\)TA(xi)) is defined as follows:
The generation algorithm of subtract_with_carry_engine
is \(\scriptsize GA(x_i) = y\)GA(xi) = y, where y is the value produced in step 2 of the transition algorithm.
The following specializations define the random number engine with two commonly used parameter sets:
[edit] Nested types Type Definitionresult_type
UIntType
[edit] Data members w
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 3809 C++11default_seed
might not be
result_type
changed its type to
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4