From Jason Turner

[rand.adapt]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpvljxnxq7/{from.md → to.md} +41 -4
tmp/tmpvljxnxq7/{from.md → to.md} RENAMED
@@ -45,10 +45,11 @@ state eⱼ to eⱼ₊₁.
45
 
46
  The generation algorithm yields the value returned by the last
47
  invocation of `e()` while advancing `e`’s state as described above.
48
 
49
  ``` cpp
 
50
  template<class Engine, size_t p, size_t r>
51
  class discard_block_engine {
52
  public:
53
  // types
54
  using result_type = typename Engine::result_type;
@@ -67,21 +68,33 @@ template<class Engine, size_t p, size_t r>
67
  template<class Sseq> explicit discard_block_engine(Sseq& q);
68
  void seed();
69
  void seed(result_type s);
70
  template<class Sseq> void seed(Sseq& q);
71
 
 
 
 
72
  // generating functions
73
  result_type operator()();
74
  void discard(unsigned long long z);
75
 
76
  // property functions
77
- const Engine& base() const noexcept { return e; };
 
 
 
 
 
 
 
 
78
 
79
  private:
80
  Engine e; // exposition only
81
- int n; // exposition only
82
  };
 
83
  ```
84
 
85
  The following relations shall hold: `0 < r` and `r <= p`.
86
 
87
  The textual representation consists of the textual representation of `e`
@@ -151,16 +164,27 @@ template<class Engine, size_t w, class UIntType>
151
  template<class Sseq> explicit independent_bits_engine(Sseq& q);
152
  void seed();
153
  void seed(result_type s);
154
  template<class Sseq> void seed(Sseq& q);
155
 
 
 
 
156
  // generating functions
157
  result_type operator()();
158
  void discard(unsigned long long z);
159
 
160
  // property functions
161
- const Engine& base() const noexcept { return e; };
 
 
 
 
 
 
 
 
162
 
163
  private:
164
  Engine e; // exposition only
165
  };
166
  ```
@@ -191,10 +215,11 @@ transition is performed as follows:
191
 
192
  The generation algorithm yields the last value of `Y` produced while
193
  advancing `e`’s state as described above.
194
 
195
  ``` cpp
 
196
  template<class Engine, size_t k>
197
  class shuffle_order_engine {
198
  public:
199
  // types
200
  using result_type = typename Engine::result_type;
@@ -212,22 +237,34 @@ template<class Engine, size_t k>
212
  template<class Sseq> explicit shuffle_order_engine(Sseq& q);
213
  void seed();
214
  void seed(result_type s);
215
  template<class Sseq> void seed(Sseq& q);
216
 
 
 
 
217
  // generating functions
218
  result_type operator()();
219
  void discard(unsigned long long z);
220
 
221
  // property functions
222
- const Engine& base() const noexcept { return e; };
 
 
 
 
 
 
 
 
223
 
224
  private:
225
  Engine e; // exposition only
226
  result_type V[k]; // exposition only
227
  result_type Y; // exposition only
228
  };
 
229
  ```
230
 
231
  The following relation shall hold: `0 < k`.
232
 
233
  The textual representation consists of the textual representation of
 
45
 
46
  The generation algorithm yields the value returned by the last
47
  invocation of `e()` while advancing `e`’s state as described above.
48
 
49
  ``` cpp
50
+ namespace std {
51
  template<class Engine, size_t p, size_t r>
52
  class discard_block_engine {
53
  public:
54
  // types
55
  using result_type = typename Engine::result_type;
 
68
  template<class Sseq> explicit discard_block_engine(Sseq& q);
69
  void seed();
70
  void seed(result_type s);
71
  template<class Sseq> void seed(Sseq& q);
72
 
73
+ // equality operators
74
+ friend bool operator==(const discard_block_engine& x, const discard_block_engine& y);
75
+
76
  // generating functions
77
  result_type operator()();
78
  void discard(unsigned long long z);
79
 
80
  // property functions
81
+ const Engine& base() const noexcept { return e; }
82
+
83
+ // inserters and extractors
84
+ template<class charT, class traits>
85
+ friend basic_ostream<charT, traits>&
86
+ operator<<(basic_ostream<charT, traits>& os, const discard_block_engine& x);
87
+ template<class charT, class traits>
88
+ friend basic_istream<charT, traits>&
89
+ operator>>(basic_istream<charT, traits>& is, discard_block_engine& x);
90
 
91
  private:
92
  Engine e; // exposition only
93
+ size_t n; // exposition only
94
  };
95
+ }
96
  ```
97
 
98
  The following relations shall hold: `0 < r` and `r <= p`.
99
 
100
  The textual representation consists of the textual representation of `e`
 
164
  template<class Sseq> explicit independent_bits_engine(Sseq& q);
165
  void seed();
166
  void seed(result_type s);
167
  template<class Sseq> void seed(Sseq& q);
168
 
169
+ // equality operators
170
+ friend bool operator==(const independent_bits_engine& x, const independent_bits_engine& y);
171
+
172
  // generating functions
173
  result_type operator()();
174
  void discard(unsigned long long z);
175
 
176
  // property functions
177
+ const Engine& base() const noexcept { return e; }
178
+
179
+ // inserters and extractors
180
+ template<class charT, class traits>
181
+ friend basic_ostream<charT, traits>&
182
+ operator<<(basic_ostream<charT, traits>& os, const independent_bits_engine& x);
183
+ template<class charT, class traits>
184
+ friend basic_istream<charT, traits>&
185
+ operator>>(basic_istream<charT, traits>& is, independent_bits_engine& x);
186
 
187
  private:
188
  Engine e; // exposition only
189
  };
190
  ```
 
215
 
216
  The generation algorithm yields the last value of `Y` produced while
217
  advancing `e`’s state as described above.
218
 
219
  ``` cpp
220
+ namespace std {
221
  template<class Engine, size_t k>
222
  class shuffle_order_engine {
223
  public:
224
  // types
225
  using result_type = typename Engine::result_type;
 
237
  template<class Sseq> explicit shuffle_order_engine(Sseq& q);
238
  void seed();
239
  void seed(result_type s);
240
  template<class Sseq> void seed(Sseq& q);
241
 
242
+ // equality operators
243
+ friend bool operator==(const shuffle_order_engine& x, const shuffle_order_engine& y);
244
+
245
  // generating functions
246
  result_type operator()();
247
  void discard(unsigned long long z);
248
 
249
  // property functions
250
+ const Engine& base() const noexcept { return e; }
251
+
252
+ // inserters and extractors
253
+ template<class charT, class traits>
254
+ friend basic_ostream<charT, traits>&
255
+ operator<<(basic_ostream<charT, traits>& os, const shuffle_order_engine& x);
256
+ template<class charT, class traits>
257
+ friend basic_istream<charT, traits>&
258
+ operator>>(basic_istream<charT, traits>& is, shuffle_order_engine& x);
259
 
260
  private:
261
  Engine e; // exposition only
262
  result_type V[k]; // exposition only
263
  result_type Y; // exposition only
264
  };
265
+ }
266
  ```
267
 
268
  The following relation shall hold: `0 < k`.
269
 
270
  The textual representation consists of the textual representation of