tmp/tmplrr_3oqs/{from.md → to.md}
RENAMED
|
@@ -1,14 +1,17 @@
|
|
| 1 |
##### Class template `extreme_value_distribution` <a id="rand.dist.pois.extreme">[[rand.dist.pois.extreme]]</a>
|
| 2 |
|
| 3 |
An `extreme_value_distribution` random number distribution produces
|
| 4 |
random numbers x distributed according to the probability density
|
| 5 |
-
function[^
|
|
|
|
|
|
|
| 6 |
\cdot \exp\left(\frac{a-x}{b} - \exp\left(\frac{a-x}{b}\right)\right)
|
| 7 |
\text{ .}$$
|
| 8 |
|
| 9 |
``` cpp
|
|
|
|
| 10 |
template<class RealType = double>
|
| 11 |
class extreme_value_distribution {
|
| 12 |
public:
|
| 13 |
// types
|
| 14 |
using result_type = RealType;
|
|
@@ -18,10 +21,14 @@ template<class RealType = double>
|
|
| 18 |
extreme_value_distribution() : extreme_value_distribution(0.0) {}
|
| 19 |
explicit extreme_value_distribution(RealType a, RealType b = 1.0);
|
| 20 |
explicit extreme_value_distribution(const param_type& parm);
|
| 21 |
void reset();
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
// generating functions
|
| 24 |
template<class URBG>
|
| 25 |
result_type operator()(URBG& g);
|
| 26 |
template<class URBG>
|
| 27 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -31,11 +38,20 @@ template<class RealType = double>
|
|
| 31 |
RealType b() const;
|
| 32 |
param_type param() const;
|
| 33 |
void param(const param_type& parm);
|
| 34 |
result_type min() const;
|
| 35 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
};
|
|
|
|
| 37 |
```
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
explicit extreme_value_distribution(RealType a, RealType b = 1.0);
|
| 41 |
```
|
|
|
|
| 1 |
##### Class template `extreme_value_distribution` <a id="rand.dist.pois.extreme">[[rand.dist.pois.extreme]]</a>
|
| 2 |
|
| 3 |
An `extreme_value_distribution` random number distribution produces
|
| 4 |
random numbers x distributed according to the probability density
|
| 5 |
+
function[^7]
|
| 6 |
+
|
| 7 |
+
$$p(x\,|\,a,b) = \frac{1}{b}
|
| 8 |
\cdot \exp\left(\frac{a-x}{b} - \exp\left(\frac{a-x}{b}\right)\right)
|
| 9 |
\text{ .}$$
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
+
namespace std {
|
| 13 |
template<class RealType = double>
|
| 14 |
class extreme_value_distribution {
|
| 15 |
public:
|
| 16 |
// types
|
| 17 |
using result_type = RealType;
|
|
|
|
| 21 |
extreme_value_distribution() : extreme_value_distribution(0.0) {}
|
| 22 |
explicit extreme_value_distribution(RealType a, RealType b = 1.0);
|
| 23 |
explicit extreme_value_distribution(const param_type& parm);
|
| 24 |
void reset();
|
| 25 |
|
| 26 |
+
// equality operators
|
| 27 |
+
friend bool operator==(const extreme_value_distribution& x,
|
| 28 |
+
const extreme_value_distribution& y);
|
| 29 |
+
|
| 30 |
// generating functions
|
| 31 |
template<class URBG>
|
| 32 |
result_type operator()(URBG& g);
|
| 33 |
template<class URBG>
|
| 34 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 38 |
RealType b() const;
|
| 39 |
param_type param() const;
|
| 40 |
void param(const param_type& parm);
|
| 41 |
result_type min() const;
|
| 42 |
result_type max() const;
|
| 43 |
+
|
| 44 |
+
// inserters and extractors
|
| 45 |
+
template<class charT, class traits>
|
| 46 |
+
friend basic_ostream<charT, traits>&
|
| 47 |
+
operator<<(basic_ostream<charT, traits>& os, const extreme_value_distribution& x);
|
| 48 |
+
template<class charT, class traits>
|
| 49 |
+
friend basic_istream<charT, traits>&
|
| 50 |
+
operator>>(basic_istream<charT, traits>& is, extreme_value_distribution& x);
|
| 51 |
};
|
| 52 |
+
}
|
| 53 |
```
|
| 54 |
|
| 55 |
``` cpp
|
| 56 |
explicit extreme_value_distribution(RealType a, RealType b = 1.0);
|
| 57 |
```
|