tmp/tmp63con3q6/{from.md → to.md}
RENAMED
|
@@ -1,29 +1,48 @@
|
|
| 1 |
#### Random number engine requirements <a id="rand.req.eng">[[rand.req.eng]]</a>
|
| 2 |
|
| 3 |
A *random number engine* (commonly shortened to *engine*) `e` of type
|
| 4 |
`E` is a uniform random bit generator that additionally meets the
|
| 5 |
requirements (e.g., for seeding and for input/output) specified in this
|
| 6 |
-
|
| 7 |
|
| 8 |
At any given time, `e` has a state eᵢ for some integer i ≥ 0. Upon
|
| 9 |
construction, `e` has an initial state e₀. An engine’s state may be
|
| 10 |
established via a constructor, a `seed` function, assignment, or a
|
| 11 |
suitable `operator>>`.
|
| 12 |
|
| 13 |
`E`’s specification shall define:
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
[[
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
|
|
|
| 1 |
#### Random number engine requirements <a id="rand.req.eng">[[rand.req.eng]]</a>
|
| 2 |
|
| 3 |
A *random number engine* (commonly shortened to *engine*) `e` of type
|
| 4 |
`E` is a uniform random bit generator that additionally meets the
|
| 5 |
requirements (e.g., for seeding and for input/output) specified in this
|
| 6 |
+
subclause.
|
| 7 |
|
| 8 |
At any given time, `e` has a state eᵢ for some integer i ≥ 0. Upon
|
| 9 |
construction, `e` has an initial state e₀. An engine’s state may be
|
| 10 |
established via a constructor, a `seed` function, assignment, or a
|
| 11 |
suitable `operator>>`.
|
| 12 |
|
| 13 |
`E`’s specification shall define:
|
| 14 |
|
| 15 |
+
- the size of `E`’s state in multiples of the size of `result_type`,
|
| 16 |
+
given as an integral constant expression;
|
| 17 |
+
- the *transition algorithm* TA by which `e`’s state eᵢ is advanced to
|
| 18 |
+
its *successor state* eᵢ₊₁; and
|
| 19 |
+
- the *generation algorithm* GA by which an engine’s state is mapped to
|
| 20 |
+
a value of type `result_type`.
|
| 21 |
+
|
| 22 |
+
A class `E` that meets the requirements of a uniform random bit
|
| 23 |
+
generator [[rand.req.urng]] also meets the requirements of a *random
|
| 24 |
+
number engine* if the expressions shown in [[rand.req.eng]] are valid
|
| 25 |
+
and have the indicated semantics, and if `E` also meets all other
|
| 26 |
+
requirements of this subclause [[rand.req.eng]]. In that Table and
|
| 27 |
+
throughout this subclause:
|
| 28 |
+
|
| 29 |
+
- `T` is the type named by `E`’s associated `result_type`;
|
| 30 |
+
- `e` is a value of `E`, `v` is an lvalue of `E`, `x` and `y` are
|
| 31 |
+
(possibly `const`) values of `E`;
|
| 32 |
+
- `s` is a value of `T`;
|
| 33 |
+
- `q` is an lvalue meeting the requirements of a seed sequence
|
| 34 |
+
[[rand.req.seedseq]];
|
| 35 |
+
- `z` is a value of type `unsigned long long`;
|
| 36 |
+
- `os` is an lvalue of the type of some class template specialization
|
| 37 |
+
`basic_ostream<charT,` `traits>`; and
|
| 38 |
+
- `is` is an lvalue of the type of some class template specialization
|
| 39 |
+
`basic_istream<charT,` `traits>`;
|
| 40 |
+
|
| 41 |
+
where `charT` and `traits` are constrained according to [[strings]] and
|
| 42 |
+
[[input.output]].
|
| 43 |
+
|
| 44 |
+
`E` shall meet the *Cpp17CopyConstructible* (
|
| 45 |
+
[[cpp17.copyconstructible]]) and *Cpp17CopyAssignable* (
|
| 46 |
+
[[cpp17.copyassignable]]) requirements. These operations shall each be
|
| 47 |
+
of complexity no worse than 𝑂(\text{size of state}).
|
| 48 |
|