From Jason Turner

[rand.dist]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp3_a57j7s/{from.md → to.md} +154 -163
tmp/tmp3_a57j7s/{from.md → to.md} RENAMED
@@ -12,11 +12,11 @@ for operations where there is additional semantic information. In
12
  particular, declarations for copy constructors, for copy assignment
13
  operators, for streaming operators, and for equality and inequality
14
  operators are not shown in the synopses.
15
 
16
  The algorithms for producing each of the specified distributions are
17
- implementation-defined.
18
 
19
  The value of each probability density function p(z) and of each discrete
20
  probability function P(zᵢ) specified in this section is 0 everywhere
21
  outside its stated domain.
22
 
@@ -30,27 +30,26 @@ probability function $$%
30
  P(i\,|\,a,b) = 1 / (b - a + 1)
31
  \; \mbox{.}$$
32
 
33
  ``` cpp
34
  template<class IntType = int>
35
- class uniform_int_distribution
36
- {
37
  public:
38
  // types
39
- typedef IntType result_type;
40
- typedef unspecified param_type;
41
 
42
  // constructors and reset functions
43
  explicit uniform_int_distribution(IntType a = 0, IntType b = numeric_limits<IntType>::max());
44
  explicit uniform_int_distribution(const param_type& parm);
45
  void reset();
46
 
47
  // generating functions
48
- template<class URNG>
49
- result_type operator()(URNG& g);
50
- template<class URNG>
51
- result_type operator()(URNG& g, const param_type& parm);
52
 
53
  // property functions
54
  result_type a() const;
55
  result_type b() const;
56
  param_type param() const;
@@ -89,29 +88,31 @@ A `uniform_real_distribution` random number distribution produces random
89
  numbers x, a ≤ x < b, distributed according to the constant probability
90
  density function $$%
91
  p(x\,|\,a,b) = 1 / (b - a)
92
  \; \mbox{.}$$
93
 
 
 
 
94
  ``` cpp
95
  template<class RealType = double>
96
- class uniform_real_distribution
97
- {
98
  public:
99
  // types
100
- typedef RealType result_type;
101
- typedef unspecified param_type;
102
 
103
  // constructors and reset functions
104
  explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0);
105
  explicit uniform_real_distribution(const param_type& parm);
106
  void reset();
107
 
108
  // generating functions
109
- template<class URNG>
110
- result_type operator()(URNG& g);
111
- template<class URNG>
112
- result_type operator()(URNG& g, const param_type& parm);
113
 
114
  // property functions
115
  result_type a() const;
116
  result_type b() const;
117
  param_type param() const;
@@ -156,27 +157,26 @@ values b distributed according to the discrete probability function $$%
156
  1-p & \mbox{if} & b = \tcode{false}
157
  \end{array}\right.
158
  \; \mbox{.}$$
159
 
160
  ``` cpp
161
- class bernoulli_distribution
162
- {
163
  public:
164
  // types
165
- typedef bool result_type;
166
- typedef unspecified param_type;
167
 
168
  // constructors and reset functions
169
  explicit bernoulli_distribution(double p = 0.5);
170
  explicit bernoulli_distribution(const param_type& parm);
171
  void reset();
172
 
173
  // generating functions
174
- template<class URNG>
175
- result_type operator()(URNG& g);
176
- template<class URNG>
177
- result_type operator()(URNG& g, const param_type& parm);
178
 
179
  // property functions
180
  double p() const;
181
  param_type param() const;
182
  void param(const param_type& parm);
@@ -210,27 +210,26 @@ $$%
210
  = \binom{t}{i} \cdot p^i \cdot (1-p)^{t-i}
211
  \; \mbox{.}$$
212
 
213
  ``` cpp
214
  template<class IntType = int>
215
- class binomial_distribution
216
- {
217
  public:
218
  // types
219
- typedef IntType result_type;
220
- typedef unspecified param_type;
221
 
222
  // constructors and reset functions
223
  explicit binomial_distribution(IntType t = 1, double p = 0.5);
224
  explicit binomial_distribution(const param_type& parm);
225
  void reset();
226
 
227
  // generating functions
228
- template<class URNG>
229
- result_type operator()(URNG& g);
230
- template<class URNG>
231
- result_type operator()(URNG& g, const param_type& parm);
232
 
233
  // property functions
234
  IntType t() const;
235
  double p() const;
236
  param_type param() const;
@@ -272,27 +271,26 @@ $$%
272
  = p \cdot (1-p)^{i}
273
  \; \mbox{.}$$
274
 
275
  ``` cpp
276
  template<class IntType = int>
277
- class geometric_distribution
278
- {
279
  public:
280
  // types
281
- typedef IntType result_type;
282
- typedef unspecified param_type;
283
 
284
  // constructors and reset functions
285
  explicit geometric_distribution(double p = 0.5);
286
  explicit geometric_distribution(const param_type& parm);
287
  void reset();
288
 
289
  // generating functions
290
- template<class URNG>
291
- result_type operator()(URNG& g);
292
- template<class URNG>
293
- result_type operator()(URNG& g, const param_type& parm);
294
 
295
  // property functions
296
  double p() const;
297
  param_type param() const;
298
  void param(const param_type& parm);
@@ -324,29 +322,31 @@ random integers i ≥ 0 distributed according to the discrete probability
324
  function $$%
325
  P(i\,|\,k,p)
326
  = \binom{k+i-1}{i} \cdot p^k \cdot (1-p)^i
327
  \; \mbox{.}$$
328
 
 
 
 
329
  ``` cpp
330
  template<class IntType = int>
331
- class negative_binomial_distribution
332
- {
333
  public:
334
  // types
335
- typedef IntType result_type;
336
- typedef unspecified param_type;
337
 
338
  // constructor and reset functions
339
  explicit negative_binomial_distribution(IntType k = 1, double p = 0.5);
340
  explicit negative_binomial_distribution(const param_type& parm);
341
  void reset();
342
 
343
  // generating functions
344
- template<class URNG>
345
- result_type operator()(URNG& g);
346
- template<class URNG>
347
- result_type operator()(URNG& g, const param_type& parm);
348
 
349
  // property functions
350
  IntType k() const;
351
  double p() const;
352
  param_type param() const;
@@ -396,23 +396,23 @@ distribution’s *mean* .
396
  template<class IntType = int>
397
  class poisson_distribution
398
  {
399
  public:
400
  // types
401
- typedef IntType result_type;
402
- typedef unspecified param_type;
403
 
404
  // constructors and reset functions
405
  explicit poisson_distribution(double mean = 1.0);
406
  explicit poisson_distribution(const param_type& parm);
407
  void reset();
408
 
409
  // generating functions
410
- template<class URNG>
411
- result_type operator()(URNG& g);
412
- template<class URNG>
413
- result_type operator()(URNG& g, const param_type& parm);
414
 
415
  // property functions
416
  double mean() const;
417
  param_type param() const;
418
  void param(const param_type& parm);
@@ -446,27 +446,26 @@ $$%
446
  = \lambda e^{-\lambda x}
447
  \; \mbox{.}$$
448
 
449
  ``` cpp
450
  template<class RealType = double>
451
- class exponential_distribution
452
- {
453
  public:
454
  // types
455
- typedef RealType result_type;
456
- typedef unspecified param_type;
457
 
458
  // constructors and reset functions
459
  explicit exponential_distribution(RealType lambda = 1.0);
460
  explicit exponential_distribution(const param_type& parm);
461
  void reset();
462
 
463
  // generating functions
464
- template<class URNG>
465
- result_type operator()(URNG& g);
466
- template<class URNG>
467
- result_type operator()(URNG& g, const param_type& parm);
468
 
469
  // property functions
470
  RealType lambda() const;
471
  param_type param() const;
472
  void param(const param_type& parm);
@@ -479,11 +478,11 @@ public:
479
  explicit exponential_distribution(RealType lambda = 1.0);
480
  ```
481
 
482
  *Requires:* 0 < `lambda`.
483
 
484
- *Effects:* Constructs a `exponential_distribution` object; `lambda`
485
  corresponds to the parameter of the distribution.
486
 
487
  ``` cpp
488
  RealType lambda() const;
489
  ```
@@ -501,27 +500,26 @@ $$%
501
  \, \cdot \, x^{\, \alpha-1}
502
  \; \mbox{.}$$
503
 
504
  ``` cpp
505
  template<class RealType = double>
506
- class gamma_distribution
507
- {
508
  public:
509
  // types
510
- typedef RealType result_type;
511
- typedef unspecified param_type;
512
 
513
  // constructors and reset functions
514
  explicit gamma_distribution(RealType alpha = 1.0, RealType beta = 1.0);
515
  explicit gamma_distribution(const param_type& parm);
516
  void reset();
517
 
518
  // generating functions
519
- template<class URNG>
520
- result_type operator()(URNG& g);
521
- template<class URNG>
522
- result_type operator()(URNG& g, const param_type& parm);
523
 
524
  // property functions
525
  RealType alpha() const;
526
  RealType beta() const;
527
  param_type param() const;
@@ -565,27 +563,26 @@ $$%
565
  \cdot \, \exp\left( -\left(\frac{x}{b}\right)^a\right)
566
  \; \mbox{.}$$
567
 
568
  ``` cpp
569
  template<class RealType = double>
570
- class weibull_distribution
571
- {
572
  public:
573
  // types
574
- typedef RealType result_type;
575
- typedef unspecified param_type;
576
 
577
  // constructor and reset functions
578
  explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0);
579
  explicit weibull_distribution(const param_type& parm);
580
  void reset();
581
 
582
  // generating functions
583
- template<class URNG>
584
- result_type operator()(URNG& g);
585
- template<class URNG>
586
- result_type operator()(URNG& g, const param_type& parm);
587
 
588
  // property functions
589
  RealType a() const;
590
  RealType b() const;
591
  param_type param() const;
@@ -630,27 +627,26 @@ function[^6] $$%
630
  \right)
631
  \; \mbox{.}$$
632
 
633
  ``` cpp
634
  template<class RealType = double>
635
- class extreme_value_distribution
636
- {
637
  public:
638
  // types
639
- typedef RealType result_type;
640
- typedef unspecified param_type;
641
 
642
  // constructor and reset functions
643
  explicit extreme_value_distribution(RealType a = 0.0, RealType b = 1.0);
644
  explicit extreme_value_distribution(const param_type& parm);
645
  void reset();
646
 
647
  // generating functions
648
- template<class URNG>
649
- result_type operator()(URNG& g);
650
- template<class URNG>
651
- result_type operator()(URNG& g, const param_type& parm);
652
 
653
  // property functions
654
  RealType a() const;
655
  RealType b() const;
656
  param_type param() const;
@@ -700,27 +696,26 @@ numbers x distributed according to the probability density function $$%
700
  \; \mbox{.}$$ The distribution parameters μ and σ are also known as this
701
  distribution’s *mean* and *standard deviation* .
702
 
703
  ``` cpp
704
  template<class RealType = double>
705
- class normal_distribution
706
- {
707
  public:
708
  // types
709
- typedef RealType result_type;
710
- typedef unspecified param_type;
711
 
712
  // constructors and reset functions
713
  explicit normal_distribution(RealType mean = 0.0, RealType stddev = 1.0);
714
  explicit normal_distribution(const param_type& parm);
715
  void reset();
716
 
717
  // generating functions
718
- template<class URNG>
719
- result_type operator()(URNG& g);
720
- template<class URNG>
721
- result_type operator()(URNG& g, const param_type& parm);
722
 
723
  // property functions
724
  RealType mean() const;
725
  RealType stddev() const;
726
  param_type param() const;
@@ -768,27 +763,26 @@ $$%
768
  }
769
  \; \mbox{.}$$
770
 
771
  ``` cpp
772
  template<class RealType = double>
773
- class lognormal_distribution
774
- {
775
  public:
776
  // types
777
- typedef RealType result_type;
778
- typedef unspecified param_type;
779
 
780
  // constructor and reset functions
781
  explicit lognormal_distribution(RealType m = 0.0, RealType s = 1.0);
782
  explicit lognormal_distribution(const param_type& parm);
783
  void reset();
784
 
785
  // generating functions
786
- template<class URNG>
787
- result_type operator()(URNG& g);
788
- template<class URNG>
789
- result_type operator()(URNG& g, const param_type& parm);
790
 
791
  // property functions
792
  RealType m() const;
793
  RealType s() const;
794
  param_type param() const;
@@ -831,27 +825,26 @@ $$%
831
  {\Gamma(n/2) \cdot 2^{n/2}}
832
  \; \mbox{.}$$
833
 
834
  ``` cpp
835
  template<class RealType = double>
836
- class chi_squared_distribution
837
- {
838
  public:
839
  // types
840
- typedef RealType result_type;
841
- typedef unspecified param_type;
842
 
843
  // constructor and reset functions
844
  explicit chi_squared_distribution(RealType n = 1);
845
  explicit chi_squared_distribution(const param_type& parm);
846
  void reset();
847
 
848
  // generating functions
849
- template<class URNG>
850
- result_type operator()(URNG& g);
851
- template<class URNG>
852
- result_type operator()(URNG& g, const param_type& parm);
853
 
854
  // property functions
855
  RealType n() const;
856
  param_type param() const;
857
  void param(const param_type& parm);
@@ -884,27 +877,26 @@ numbers x distributed according to the probability density function $$%
884
  = \left( \pi b \left( 1 + \left( \frac{x-a}{b} \right)^2 \;\right)\right)^{-1}
885
  \; \mbox{.}$$
886
 
887
  ``` cpp
888
  template<class RealType = double>
889
- class cauchy_distribution
890
- {
891
  public:
892
  // types
893
- typedef RealType result_type;
894
- typedef unspecified param_type;
895
 
896
  // constructor and reset functions
897
  explicit cauchy_distribution(RealType a = 0.0, RealType b = 1.0);
898
  explicit cauchy_distribution(const param_type& parm);
899
  void reset();
900
 
901
  // generating functions
902
- template<class URNG>
903
- result_type operator()(URNG& g);
904
- template<class URNG>
905
- result_type operator()(URNG& g, const param_type& parm);
906
 
907
  // property functions
908
  RealType a() const;
909
  RealType b() const;
910
  param_type param() const;
@@ -953,27 +945,26 @@ $$%
953
  {\left( 1 + \frac{m x}{n} \right)}^{-(m+n)/2}
954
  \; \mbox{.}$$
955
 
956
  ``` cpp
957
  template<class RealType = double>
958
- class fisher_f_distribution
959
- {
960
  public:
961
  // types
962
- typedef RealType result_type;
963
- typedef unspecified param_type;
964
 
965
  // constructor and reset functions
966
  explicit fisher_f_distribution(RealType m = 1, RealType n = 1);
967
  explicit fisher_f_distribution(const param_type& parm);
968
  void reset();
969
 
970
  // generating functions
971
- template<class URNG>
972
- result_type operator()(URNG& g);
973
- template<class URNG>
974
- result_type operator()(URNG& g, const param_type& parm);
975
 
976
  // property functions
977
  RealType m() const;
978
  RealType n() const;
979
  param_type param() const;
@@ -1018,27 +1009,26 @@ numbers x distributed according to the probability density function $$%
1018
  \cdot \left( 1+\frac{x^2}{n} \right) ^ {-(n+1)/2}
1019
  \; \mbox{.}$$
1020
 
1021
  ``` cpp
1022
  template<class RealType = double>
1023
- class student_t_distribution
1024
- {
1025
  public:
1026
  // types
1027
- typedef RealType result_type;
1028
- typedef unspecified param_type;
1029
 
1030
  // constructor and reset functions
1031
  explicit student_t_distribution(RealType n = 1);
1032
  explicit student_t_distribution(const param_type& parm);
1033
  void reset();
1034
 
1035
  // generating functions
1036
- template<class URNG>
1037
- result_type operator()(URNG& g);
1038
- template<class URNG>
1039
- result_type operator()(URNG& g, const param_type& parm);
1040
 
1041
  // property functions
1042
  RealType n() const;
1043
  param_type param() const;
1044
  void param(const param_type& parm);
@@ -1080,16 +1070,15 @@ the values wₖ, commonly known as the *weights* , shall be non-negative,
1080
  non-NaN, and non-infinity. Moreover, the following relation shall hold:
1081
  0 < S = w₀ + ⋯ + wₙ₋₁.
1082
 
1083
  ``` cpp
1084
  template<class IntType = int>
1085
- class discrete_distribution
1086
- {
1087
  public:
1088
  // types
1089
- typedef IntType result_type;
1090
- typedef unspecified param_type;
1091
 
1092
  // constructor and reset functions
1093
  discrete_distribution();
1094
  template<class InputIterator>
1095
  discrete_distribution(InputIterator firstW, InputIterator lastW);
@@ -1098,14 +1087,14 @@ public:
1098
  discrete_distribution(size_t nw, double xmin, double xmax, UnaryOperation fw);
1099
  explicit discrete_distribution(const param_type& parm);
1100
  void reset();
1101
 
1102
  // generating functions
1103
- template<class URNG>
1104
- result_type operator()(URNG& g);
1105
- template<class URNG>
1106
- result_type operator()(URNG& g, const param_type& parm);
1107
 
1108
  // property functions
1109
  vector<double> probabilities() const;
1110
  param_type param() const;
1111
  void param(const param_type& parm);
@@ -1117,19 +1106,22 @@ public:
1117
  ``` cpp
1118
  discrete_distribution();
1119
  ```
1120
 
1121
  *Effects:* Constructs a `discrete_distribution` object with n = 1 and
1122
- p₀ = 1. Such an object will always deliver the value 0.
 
 
 
1123
 
1124
  ``` cpp
1125
  template<class InputIterator>
1126
  discrete_distribution(InputIterator firstW, InputIterator lastW);
1127
  ```
1128
 
1129
  *Requires:* `InputIterator` shall satisfy the requirements of an input
1130
- iterator (Table  [[tab:iterator.input.requirements]]) type. Moreover,
1131
  `iterator_traits<InputIterator>::value_type` shall denote a type that is
1132
  convertible to `double`. If `firstW == lastW`, let n = 1 and w₀ = 1.
1133
  Otherwise, [`firstW`, `lastW`) shall form a sequence w of length n > 0.
1134
 
1135
  *Effects:* Constructs a `discrete_distribution` object with
@@ -1190,34 +1182,34 @@ commonly known as the *weights* , shall be non-negative, non-NaN, and
1190
  non-infinity. Moreover, the following relation shall hold:
1191
  0 < S = w₀ + ⋯ + wₙ₋₁.
1192
 
1193
  ``` cpp
1194
  template<class RealType = double>
1195
- class piecewise_constant_distribution
1196
- {
1197
  public:
1198
  // types
1199
- typedef RealType result_type;
1200
- typedef unspecified param_type;
1201
 
1202
  // constructor and reset functions
1203
  piecewise_constant_distribution();
1204
  template<class InputIteratorB, class InputIteratorW>
1205
  piecewise_constant_distribution(InputIteratorB firstB, InputIteratorB lastB,
1206
  InputIteratorW firstW);
1207
  template<class UnaryOperation>
1208
  piecewise_constant_distribution(initializer_list<RealType> bl, UnaryOperation fw);
1209
  template<class UnaryOperation>
1210
- piecewise_constant_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw);
 
1211
  explicit piecewise_constant_distribution(const param_type& parm);
1212
  void reset();
1213
 
1214
  // generating functions
1215
- template<class URNG>
1216
- result_type operator()(URNG& g);
1217
- template<class URNG>
1218
- result_type operator()(URNG& g, const param_type& parm);
1219
 
1220
  // property functions
1221
  vector<result_type> intervals() const;
1222
  vector<result_type> densities() const;
1223
  param_type param() const;
@@ -1330,16 +1322,15 @@ relation shall hold: $$%
1330
  \cdot \sum_{k=0}^{n-1} (w_k + w_{k+1}) \cdot (b_{k+1} - b_k)
1331
  \; \mbox{.}$$
1332
 
1333
  ``` cpp
1334
  template<class RealType = double>
1335
- class piecewise_linear_distribution
1336
- {
1337
  public:
1338
  // types
1339
- typedef RealType result_type;
1340
- typedef unspecified param_type;
1341
 
1342
  // constructor and reset functions
1343
  piecewise_linear_distribution();
1344
  template<class InputIteratorB, class InputIteratorW>
1345
  piecewise_linear_distribution(InputIteratorB firstB, InputIteratorB lastB,
@@ -1350,14 +1341,14 @@ public:
1350
  piecewise_linear_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw);
1351
  explicit piecewise_linear_distribution(const param_type& parm);
1352
  void reset();
1353
 
1354
  // generating functions
1355
- template<class URNG>
1356
- result_type operator()(URNG& g);
1357
- template<class URNG>
1358
- result_type operator()(URNG& g, const param_type& parm);
1359
 
1360
  // property functions
1361
  vector<result_type> intervals() const;
1362
  vector<result_type> densities() const;
1363
  param_type param() const;
 
12
  particular, declarations for copy constructors, for copy assignment
13
  operators, for streaming operators, and for equality and inequality
14
  operators are not shown in the synopses.
15
 
16
  The algorithms for producing each of the specified distributions are
17
+ *implementation-defined*.
18
 
19
  The value of each probability density function p(z) and of each discrete
20
  probability function P(zᵢ) specified in this section is 0 everywhere
21
  outside its stated domain.
22
 
 
30
  P(i\,|\,a,b) = 1 / (b - a + 1)
31
  \; \mbox{.}$$
32
 
33
  ``` cpp
34
  template<class IntType = int>
35
+ class uniform_int_distribution {
 
36
  public:
37
  // types
38
+ using result_type = IntType;
39
+ using param_type = unspecified;
40
 
41
  // constructors and reset functions
42
  explicit uniform_int_distribution(IntType a = 0, IntType b = numeric_limits<IntType>::max());
43
  explicit uniform_int_distribution(const param_type& parm);
44
  void reset();
45
 
46
  // generating functions
47
+ template<class URBG>
48
+ result_type operator()(URBG& g);
49
+ template<class URBG>
50
+ result_type operator()(URBG& g, const param_type& parm);
51
 
52
  // property functions
53
  result_type a() const;
54
  result_type b() const;
55
  param_type param() const;
 
88
  numbers x, a ≤ x < b, distributed according to the constant probability
89
  density function $$%
90
  p(x\,|\,a,b) = 1 / (b - a)
91
  \; \mbox{.}$$
92
 
93
+ [*Note 1*: This implies that p(x | a,b) is undefined when
94
+ `a == b`. — *end note*]
95
+
96
  ``` cpp
97
  template<class RealType = double>
98
+ class uniform_real_distribution {
 
99
  public:
100
  // types
101
+ using result_type = RealType;
102
+ using param_type = unspecified;
103
 
104
  // constructors and reset functions
105
  explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0);
106
  explicit uniform_real_distribution(const param_type& parm);
107
  void reset();
108
 
109
  // generating functions
110
+ template<class URBG>
111
+ result_type operator()(URBG& g);
112
+ template<class URBG>
113
+ result_type operator()(URBG& g, const param_type& parm);
114
 
115
  // property functions
116
  result_type a() const;
117
  result_type b() const;
118
  param_type param() const;
 
157
  1-p & \mbox{if} & b = \tcode{false}
158
  \end{array}\right.
159
  \; \mbox{.}$$
160
 
161
  ``` cpp
162
+ class bernoulli_distribution {
 
163
  public:
164
  // types
165
+ using result_type = bool;
166
+ using param_type = unspecified;
167
 
168
  // constructors and reset functions
169
  explicit bernoulli_distribution(double p = 0.5);
170
  explicit bernoulli_distribution(const param_type& parm);
171
  void reset();
172
 
173
  // generating functions
174
+ template<class URBG>
175
+ result_type operator()(URBG& g);
176
+ template<class URBG>
177
+ result_type operator()(URBG& g, const param_type& parm);
178
 
179
  // property functions
180
  double p() const;
181
  param_type param() const;
182
  void param(const param_type& parm);
 
210
  = \binom{t}{i} \cdot p^i \cdot (1-p)^{t-i}
211
  \; \mbox{.}$$
212
 
213
  ``` cpp
214
  template<class IntType = int>
215
+ class binomial_distribution {
 
216
  public:
217
  // types
218
+ using result_type = IntType;
219
+ using param_type = unspecified;
220
 
221
  // constructors and reset functions
222
  explicit binomial_distribution(IntType t = 1, double p = 0.5);
223
  explicit binomial_distribution(const param_type& parm);
224
  void reset();
225
 
226
  // generating functions
227
+ template<class URBG>
228
+ result_type operator()(URBG& g);
229
+ template<class URBG>
230
+ result_type operator()(URBG& g, const param_type& parm);
231
 
232
  // property functions
233
  IntType t() const;
234
  double p() const;
235
  param_type param() const;
 
271
  = p \cdot (1-p)^{i}
272
  \; \mbox{.}$$
273
 
274
  ``` cpp
275
  template<class IntType = int>
276
+ class geometric_distribution {
 
277
  public:
278
  // types
279
+ using result_type = IntType;
280
+ using param_type = unspecified;
281
 
282
  // constructors and reset functions
283
  explicit geometric_distribution(double p = 0.5);
284
  explicit geometric_distribution(const param_type& parm);
285
  void reset();
286
 
287
  // generating functions
288
+ template<class URBG>
289
+ result_type operator()(URBG& g);
290
+ template<class URBG>
291
+ result_type operator()(URBG& g, const param_type& parm);
292
 
293
  // property functions
294
  double p() const;
295
  param_type param() const;
296
  void param(const param_type& parm);
 
322
  function $$%
323
  P(i\,|\,k,p)
324
  = \binom{k+i-1}{i} \cdot p^k \cdot (1-p)^i
325
  \; \mbox{.}$$
326
 
327
+ [*Note 1*: This implies that P(i | k,p) is undefined when
328
+ `p == 1`. — *end note*]
329
+
330
  ``` cpp
331
  template<class IntType = int>
332
+ class negative_binomial_distribution {
 
333
  public:
334
  // types
335
+ using result_type = IntType;
336
+ using param_type = unspecified;
337
 
338
  // constructor and reset functions
339
  explicit negative_binomial_distribution(IntType k = 1, double p = 0.5);
340
  explicit negative_binomial_distribution(const param_type& parm);
341
  void reset();
342
 
343
  // generating functions
344
+ template<class URBG>
345
+ result_type operator()(URBG& g);
346
+ template<class URBG>
347
+ result_type operator()(URBG& g, const param_type& parm);
348
 
349
  // property functions
350
  IntType k() const;
351
  double p() const;
352
  param_type param() const;
 
396
  template<class IntType = int>
397
  class poisson_distribution
398
  {
399
  public:
400
  // types
401
+ using result_type = IntType;
402
+ using param_type = unspecified;
403
 
404
  // constructors and reset functions
405
  explicit poisson_distribution(double mean = 1.0);
406
  explicit poisson_distribution(const param_type& parm);
407
  void reset();
408
 
409
  // generating functions
410
+ template<class URBG>
411
+ result_type operator()(URBG& g);
412
+ template<class URBG>
413
+ result_type operator()(URBG& g, const param_type& parm);
414
 
415
  // property functions
416
  double mean() const;
417
  param_type param() const;
418
  void param(const param_type& parm);
 
446
  = \lambda e^{-\lambda x}
447
  \; \mbox{.}$$
448
 
449
  ``` cpp
450
  template<class RealType = double>
451
+ class exponential_distribution {
 
452
  public:
453
  // types
454
+ using result_type = RealType;
455
+ using param_type = unspecified;
456
 
457
  // constructors and reset functions
458
  explicit exponential_distribution(RealType lambda = 1.0);
459
  explicit exponential_distribution(const param_type& parm);
460
  void reset();
461
 
462
  // generating functions
463
+ template<class URBG>
464
+ result_type operator()(URBG& g);
465
+ template<class URBG>
466
+ result_type operator()(URBG& g, const param_type& parm);
467
 
468
  // property functions
469
  RealType lambda() const;
470
  param_type param() const;
471
  void param(const param_type& parm);
 
478
  explicit exponential_distribution(RealType lambda = 1.0);
479
  ```
480
 
481
  *Requires:* 0 < `lambda`.
482
 
483
+ *Effects:* Constructs an `exponential_distribution` object; `lambda`
484
  corresponds to the parameter of the distribution.
485
 
486
  ``` cpp
487
  RealType lambda() const;
488
  ```
 
500
  \, \cdot \, x^{\, \alpha-1}
501
  \; \mbox{.}$$
502
 
503
  ``` cpp
504
  template<class RealType = double>
505
+ class gamma_distribution {
 
506
  public:
507
  // types
508
+ using result_type = RealType;
509
+ using param_type = unspecified;
510
 
511
  // constructors and reset functions
512
  explicit gamma_distribution(RealType alpha = 1.0, RealType beta = 1.0);
513
  explicit gamma_distribution(const param_type& parm);
514
  void reset();
515
 
516
  // generating functions
517
+ template<class URBG>
518
+ result_type operator()(URBG& g);
519
+ template<class URBG>
520
+ result_type operator()(URBG& g, const param_type& parm);
521
 
522
  // property functions
523
  RealType alpha() const;
524
  RealType beta() const;
525
  param_type param() const;
 
563
  \cdot \, \exp\left( -\left(\frac{x}{b}\right)^a\right)
564
  \; \mbox{.}$$
565
 
566
  ``` cpp
567
  template<class RealType = double>
568
+ class weibull_distribution {
 
569
  public:
570
  // types
571
+ using result_type = RealType;
572
+ using param_type = unspecified;
573
 
574
  // constructor and reset functions
575
  explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0);
576
  explicit weibull_distribution(const param_type& parm);
577
  void reset();
578
 
579
  // generating functions
580
+ template<class URBG>
581
+ result_type operator()(URBG& g);
582
+ template<class URBG>
583
+ result_type operator()(URBG& g, const param_type& parm);
584
 
585
  // property functions
586
  RealType a() const;
587
  RealType b() const;
588
  param_type param() const;
 
627
  \right)
628
  \; \mbox{.}$$
629
 
630
  ``` cpp
631
  template<class RealType = double>
632
+ class extreme_value_distribution {
 
633
  public:
634
  // types
635
+ using result_type = RealType;
636
+ using param_type = unspecified;
637
 
638
  // constructor and reset functions
639
  explicit extreme_value_distribution(RealType a = 0.0, RealType b = 1.0);
640
  explicit extreme_value_distribution(const param_type& parm);
641
  void reset();
642
 
643
  // generating functions
644
+ template<class URBG>
645
+ result_type operator()(URBG& g);
646
+ template<class URBG>
647
+ result_type operator()(URBG& g, const param_type& parm);
648
 
649
  // property functions
650
  RealType a() const;
651
  RealType b() const;
652
  param_type param() const;
 
696
  \; \mbox{.}$$ The distribution parameters μ and σ are also known as this
697
  distribution’s *mean* and *standard deviation* .
698
 
699
  ``` cpp
700
  template<class RealType = double>
701
+ class normal_distribution {
 
702
  public:
703
  // types
704
+ using result_type = RealType;
705
+ using param_type = unspecified;
706
 
707
  // constructors and reset functions
708
  explicit normal_distribution(RealType mean = 0.0, RealType stddev = 1.0);
709
  explicit normal_distribution(const param_type& parm);
710
  void reset();
711
 
712
  // generating functions
713
+ template<class URBG>
714
+ result_type operator()(URBG& g);
715
+ template<class URBG>
716
+ result_type operator()(URBG& g, const param_type& parm);
717
 
718
  // property functions
719
  RealType mean() const;
720
  RealType stddev() const;
721
  param_type param() const;
 
763
  }
764
  \; \mbox{.}$$
765
 
766
  ``` cpp
767
  template<class RealType = double>
768
+ class lognormal_distribution {
 
769
  public:
770
  // types
771
+ using result_type = RealType;
772
+ using param_type = unspecified;
773
 
774
  // constructor and reset functions
775
  explicit lognormal_distribution(RealType m = 0.0, RealType s = 1.0);
776
  explicit lognormal_distribution(const param_type& parm);
777
  void reset();
778
 
779
  // generating functions
780
+ template<class URBG>
781
+ result_type operator()(URBG& g);
782
+ template<class URBG>
783
+ result_type operator()(URBG& g, const param_type& parm);
784
 
785
  // property functions
786
  RealType m() const;
787
  RealType s() const;
788
  param_type param() const;
 
825
  {\Gamma(n/2) \cdot 2^{n/2}}
826
  \; \mbox{.}$$
827
 
828
  ``` cpp
829
  template<class RealType = double>
830
+ class chi_squared_distribution {
 
831
  public:
832
  // types
833
+ using result_type = RealType;
834
+ using param_type = unspecified;
835
 
836
  // constructor and reset functions
837
  explicit chi_squared_distribution(RealType n = 1);
838
  explicit chi_squared_distribution(const param_type& parm);
839
  void reset();
840
 
841
  // generating functions
842
+ template<class URBG>
843
+ result_type operator()(URBG& g);
844
+ template<class URBG>
845
+ result_type operator()(URBG& g, const param_type& parm);
846
 
847
  // property functions
848
  RealType n() const;
849
  param_type param() const;
850
  void param(const param_type& parm);
 
877
  = \left( \pi b \left( 1 + \left( \frac{x-a}{b} \right)^2 \;\right)\right)^{-1}
878
  \; \mbox{.}$$
879
 
880
  ``` cpp
881
  template<class RealType = double>
882
+ class cauchy_distribution {
 
883
  public:
884
  // types
885
+ using result_type = RealType;
886
+ using param_type = unspecified;
887
 
888
  // constructor and reset functions
889
  explicit cauchy_distribution(RealType a = 0.0, RealType b = 1.0);
890
  explicit cauchy_distribution(const param_type& parm);
891
  void reset();
892
 
893
  // generating functions
894
+ template<class URBG>
895
+ result_type operator()(URBG& g);
896
+ template<class URBG>
897
+ result_type operator()(URBG& g, const param_type& parm);
898
 
899
  // property functions
900
  RealType a() const;
901
  RealType b() const;
902
  param_type param() const;
 
945
  {\left( 1 + \frac{m x}{n} \right)}^{-(m+n)/2}
946
  \; \mbox{.}$$
947
 
948
  ``` cpp
949
  template<class RealType = double>
950
+ class fisher_f_distribution {
 
951
  public:
952
  // types
953
+ using result_type = RealType;
954
+ using param_type = unspecified;
955
 
956
  // constructor and reset functions
957
  explicit fisher_f_distribution(RealType m = 1, RealType n = 1);
958
  explicit fisher_f_distribution(const param_type& parm);
959
  void reset();
960
 
961
  // generating functions
962
+ template<class URBG>
963
+ result_type operator()(URBG& g);
964
+ template<class URBG>
965
+ result_type operator()(URBG& g, const param_type& parm);
966
 
967
  // property functions
968
  RealType m() const;
969
  RealType n() const;
970
  param_type param() const;
 
1009
  \cdot \left( 1+\frac{x^2}{n} \right) ^ {-(n+1)/2}
1010
  \; \mbox{.}$$
1011
 
1012
  ``` cpp
1013
  template<class RealType = double>
1014
+ class student_t_distribution {
 
1015
  public:
1016
  // types
1017
+ using result_type = RealType;
1018
+ using param_type = unspecified;
1019
 
1020
  // constructor and reset functions
1021
  explicit student_t_distribution(RealType n = 1);
1022
  explicit student_t_distribution(const param_type& parm);
1023
  void reset();
1024
 
1025
  // generating functions
1026
+ template<class URBG>
1027
+ result_type operator()(URBG& g);
1028
+ template<class URBG>
1029
+ result_type operator()(URBG& g, const param_type& parm);
1030
 
1031
  // property functions
1032
  RealType n() const;
1033
  param_type param() const;
1034
  void param(const param_type& parm);
 
1070
  non-NaN, and non-infinity. Moreover, the following relation shall hold:
1071
  0 < S = w₀ + ⋯ + wₙ₋₁.
1072
 
1073
  ``` cpp
1074
  template<class IntType = int>
1075
+ class discrete_distribution {
 
1076
  public:
1077
  // types
1078
+ using result_type = IntType;
1079
+ using param_type = unspecified;
1080
 
1081
  // constructor and reset functions
1082
  discrete_distribution();
1083
  template<class InputIterator>
1084
  discrete_distribution(InputIterator firstW, InputIterator lastW);
 
1087
  discrete_distribution(size_t nw, double xmin, double xmax, UnaryOperation fw);
1088
  explicit discrete_distribution(const param_type& parm);
1089
  void reset();
1090
 
1091
  // generating functions
1092
+ template<class URBG>
1093
+ result_type operator()(URBG& g);
1094
+ template<class URBG>
1095
+ result_type operator()(URBG& g, const param_type& parm);
1096
 
1097
  // property functions
1098
  vector<double> probabilities() const;
1099
  param_type param() const;
1100
  void param(const param_type& parm);
 
1106
  ``` cpp
1107
  discrete_distribution();
1108
  ```
1109
 
1110
  *Effects:* Constructs a `discrete_distribution` object with n = 1 and
1111
+ p₀ = 1.
1112
+
1113
+ [*Note 1*: Such an object will always deliver the value
1114
+ 0. — *end note*]
1115
 
1116
  ``` cpp
1117
  template<class InputIterator>
1118
  discrete_distribution(InputIterator firstW, InputIterator lastW);
1119
  ```
1120
 
1121
  *Requires:* `InputIterator` shall satisfy the requirements of an input
1122
+ iterator ([[input.iterators]]). Moreover,
1123
  `iterator_traits<InputIterator>::value_type` shall denote a type that is
1124
  convertible to `double`. If `firstW == lastW`, let n = 1 and w₀ = 1.
1125
  Otherwise, [`firstW`, `lastW`) shall form a sequence w of length n > 0.
1126
 
1127
  *Effects:* Constructs a `discrete_distribution` object with
 
1182
  non-infinity. Moreover, the following relation shall hold:
1183
  0 < S = w₀ + ⋯ + wₙ₋₁.
1184
 
1185
  ``` cpp
1186
  template<class RealType = double>
1187
+ class piecewise_constant_distribution {
 
1188
  public:
1189
  // types
1190
+ using result_type = RealType;
1191
+ using param_type = unspecified;
1192
 
1193
  // constructor and reset functions
1194
  piecewise_constant_distribution();
1195
  template<class InputIteratorB, class InputIteratorW>
1196
  piecewise_constant_distribution(InputIteratorB firstB, InputIteratorB lastB,
1197
  InputIteratorW firstW);
1198
  template<class UnaryOperation>
1199
  piecewise_constant_distribution(initializer_list<RealType> bl, UnaryOperation fw);
1200
  template<class UnaryOperation>
1201
+ piecewise_constant_distribution(size_t nw, RealType xmin, RealType xmax,
1202
+ UnaryOperation fw);
1203
  explicit piecewise_constant_distribution(const param_type& parm);
1204
  void reset();
1205
 
1206
  // generating functions
1207
+ template<class URBG>
1208
+ result_type operator()(URBG& g);
1209
+ template<class URBG>
1210
+ result_type operator()(URBG& g, const param_type& parm);
1211
 
1212
  // property functions
1213
  vector<result_type> intervals() const;
1214
  vector<result_type> densities() const;
1215
  param_type param() const;
 
1322
  \cdot \sum_{k=0}^{n-1} (w_k + w_{k+1}) \cdot (b_{k+1} - b_k)
1323
  \; \mbox{.}$$
1324
 
1325
  ``` cpp
1326
  template<class RealType = double>
1327
+ class piecewise_linear_distribution {
 
1328
  public:
1329
  // types
1330
+ using result_type = RealType;
1331
+ using param_type = unspecified;
1332
 
1333
  // constructor and reset functions
1334
  piecewise_linear_distribution();
1335
  template<class InputIteratorB, class InputIteratorW>
1336
  piecewise_linear_distribution(InputIteratorB firstB, InputIteratorB lastB,
 
1341
  piecewise_linear_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw);
1342
  explicit piecewise_linear_distribution(const param_type& parm);
1343
  void reset();
1344
 
1345
  // generating functions
1346
+ template<class URBG>
1347
+ result_type operator()(URBG& g);
1348
+ template<class URBG>
1349
+ result_type operator()(URBG& g, const param_type& parm);
1350
 
1351
  // property functions
1352
  vector<result_type> intervals() const;
1353
  vector<result_type> densities() const;
1354
  param_type param() const;