From Jason Turner

[rand.req.eng]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp63con3q6/{from.md → to.md} +34 -15
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
- section.
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
- A class `E` that satisfies the requirements of a uniform random bit
16
- generator ([[rand.req.urng]]) also satisfies the requirements of a
17
- *random number engine* if the expressions shown in Table 
18
- [[tab:RandomEngine]] are valid and have the indicated semantics, and if
19
- `E` also satisfies all other requirements of this section
20
- [[rand.req.eng]]. In that Table and throughout this section:
21
-
22
- where `charT` and `traits` are constrained according to Clause 
23
- [[strings]] and Clause  [[input.output]].
24
-
25
- `E` shall meet the requirements of `CopyConstructible` (Table 
26
- [[tab:copyconstructible]]) and `CopyAssignable` (Table 
27
- [[tab:copyassignable]]) types. These operations shall each be of
28
- complexity no worse than 𝑂(\mbox{size of state}).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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