tmp/tmprua9lygo/{from.md → to.md}
RENAMED
|
@@ -20,10 +20,13 @@ template<class IntType = int>
|
|
| 20 |
poisson_distribution() : poisson_distribution(1.0) {}
|
| 21 |
explicit poisson_distribution(double mean);
|
| 22 |
explicit poisson_distribution(const param_type& parm);
|
| 23 |
void reset();
|
| 24 |
|
|
|
|
|
|
|
|
|
|
| 25 |
// generating functions
|
| 26 |
template<class URBG>
|
| 27 |
result_type operator()(URBG& g);
|
| 28 |
template<class URBG>
|
| 29 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -32,10 +35,18 @@ template<class IntType = int>
|
|
| 32 |
double mean() const;
|
| 33 |
param_type param() const;
|
| 34 |
void param(const param_type& parm);
|
| 35 |
result_type min() const;
|
| 36 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
};
|
| 38 |
```
|
| 39 |
|
| 40 |
``` cpp
|
| 41 |
explicit poisson_distribution(double mean);
|
|
@@ -57,10 +68,11 @@ constructed.
|
|
| 57 |
An `exponential_distribution` random number distribution produces random
|
| 58 |
numbers x > 0 distributed according to the probability density function
|
| 59 |
$$p(x\,|\,\lambda) = \lambda e^{-\lambda x} \text{ .}$$
|
| 60 |
|
| 61 |
``` cpp
|
|
|
|
| 62 |
template<class RealType = double>
|
| 63 |
class exponential_distribution {
|
| 64 |
public:
|
| 65 |
// types
|
| 66 |
using result_type = RealType;
|
|
@@ -70,10 +82,13 @@ template<class RealType = double>
|
|
| 70 |
exponential_distribution() : exponential_distribution(1.0) {}
|
| 71 |
explicit exponential_distribution(RealType lambda);
|
| 72 |
explicit exponential_distribution(const param_type& parm);
|
| 73 |
void reset();
|
| 74 |
|
|
|
|
|
|
|
|
|
|
| 75 |
// generating functions
|
| 76 |
template<class URBG>
|
| 77 |
result_type operator()(URBG& g);
|
| 78 |
template<class URBG>
|
| 79 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -82,11 +97,20 @@ template<class RealType = double>
|
|
| 82 |
RealType lambda() const;
|
| 83 |
param_type param() const;
|
| 84 |
void param(const param_type& parm);
|
| 85 |
result_type min() const;
|
| 86 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
};
|
|
|
|
| 88 |
```
|
| 89 |
|
| 90 |
``` cpp
|
| 91 |
explicit exponential_distribution(RealType lambda);
|
| 92 |
```
|
|
@@ -109,10 +133,11 @@ numbers x > 0 distributed according to the probability density function
|
|
| 109 |
$$p(x\,|\,\alpha,\beta) =
|
| 110 |
\frac{e^{-x/\beta}}{\beta^{\alpha} \cdot \Gamma(\alpha)} \, \cdot \, x^{\, \alpha-1}
|
| 111 |
\text{ .}$$
|
| 112 |
|
| 113 |
``` cpp
|
|
|
|
| 114 |
template<class RealType = double>
|
| 115 |
class gamma_distribution {
|
| 116 |
public:
|
| 117 |
// types
|
| 118 |
using result_type = RealType;
|
|
@@ -122,10 +147,13 @@ template<class RealType = double>
|
|
| 122 |
gamma_distribution() : gamma_distribution(1.0) {}
|
| 123 |
explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
|
| 124 |
explicit gamma_distribution(const param_type& parm);
|
| 125 |
void reset();
|
| 126 |
|
|
|
|
|
|
|
|
|
|
| 127 |
// generating functions
|
| 128 |
template<class URBG>
|
| 129 |
result_type operator()(URBG& g);
|
| 130 |
template<class URBG>
|
| 131 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -135,11 +163,20 @@ template<class RealType = double>
|
|
| 135 |
RealType beta() const;
|
| 136 |
param_type param() const;
|
| 137 |
void param(const param_type& parm);
|
| 138 |
result_type min() const;
|
| 139 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
};
|
|
|
|
| 141 |
```
|
| 142 |
|
| 143 |
``` cpp
|
| 144 |
explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
|
| 145 |
```
|
|
@@ -171,10 +208,11 @@ $$p(x\,|\,a,b) = \frac{a}{b}
|
|
| 171 |
\cdot \left(\frac{x}{b}\right)^{a-1}
|
| 172 |
\cdot \, \exp\left( -\left(\frac{x}{b}\right)^a\right)
|
| 173 |
\text{ .}$$
|
| 174 |
|
| 175 |
``` cpp
|
|
|
|
| 176 |
template<class RealType = double>
|
| 177 |
class weibull_distribution {
|
| 178 |
public:
|
| 179 |
// types
|
| 180 |
using result_type = RealType;
|
|
@@ -184,10 +222,13 @@ template<class RealType = double>
|
|
| 184 |
weibull_distribution() : weibull_distribution(1.0) {}
|
| 185 |
explicit weibull_distribution(RealType a, RealType b = 1.0);
|
| 186 |
explicit weibull_distribution(const param_type& parm);
|
| 187 |
void reset();
|
| 188 |
|
|
|
|
|
|
|
|
|
|
| 189 |
// generating functions
|
| 190 |
template<class URBG>
|
| 191 |
result_type operator()(URBG& g);
|
| 192 |
template<class URBG>
|
| 193 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -197,11 +238,20 @@ template<class RealType = double>
|
|
| 197 |
RealType b() const;
|
| 198 |
param_type param() const;
|
| 199 |
void param(const param_type& parm);
|
| 200 |
result_type min() const;
|
| 201 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
};
|
|
|
|
| 203 |
```
|
| 204 |
|
| 205 |
``` cpp
|
| 206 |
explicit weibull_distribution(RealType a, RealType b = 1.0);
|
| 207 |
```
|
|
@@ -227,15 +277,18 @@ constructed.
|
|
| 227 |
|
| 228 |
##### Class template `extreme_value_distribution` <a id="rand.dist.pois.extreme">[[rand.dist.pois.extreme]]</a>
|
| 229 |
|
| 230 |
An `extreme_value_distribution` random number distribution produces
|
| 231 |
random numbers x distributed according to the probability density
|
| 232 |
-
function[^
|
|
|
|
|
|
|
| 233 |
\cdot \exp\left(\frac{a-x}{b} - \exp\left(\frac{a-x}{b}\right)\right)
|
| 234 |
\text{ .}$$
|
| 235 |
|
| 236 |
``` cpp
|
|
|
|
| 237 |
template<class RealType = double>
|
| 238 |
class extreme_value_distribution {
|
| 239 |
public:
|
| 240 |
// types
|
| 241 |
using result_type = RealType;
|
|
@@ -245,10 +298,14 @@ template<class RealType = double>
|
|
| 245 |
extreme_value_distribution() : extreme_value_distribution(0.0) {}
|
| 246 |
explicit extreme_value_distribution(RealType a, RealType b = 1.0);
|
| 247 |
explicit extreme_value_distribution(const param_type& parm);
|
| 248 |
void reset();
|
| 249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
// generating functions
|
| 251 |
template<class URBG>
|
| 252 |
result_type operator()(URBG& g);
|
| 253 |
template<class URBG>
|
| 254 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -258,11 +315,20 @@ template<class RealType = double>
|
|
| 258 |
RealType b() const;
|
| 259 |
param_type param() const;
|
| 260 |
void param(const param_type& parm);
|
| 261 |
result_type min() const;
|
| 262 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
};
|
|
|
|
| 264 |
```
|
| 265 |
|
| 266 |
``` cpp
|
| 267 |
explicit extreme_value_distribution(RealType a, RealType b = 1.0);
|
| 268 |
```
|
|
|
|
| 20 |
poisson_distribution() : poisson_distribution(1.0) {}
|
| 21 |
explicit poisson_distribution(double mean);
|
| 22 |
explicit poisson_distribution(const param_type& parm);
|
| 23 |
void reset();
|
| 24 |
|
| 25 |
+
// equality operators
|
| 26 |
+
friend bool operator==(const poisson_distribution& x, const poisson_distribution& y);
|
| 27 |
+
|
| 28 |
// generating functions
|
| 29 |
template<class URBG>
|
| 30 |
result_type operator()(URBG& g);
|
| 31 |
template<class URBG>
|
| 32 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 35 |
double mean() const;
|
| 36 |
param_type param() const;
|
| 37 |
void param(const param_type& parm);
|
| 38 |
result_type min() const;
|
| 39 |
result_type max() const;
|
| 40 |
+
|
| 41 |
+
// inserters and extractors
|
| 42 |
+
template<class charT, class traits>
|
| 43 |
+
friend basic_ostream<charT, traits>&
|
| 44 |
+
operator<<(basic_ostream<charT, traits>& os, const poisson_distribution& x);
|
| 45 |
+
template<class charT, class traits>
|
| 46 |
+
friend basic_istream<charT, traits>&
|
| 47 |
+
operator>>(basic_istream<charT, traits>& is, poisson_distribution& x);
|
| 48 |
};
|
| 49 |
```
|
| 50 |
|
| 51 |
``` cpp
|
| 52 |
explicit poisson_distribution(double mean);
|
|
|
|
| 68 |
An `exponential_distribution` random number distribution produces random
|
| 69 |
numbers x > 0 distributed according to the probability density function
|
| 70 |
$$p(x\,|\,\lambda) = \lambda e^{-\lambda x} \text{ .}$$
|
| 71 |
|
| 72 |
``` cpp
|
| 73 |
+
namespace std {
|
| 74 |
template<class RealType = double>
|
| 75 |
class exponential_distribution {
|
| 76 |
public:
|
| 77 |
// types
|
| 78 |
using result_type = RealType;
|
|
|
|
| 82 |
exponential_distribution() : exponential_distribution(1.0) {}
|
| 83 |
explicit exponential_distribution(RealType lambda);
|
| 84 |
explicit exponential_distribution(const param_type& parm);
|
| 85 |
void reset();
|
| 86 |
|
| 87 |
+
// equality operators
|
| 88 |
+
friend bool operator==(const exponential_distribution& x, const exponential_distribution& y);
|
| 89 |
+
|
| 90 |
// generating functions
|
| 91 |
template<class URBG>
|
| 92 |
result_type operator()(URBG& g);
|
| 93 |
template<class URBG>
|
| 94 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 97 |
RealType lambda() const;
|
| 98 |
param_type param() const;
|
| 99 |
void param(const param_type& parm);
|
| 100 |
result_type min() const;
|
| 101 |
result_type max() const;
|
| 102 |
+
|
| 103 |
+
// inserters and extractors
|
| 104 |
+
template<class charT, class traits>
|
| 105 |
+
friend basic_ostream<charT, traits>&
|
| 106 |
+
operator<<(basic_ostream<charT, traits>& os, const exponential_distribution& x);
|
| 107 |
+
template<class charT, class traits>
|
| 108 |
+
friend basic_istream<charT, traits>&
|
| 109 |
+
operator>>(basic_istream<charT, traits>& is, exponential_distribution& x);
|
| 110 |
};
|
| 111 |
+
}
|
| 112 |
```
|
| 113 |
|
| 114 |
``` cpp
|
| 115 |
explicit exponential_distribution(RealType lambda);
|
| 116 |
```
|
|
|
|
| 133 |
$$p(x\,|\,\alpha,\beta) =
|
| 134 |
\frac{e^{-x/\beta}}{\beta^{\alpha} \cdot \Gamma(\alpha)} \, \cdot \, x^{\, \alpha-1}
|
| 135 |
\text{ .}$$
|
| 136 |
|
| 137 |
``` cpp
|
| 138 |
+
namespace std {
|
| 139 |
template<class RealType = double>
|
| 140 |
class gamma_distribution {
|
| 141 |
public:
|
| 142 |
// types
|
| 143 |
using result_type = RealType;
|
|
|
|
| 147 |
gamma_distribution() : gamma_distribution(1.0) {}
|
| 148 |
explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
|
| 149 |
explicit gamma_distribution(const param_type& parm);
|
| 150 |
void reset();
|
| 151 |
|
| 152 |
+
// equality operators
|
| 153 |
+
friend bool operator==(const gamma_distribution& x, const gamma_distribution& y);
|
| 154 |
+
|
| 155 |
// generating functions
|
| 156 |
template<class URBG>
|
| 157 |
result_type operator()(URBG& g);
|
| 158 |
template<class URBG>
|
| 159 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 163 |
RealType beta() const;
|
| 164 |
param_type param() const;
|
| 165 |
void param(const param_type& parm);
|
| 166 |
result_type min() const;
|
| 167 |
result_type max() const;
|
| 168 |
+
|
| 169 |
+
// inserters and extractors
|
| 170 |
+
template<class charT, class traits>
|
| 171 |
+
friend basic_ostream<charT, traits>&
|
| 172 |
+
operator<<(basic_ostream<charT, traits>& os, const gamma_distribution& x);
|
| 173 |
+
template<class charT, class traits>
|
| 174 |
+
friend basic_istream<charT, traits>&
|
| 175 |
+
operator>>(basic_istream<charT, traits>& is, gamma_distribution& x);
|
| 176 |
};
|
| 177 |
+
}
|
| 178 |
```
|
| 179 |
|
| 180 |
``` cpp
|
| 181 |
explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
|
| 182 |
```
|
|
|
|
| 208 |
\cdot \left(\frac{x}{b}\right)^{a-1}
|
| 209 |
\cdot \, \exp\left( -\left(\frac{x}{b}\right)^a\right)
|
| 210 |
\text{ .}$$
|
| 211 |
|
| 212 |
``` cpp
|
| 213 |
+
namespace std {
|
| 214 |
template<class RealType = double>
|
| 215 |
class weibull_distribution {
|
| 216 |
public:
|
| 217 |
// types
|
| 218 |
using result_type = RealType;
|
|
|
|
| 222 |
weibull_distribution() : weibull_distribution(1.0) {}
|
| 223 |
explicit weibull_distribution(RealType a, RealType b = 1.0);
|
| 224 |
explicit weibull_distribution(const param_type& parm);
|
| 225 |
void reset();
|
| 226 |
|
| 227 |
+
// equality operators
|
| 228 |
+
friend bool operator==(const weibull_distribution& x, const weibull_distribution& y);
|
| 229 |
+
|
| 230 |
// generating functions
|
| 231 |
template<class URBG>
|
| 232 |
result_type operator()(URBG& g);
|
| 233 |
template<class URBG>
|
| 234 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 238 |
RealType b() const;
|
| 239 |
param_type param() const;
|
| 240 |
void param(const param_type& parm);
|
| 241 |
result_type min() const;
|
| 242 |
result_type max() const;
|
| 243 |
+
|
| 244 |
+
// inserters and extractors
|
| 245 |
+
template<class charT, class traits>
|
| 246 |
+
friend basic_ostream<charT, traits>&
|
| 247 |
+
operator<<(basic_ostream<charT, traits>& os, const weibull_distribution& x);
|
| 248 |
+
template<class charT, class traits>
|
| 249 |
+
friend basic_istream<charT, traits>&
|
| 250 |
+
operator>>(basic_istream<charT, traits>& is, weibull_distribution& x);
|
| 251 |
};
|
| 252 |
+
}
|
| 253 |
```
|
| 254 |
|
| 255 |
``` cpp
|
| 256 |
explicit weibull_distribution(RealType a, RealType b = 1.0);
|
| 257 |
```
|
|
|
|
| 277 |
|
| 278 |
##### Class template `extreme_value_distribution` <a id="rand.dist.pois.extreme">[[rand.dist.pois.extreme]]</a>
|
| 279 |
|
| 280 |
An `extreme_value_distribution` random number distribution produces
|
| 281 |
random numbers x distributed according to the probability density
|
| 282 |
+
function[^7]
|
| 283 |
+
|
| 284 |
+
$$p(x\,|\,a,b) = \frac{1}{b}
|
| 285 |
\cdot \exp\left(\frac{a-x}{b} - \exp\left(\frac{a-x}{b}\right)\right)
|
| 286 |
\text{ .}$$
|
| 287 |
|
| 288 |
``` cpp
|
| 289 |
+
namespace std {
|
| 290 |
template<class RealType = double>
|
| 291 |
class extreme_value_distribution {
|
| 292 |
public:
|
| 293 |
// types
|
| 294 |
using result_type = RealType;
|
|
|
|
| 298 |
extreme_value_distribution() : extreme_value_distribution(0.0) {}
|
| 299 |
explicit extreme_value_distribution(RealType a, RealType b = 1.0);
|
| 300 |
explicit extreme_value_distribution(const param_type& parm);
|
| 301 |
void reset();
|
| 302 |
|
| 303 |
+
// equality operators
|
| 304 |
+
friend bool operator==(const extreme_value_distribution& x,
|
| 305 |
+
const extreme_value_distribution& y);
|
| 306 |
+
|
| 307 |
// generating functions
|
| 308 |
template<class URBG>
|
| 309 |
result_type operator()(URBG& g);
|
| 310 |
template<class URBG>
|
| 311 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 315 |
RealType b() const;
|
| 316 |
param_type param() const;
|
| 317 |
void param(const param_type& parm);
|
| 318 |
result_type min() const;
|
| 319 |
result_type max() const;
|
| 320 |
+
|
| 321 |
+
// inserters and extractors
|
| 322 |
+
template<class charT, class traits>
|
| 323 |
+
friend basic_ostream<charT, traits>&
|
| 324 |
+
operator<<(basic_ostream<charT, traits>& os, const extreme_value_distribution& x);
|
| 325 |
+
template<class charT, class traits>
|
| 326 |
+
friend basic_istream<charT, traits>&
|
| 327 |
+
operator>>(basic_istream<charT, traits>& is, extreme_value_distribution& x);
|
| 328 |
};
|
| 329 |
+
}
|
| 330 |
```
|
| 331 |
|
| 332 |
``` cpp
|
| 333 |
explicit extreme_value_distribution(RealType a, RealType b = 1.0);
|
| 334 |
```
|