tmp/tmpvks8kafx/{from.md → to.md}
RENAMED
|
@@ -14,10 +14,11 @@ numbers x distributed according to the probability density function $$%
|
|
| 14 |
}
|
| 15 |
\text{ .}$$ The distribution parameters μ and σ are also known as this
|
| 16 |
distribution’s *mean* and *standard deviation*.
|
| 17 |
|
| 18 |
``` cpp
|
|
|
|
| 19 |
template<class RealType = double>
|
| 20 |
class normal_distribution {
|
| 21 |
public:
|
| 22 |
// types
|
| 23 |
using result_type = RealType;
|
|
@@ -27,10 +28,13 @@ template<class RealType = double>
|
|
| 27 |
normal_distribution() : normal_distribution(0.0) {}
|
| 28 |
explicit normal_distribution(RealType mean, RealType stddev = 1.0);
|
| 29 |
explicit normal_distribution(const param_type& parm);
|
| 30 |
void reset();
|
| 31 |
|
|
|
|
|
|
|
|
|
|
| 32 |
// generating functions
|
| 33 |
template<class URBG>
|
| 34 |
result_type operator()(URBG& g);
|
| 35 |
template<class URBG>
|
| 36 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -40,11 +44,20 @@ template<class RealType = double>
|
|
| 40 |
RealType stddev() const;
|
| 41 |
param_type param() const;
|
| 42 |
void param(const param_type& parm);
|
| 43 |
result_type min() const;
|
| 44 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
};
|
|
|
|
| 46 |
```
|
| 47 |
|
| 48 |
``` cpp
|
| 49 |
explicit normal_distribution(RealType mean, RealType stddev = 1.0);
|
| 50 |
```
|
|
@@ -75,10 +88,11 @@ numbers x > 0 distributed according to the probability density function
|
|
| 75 |
$$p(x\,|\,m,s) = \frac{1}{s x \sqrt{2 \pi}}
|
| 76 |
\cdot \exp{\left(-\frac{(\ln{x} - m)^2}{2 s^2}\right)}
|
| 77 |
\text{ .}$$
|
| 78 |
|
| 79 |
``` cpp
|
|
|
|
| 80 |
template<class RealType = double>
|
| 81 |
class lognormal_distribution {
|
| 82 |
public:
|
| 83 |
// types
|
| 84 |
using result_type = RealType;
|
|
@@ -88,10 +102,13 @@ template<class RealType = double>
|
|
| 88 |
lognormal_distribution() : lognormal_distribution(0.0) {}
|
| 89 |
explicit lognormal_distribution(RealType m, RealType s = 1.0);
|
| 90 |
explicit lognormal_distribution(const param_type& parm);
|
| 91 |
void reset();
|
| 92 |
|
|
|
|
|
|
|
|
|
|
| 93 |
// generating functions
|
| 94 |
template<class URBG>
|
| 95 |
result_type operator()(URBG& g);
|
| 96 |
template<class URBG>
|
| 97 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -101,11 +118,20 @@ template<class RealType = double>
|
|
| 101 |
RealType s() const;
|
| 102 |
param_type param() const;
|
| 103 |
void param(const param_type& parm);
|
| 104 |
result_type min() const;
|
| 105 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
};
|
|
|
|
| 107 |
```
|
| 108 |
|
| 109 |
``` cpp
|
| 110 |
explicit lognormal_distribution(RealType m, RealType s = 1.0);
|
| 111 |
```
|
|
@@ -134,10 +160,11 @@ constructed.
|
|
| 134 |
A `chi_squared_distribution` random number distribution produces random
|
| 135 |
numbers x > 0 distributed according to the probability density function
|
| 136 |
$$p(x\,|\,n) = \frac{x^{(n/2)-1} \cdot e^{-x/2}}{\Gamma(n/2) \cdot 2^{n/2}} \text{ .}$$
|
| 137 |
|
| 138 |
``` cpp
|
|
|
|
| 139 |
template<class RealType = double>
|
| 140 |
class chi_squared_distribution {
|
| 141 |
public:
|
| 142 |
// types
|
| 143 |
using result_type = RealType;
|
|
@@ -147,10 +174,13 @@ template<class RealType = double>
|
|
| 147 |
chi_squared_distribution() : chi_squared_distribution(1.0) {}
|
| 148 |
explicit chi_squared_distribution(RealType n);
|
| 149 |
explicit chi_squared_distribution(const param_type& parm);
|
| 150 |
void reset();
|
| 151 |
|
|
|
|
|
|
|
|
|
|
| 152 |
// generating functions
|
| 153 |
template<class URBG>
|
| 154 |
result_type operator()(URBG& g);
|
| 155 |
template<class URBG>
|
| 156 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -159,11 +189,20 @@ template<class RealType = double>
|
|
| 159 |
RealType n() const;
|
| 160 |
param_type param() const;
|
| 161 |
void param(const param_type& parm);
|
| 162 |
result_type min() const;
|
| 163 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
};
|
|
|
|
| 165 |
```
|
| 166 |
|
| 167 |
``` cpp
|
| 168 |
explicit chi_squared_distribution(RealType n);
|
| 169 |
```
|
|
@@ -184,10 +223,11 @@ constructed.
|
|
| 184 |
A `cauchy_distribution` random number distribution produces random
|
| 185 |
numbers x distributed according to the probability density function
|
| 186 |
$$p(x\,|\,a,b) = \left(\pi b \left(1 + \left(\frac{x-a}{b} \right)^2 \, \right)\right)^{-1} \text{ .}$$
|
| 187 |
|
| 188 |
``` cpp
|
|
|
|
| 189 |
template<class RealType = double>
|
| 190 |
class cauchy_distribution {
|
| 191 |
public:
|
| 192 |
// types
|
| 193 |
using result_type = RealType;
|
|
@@ -197,10 +237,13 @@ template<class RealType = double>
|
|
| 197 |
cauchy_distribution() : cauchy_distribution(0.0) {}
|
| 198 |
explicit cauchy_distribution(RealType a, RealType b = 1.0);
|
| 199 |
explicit cauchy_distribution(const param_type& parm);
|
| 200 |
void reset();
|
| 201 |
|
|
|
|
|
|
|
|
|
|
| 202 |
// generating functions
|
| 203 |
template<class URBG>
|
| 204 |
result_type operator()(URBG& g);
|
| 205 |
template<class URBG>
|
| 206 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -210,11 +253,20 @@ template<class RealType = double>
|
|
| 210 |
RealType b() const;
|
| 211 |
param_type param() const;
|
| 212 |
void param(const param_type& parm);
|
| 213 |
result_type min() const;
|
| 214 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
};
|
|
|
|
| 216 |
```
|
| 217 |
|
| 218 |
``` cpp
|
| 219 |
explicit cauchy_distribution(RealType a, RealType b = 1.0);
|
| 220 |
```
|
|
@@ -247,10 +299,11 @@ $$p(x\,|\,m,n) = \frac{\Gamma\big((m+n)/2\big)}{\Gamma(m/2) \; \Gamma(n/2)}
|
|
| 247 |
\cdot x^{(m/2)-1}
|
| 248 |
\cdot \left(1 + \frac{m x}{n}\right)^{-(m + n)/2}
|
| 249 |
\text{ .}$$
|
| 250 |
|
| 251 |
``` cpp
|
|
|
|
| 252 |
template<class RealType = double>
|
| 253 |
class fisher_f_distribution {
|
| 254 |
public:
|
| 255 |
// types
|
| 256 |
using result_type = RealType;
|
|
@@ -260,10 +313,13 @@ template<class RealType = double>
|
|
| 260 |
fisher_f_distribution() : fisher_f_distribution(1.0) {}
|
| 261 |
explicit fisher_f_distribution(RealType m, RealType n = 1.0);
|
| 262 |
explicit fisher_f_distribution(const param_type& parm);
|
| 263 |
void reset();
|
| 264 |
|
|
|
|
|
|
|
|
|
|
| 265 |
// generating functions
|
| 266 |
template<class URBG>
|
| 267 |
result_type operator()(URBG& g);
|
| 268 |
template<class URBG>
|
| 269 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -273,11 +329,20 @@ template<class RealType = double>
|
|
| 273 |
RealType n() const;
|
| 274 |
param_type param() const;
|
| 275 |
void param(const param_type& parm);
|
| 276 |
result_type min() const;
|
| 277 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
};
|
|
|
|
| 279 |
```
|
| 280 |
|
| 281 |
``` cpp
|
| 282 |
explicit fisher_f_distribution(RealType m, RealType n = 1);
|
| 283 |
```
|
|
@@ -309,10 +374,11 @@ $$p(x\,|\,n) = \frac{1}{\sqrt{n \pi}}
|
|
| 309 |
\cdot \frac{\Gamma\big((n+1)/2\big)}{\Gamma(n/2)}
|
| 310 |
\cdot \left(1 + \frac{x^2}{n} \right)^{-(n+1)/2}
|
| 311 |
\text{ .}$$
|
| 312 |
|
| 313 |
``` cpp
|
|
|
|
| 314 |
template<class RealType = double>
|
| 315 |
class student_t_distribution {
|
| 316 |
public:
|
| 317 |
// types
|
| 318 |
using result_type = RealType;
|
|
@@ -322,10 +388,13 @@ template<class RealType = double>
|
|
| 322 |
student_t_distribution() : student_t_distribution(1.0) {}
|
| 323 |
explicit student_t_distribution(RealType n);
|
| 324 |
explicit student_t_distribution(const param_type& parm);
|
| 325 |
void reset();
|
| 326 |
|
|
|
|
|
|
|
|
|
|
| 327 |
// generating functions
|
| 328 |
template<class URBG>
|
| 329 |
result_type operator()(URBG& g);
|
| 330 |
template<class URBG>
|
| 331 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -334,11 +403,20 @@ template<class RealType = double>
|
|
| 334 |
RealType n() const;
|
| 335 |
param_type param() const;
|
| 336 |
void param(const param_type& parm);
|
| 337 |
result_type min() const;
|
| 338 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 339 |
};
|
|
|
|
| 340 |
```
|
| 341 |
|
| 342 |
``` cpp
|
| 343 |
explicit student_t_distribution(RealType n);
|
| 344 |
```
|
|
|
|
| 14 |
}
|
| 15 |
\text{ .}$$ The distribution parameters μ and σ are also known as this
|
| 16 |
distribution’s *mean* and *standard deviation*.
|
| 17 |
|
| 18 |
``` cpp
|
| 19 |
+
namespace std {
|
| 20 |
template<class RealType = double>
|
| 21 |
class normal_distribution {
|
| 22 |
public:
|
| 23 |
// types
|
| 24 |
using result_type = RealType;
|
|
|
|
| 28 |
normal_distribution() : normal_distribution(0.0) {}
|
| 29 |
explicit normal_distribution(RealType mean, RealType stddev = 1.0);
|
| 30 |
explicit normal_distribution(const param_type& parm);
|
| 31 |
void reset();
|
| 32 |
|
| 33 |
+
// equality operators
|
| 34 |
+
friend bool operator==(const normal_distribution& x, const normal_distribution& y);
|
| 35 |
+
|
| 36 |
// generating functions
|
| 37 |
template<class URBG>
|
| 38 |
result_type operator()(URBG& g);
|
| 39 |
template<class URBG>
|
| 40 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 44 |
RealType stddev() const;
|
| 45 |
param_type param() const;
|
| 46 |
void param(const param_type& parm);
|
| 47 |
result_type min() const;
|
| 48 |
result_type max() const;
|
| 49 |
+
|
| 50 |
+
// inserters and extractors
|
| 51 |
+
template<class charT, class traits>
|
| 52 |
+
friend basic_ostream<charT, traits>&
|
| 53 |
+
operator<<(basic_ostream<charT, traits>& os, const normal_distribution& x);
|
| 54 |
+
template<class charT, class traits>
|
| 55 |
+
friend basic_istream<charT, traits>&
|
| 56 |
+
operator>>(basic_istream<charT, traits>& is, normal_distribution& x);
|
| 57 |
};
|
| 58 |
+
}
|
| 59 |
```
|
| 60 |
|
| 61 |
``` cpp
|
| 62 |
explicit normal_distribution(RealType mean, RealType stddev = 1.0);
|
| 63 |
```
|
|
|
|
| 88 |
$$p(x\,|\,m,s) = \frac{1}{s x \sqrt{2 \pi}}
|
| 89 |
\cdot \exp{\left(-\frac{(\ln{x} - m)^2}{2 s^2}\right)}
|
| 90 |
\text{ .}$$
|
| 91 |
|
| 92 |
``` cpp
|
| 93 |
+
namespace std {
|
| 94 |
template<class RealType = double>
|
| 95 |
class lognormal_distribution {
|
| 96 |
public:
|
| 97 |
// types
|
| 98 |
using result_type = RealType;
|
|
|
|
| 102 |
lognormal_distribution() : lognormal_distribution(0.0) {}
|
| 103 |
explicit lognormal_distribution(RealType m, RealType s = 1.0);
|
| 104 |
explicit lognormal_distribution(const param_type& parm);
|
| 105 |
void reset();
|
| 106 |
|
| 107 |
+
// equality operators
|
| 108 |
+
friend bool operator==(const lognormal_distribution& x, const lognormal_distribution& y);
|
| 109 |
+
|
| 110 |
// generating functions
|
| 111 |
template<class URBG>
|
| 112 |
result_type operator()(URBG& g);
|
| 113 |
template<class URBG>
|
| 114 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 118 |
RealType s() const;
|
| 119 |
param_type param() const;
|
| 120 |
void param(const param_type& parm);
|
| 121 |
result_type min() const;
|
| 122 |
result_type max() const;
|
| 123 |
+
|
| 124 |
+
// inserters and extractors
|
| 125 |
+
template<class charT, class traits>
|
| 126 |
+
friend basic_ostream<charT, traits>&
|
| 127 |
+
operator<<(basic_ostream<charT, traits>& os, const lognormal_distribution& x);
|
| 128 |
+
template<class charT, class traits>
|
| 129 |
+
friend basic_istream<charT, traits>&
|
| 130 |
+
operator>>(basic_istream<charT, traits>& is, lognormal_distribution& x);
|
| 131 |
};
|
| 132 |
+
}
|
| 133 |
```
|
| 134 |
|
| 135 |
``` cpp
|
| 136 |
explicit lognormal_distribution(RealType m, RealType s = 1.0);
|
| 137 |
```
|
|
|
|
| 160 |
A `chi_squared_distribution` random number distribution produces random
|
| 161 |
numbers x > 0 distributed according to the probability density function
|
| 162 |
$$p(x\,|\,n) = \frac{x^{(n/2)-1} \cdot e^{-x/2}}{\Gamma(n/2) \cdot 2^{n/2}} \text{ .}$$
|
| 163 |
|
| 164 |
``` cpp
|
| 165 |
+
namespace std {
|
| 166 |
template<class RealType = double>
|
| 167 |
class chi_squared_distribution {
|
| 168 |
public:
|
| 169 |
// types
|
| 170 |
using result_type = RealType;
|
|
|
|
| 174 |
chi_squared_distribution() : chi_squared_distribution(1.0) {}
|
| 175 |
explicit chi_squared_distribution(RealType n);
|
| 176 |
explicit chi_squared_distribution(const param_type& parm);
|
| 177 |
void reset();
|
| 178 |
|
| 179 |
+
// equality operators
|
| 180 |
+
friend bool operator==(const chi_squared_distribution& x, const chi_squared_distribution& y);
|
| 181 |
+
|
| 182 |
// generating functions
|
| 183 |
template<class URBG>
|
| 184 |
result_type operator()(URBG& g);
|
| 185 |
template<class URBG>
|
| 186 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 189 |
RealType n() const;
|
| 190 |
param_type param() const;
|
| 191 |
void param(const param_type& parm);
|
| 192 |
result_type min() const;
|
| 193 |
result_type max() const;
|
| 194 |
+
|
| 195 |
+
// inserters and extractors
|
| 196 |
+
template<class charT, class traits>
|
| 197 |
+
friend basic_ostream<charT, traits>&
|
| 198 |
+
operator<<(basic_ostream<charT, traits>& os, const chi_squared_distribution& x);
|
| 199 |
+
template<class charT, class traits>
|
| 200 |
+
friend basic_istream<charT, traits>&
|
| 201 |
+
operator>>(basic_istream<charT, traits>& is, chi_squared_distribution& x);
|
| 202 |
};
|
| 203 |
+
}
|
| 204 |
```
|
| 205 |
|
| 206 |
``` cpp
|
| 207 |
explicit chi_squared_distribution(RealType n);
|
| 208 |
```
|
|
|
|
| 223 |
A `cauchy_distribution` random number distribution produces random
|
| 224 |
numbers x distributed according to the probability density function
|
| 225 |
$$p(x\,|\,a,b) = \left(\pi b \left(1 + \left(\frac{x-a}{b} \right)^2 \, \right)\right)^{-1} \text{ .}$$
|
| 226 |
|
| 227 |
``` cpp
|
| 228 |
+
namespace std {
|
| 229 |
template<class RealType = double>
|
| 230 |
class cauchy_distribution {
|
| 231 |
public:
|
| 232 |
// types
|
| 233 |
using result_type = RealType;
|
|
|
|
| 237 |
cauchy_distribution() : cauchy_distribution(0.0) {}
|
| 238 |
explicit cauchy_distribution(RealType a, RealType b = 1.0);
|
| 239 |
explicit cauchy_distribution(const param_type& parm);
|
| 240 |
void reset();
|
| 241 |
|
| 242 |
+
// equality operators
|
| 243 |
+
friend bool operator==(const cauchy_distribution& x, const cauchy_distribution& y);
|
| 244 |
+
|
| 245 |
// generating functions
|
| 246 |
template<class URBG>
|
| 247 |
result_type operator()(URBG& g);
|
| 248 |
template<class URBG>
|
| 249 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 253 |
RealType b() const;
|
| 254 |
param_type param() const;
|
| 255 |
void param(const param_type& parm);
|
| 256 |
result_type min() const;
|
| 257 |
result_type max() const;
|
| 258 |
+
|
| 259 |
+
// inserters and extractors
|
| 260 |
+
template<class charT, class traits>
|
| 261 |
+
friend basic_ostream<charT, traits>&
|
| 262 |
+
operator<<(basic_ostream<charT, traits>& os, const cauchy_distribution& x);
|
| 263 |
+
template<class charT, class traits>
|
| 264 |
+
friend basic_istream<charT, traits>&
|
| 265 |
+
operator>>(basic_istream<charT, traits>& is, cauchy_distribution& x);
|
| 266 |
};
|
| 267 |
+
}
|
| 268 |
```
|
| 269 |
|
| 270 |
``` cpp
|
| 271 |
explicit cauchy_distribution(RealType a, RealType b = 1.0);
|
| 272 |
```
|
|
|
|
| 299 |
\cdot x^{(m/2)-1}
|
| 300 |
\cdot \left(1 + \frac{m x}{n}\right)^{-(m + n)/2}
|
| 301 |
\text{ .}$$
|
| 302 |
|
| 303 |
``` cpp
|
| 304 |
+
namespace std {
|
| 305 |
template<class RealType = double>
|
| 306 |
class fisher_f_distribution {
|
| 307 |
public:
|
| 308 |
// types
|
| 309 |
using result_type = RealType;
|
|
|
|
| 313 |
fisher_f_distribution() : fisher_f_distribution(1.0) {}
|
| 314 |
explicit fisher_f_distribution(RealType m, RealType n = 1.0);
|
| 315 |
explicit fisher_f_distribution(const param_type& parm);
|
| 316 |
void reset();
|
| 317 |
|
| 318 |
+
// equality operators
|
| 319 |
+
friend bool operator==(const fisher_f_distribution& x, const fisher_f_distribution& y);
|
| 320 |
+
|
| 321 |
// generating functions
|
| 322 |
template<class URBG>
|
| 323 |
result_type operator()(URBG& g);
|
| 324 |
template<class URBG>
|
| 325 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 329 |
RealType n() const;
|
| 330 |
param_type param() const;
|
| 331 |
void param(const param_type& parm);
|
| 332 |
result_type min() const;
|
| 333 |
result_type max() const;
|
| 334 |
+
|
| 335 |
+
// inserters and extractors
|
| 336 |
+
template<class charT, class traits>
|
| 337 |
+
friend basic_ostream<charT, traits>&
|
| 338 |
+
operator<<(basic_ostream<charT, traits>& os, const fisher_f_distribution& x);
|
| 339 |
+
template<class charT, class traits>
|
| 340 |
+
friend basic_istream<charT, traits>&
|
| 341 |
+
operator>>(basic_istream<charT, traits>& is, fisher_f_distribution& x);
|
| 342 |
};
|
| 343 |
+
}
|
| 344 |
```
|
| 345 |
|
| 346 |
``` cpp
|
| 347 |
explicit fisher_f_distribution(RealType m, RealType n = 1);
|
| 348 |
```
|
|
|
|
| 374 |
\cdot \frac{\Gamma\big((n+1)/2\big)}{\Gamma(n/2)}
|
| 375 |
\cdot \left(1 + \frac{x^2}{n} \right)^{-(n+1)/2}
|
| 376 |
\text{ .}$$
|
| 377 |
|
| 378 |
``` cpp
|
| 379 |
+
namespace std {
|
| 380 |
template<class RealType = double>
|
| 381 |
class student_t_distribution {
|
| 382 |
public:
|
| 383 |
// types
|
| 384 |
using result_type = RealType;
|
|
|
|
| 388 |
student_t_distribution() : student_t_distribution(1.0) {}
|
| 389 |
explicit student_t_distribution(RealType n);
|
| 390 |
explicit student_t_distribution(const param_type& parm);
|
| 391 |
void reset();
|
| 392 |
|
| 393 |
+
// equality operators
|
| 394 |
+
friend bool operator==(const student_t_distribution& x, const student_t_distribution& y);
|
| 395 |
+
|
| 396 |
// generating functions
|
| 397 |
template<class URBG>
|
| 398 |
result_type operator()(URBG& g);
|
| 399 |
template<class URBG>
|
| 400 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 403 |
RealType n() const;
|
| 404 |
param_type param() const;
|
| 405 |
void param(const param_type& parm);
|
| 406 |
result_type min() const;
|
| 407 |
result_type max() const;
|
| 408 |
+
|
| 409 |
+
// inserters and extractors
|
| 410 |
+
template<class charT, class traits>
|
| 411 |
+
friend basic_ostream<charT, traits>&
|
| 412 |
+
operator<<(basic_ostream<charT, traits>& os, const student_t_distribution& x);
|
| 413 |
+
template<class charT, class traits>
|
| 414 |
+
friend basic_istream<charT, traits>&
|
| 415 |
+
operator>>(basic_istream<charT, traits>& is, student_t_distribution& x);
|
| 416 |
};
|
| 417 |
+
}
|
| 418 |
```
|
| 419 |
|
| 420 |
``` cpp
|
| 421 |
explicit student_t_distribution(RealType n);
|
| 422 |
```
|