- 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 |
-
|
| 36 |
-
{
|
| 37 |
public:
|
| 38 |
// types
|
| 39 |
-
|
| 40 |
-
|
| 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 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 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 |
-
|
| 97 |
-
{
|
| 98 |
public:
|
| 99 |
// types
|
| 100 |
-
|
| 101 |
-
|
| 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 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 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 |
-
|
| 166 |
-
|
| 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 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 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 |
-
|
| 216 |
-
{
|
| 217 |
public:
|
| 218 |
// types
|
| 219 |
-
|
| 220 |
-
|
| 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 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 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 |
-
|
| 278 |
-
{
|
| 279 |
public:
|
| 280 |
// types
|
| 281 |
-
|
| 282 |
-
|
| 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 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 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 |
-
|
| 332 |
-
{
|
| 333 |
public:
|
| 334 |
// types
|
| 335 |
-
|
| 336 |
-
|
| 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 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 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 |
-
|
| 402 |
-
|
| 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 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 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 |
-
|
| 452 |
-
{
|
| 453 |
public:
|
| 454 |
// types
|
| 455 |
-
|
| 456 |
-
|
| 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 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 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
|
| 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 |
-
|
| 507 |
-
{
|
| 508 |
public:
|
| 509 |
// types
|
| 510 |
-
|
| 511 |
-
|
| 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 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 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 |
-
|
| 571 |
-
{
|
| 572 |
public:
|
| 573 |
// types
|
| 574 |
-
|
| 575 |
-
|
| 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 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 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 |
-
|
| 636 |
-
{
|
| 637 |
public:
|
| 638 |
// types
|
| 639 |
-
|
| 640 |
-
|
| 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 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 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 |
-
|
| 706 |
-
{
|
| 707 |
public:
|
| 708 |
// types
|
| 709 |
-
|
| 710 |
-
|
| 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 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 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 |
-
|
| 774 |
-
{
|
| 775 |
public:
|
| 776 |
// types
|
| 777 |
-
|
| 778 |
-
|
| 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 |
-
|
| 787 |
-
|
| 788 |
-
|
| 789 |
-
|
| 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 |
-
|
| 837 |
-
{
|
| 838 |
public:
|
| 839 |
// types
|
| 840 |
-
|
| 841 |
-
|
| 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 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
|
| 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 |
-
|
| 890 |
-
{
|
| 891 |
public:
|
| 892 |
// types
|
| 893 |
-
|
| 894 |
-
|
| 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 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 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 |
-
|
| 959 |
-
{
|
| 960 |
public:
|
| 961 |
// types
|
| 962 |
-
|
| 963 |
-
|
| 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 |
-
|
| 972 |
-
|
| 973 |
-
|
| 974 |
-
|
| 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 |
-
|
| 1024 |
-
{
|
| 1025 |
public:
|
| 1026 |
// types
|
| 1027 |
-
|
| 1028 |
-
|
| 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 |
-
|
| 1037 |
-
|
| 1038 |
-
|
| 1039 |
-
|
| 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 |
-
|
| 1086 |
-
{
|
| 1087 |
public:
|
| 1088 |
// types
|
| 1089 |
-
|
| 1090 |
-
|
| 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 |
-
|
| 1104 |
-
|
| 1105 |
-
|
| 1106 |
-
|
| 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.
|
|
|
|
|
|
|
|
|
|
| 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
|
| 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 |
-
|
| 1196 |
-
{
|
| 1197 |
public:
|
| 1198 |
// types
|
| 1199 |
-
|
| 1200 |
-
|
| 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 |
-
|
|
|
|
| 1211 |
explicit piecewise_constant_distribution(const param_type& parm);
|
| 1212 |
void reset();
|
| 1213 |
|
| 1214 |
// generating functions
|
| 1215 |
-
|
| 1216 |
-
|
| 1217 |
-
|
| 1218 |
-
|
| 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 |
-
|
| 1336 |
-
{
|
| 1337 |
public:
|
| 1338 |
// types
|
| 1339 |
-
|
| 1340 |
-
|
| 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 |
-
|
| 1356 |
-
|
| 1357 |
-
|
| 1358 |
-
|
| 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;
|