tmp/tmpkuec0iv6/{from.md → to.md}
RENAMED
|
@@ -16,10 +16,11 @@ in which the values wₖ, commonly known as the *weights at boundaries* ,
|
|
| 16 |
shall be non-negative, non-NaN, and non-infinity. Moreover, the
|
| 17 |
following relation shall hold:
|
| 18 |
$$0 < S = \frac{1}{2} \cdot \sum_{k=0}^{n-1} (w_k + w_{k+1}) \cdot (b_{k+1} - b_k) \text{ .}$$
|
| 19 |
|
| 20 |
``` cpp
|
|
|
|
| 21 |
template<class RealType = double>
|
| 22 |
class piecewise_linear_distribution {
|
| 23 |
public:
|
| 24 |
// types
|
| 25 |
using result_type = RealType;
|
|
@@ -35,10 +36,14 @@ template<class RealType = double>
|
|
| 35 |
template<class UnaryOperation>
|
| 36 |
piecewise_linear_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw);
|
| 37 |
explicit piecewise_linear_distribution(const param_type& parm);
|
| 38 |
void reset();
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
// generating functions
|
| 41 |
template<class URBG>
|
| 42 |
result_type operator()(URBG& g);
|
| 43 |
template<class URBG>
|
| 44 |
result_type operator()(URBG& g, const param_type& parm);
|
|
@@ -48,11 +53,20 @@ template<class RealType = double>
|
|
| 48 |
vector<result_type> densities() const;
|
| 49 |
param_type param() const;
|
| 50 |
void param(const param_type& parm);
|
| 51 |
result_type min() const;
|
| 52 |
result_type max() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
};
|
|
|
|
| 54 |
```
|
| 55 |
|
| 56 |
``` cpp
|
| 57 |
piecewise_linear_distribution();
|
| 58 |
```
|
|
|
|
| 16 |
shall be non-negative, non-NaN, and non-infinity. Moreover, the
|
| 17 |
following relation shall hold:
|
| 18 |
$$0 < S = \frac{1}{2} \cdot \sum_{k=0}^{n-1} (w_k + w_{k+1}) \cdot (b_{k+1} - b_k) \text{ .}$$
|
| 19 |
|
| 20 |
``` cpp
|
| 21 |
+
namespace std {
|
| 22 |
template<class RealType = double>
|
| 23 |
class piecewise_linear_distribution {
|
| 24 |
public:
|
| 25 |
// types
|
| 26 |
using result_type = RealType;
|
|
|
|
| 36 |
template<class UnaryOperation>
|
| 37 |
piecewise_linear_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw);
|
| 38 |
explicit piecewise_linear_distribution(const param_type& parm);
|
| 39 |
void reset();
|
| 40 |
|
| 41 |
+
// equality operators
|
| 42 |
+
friend bool operator==(const piecewise_linear_distribution& x,
|
| 43 |
+
const piecewise_linear_distribution& y);
|
| 44 |
+
|
| 45 |
// generating functions
|
| 46 |
template<class URBG>
|
| 47 |
result_type operator()(URBG& g);
|
| 48 |
template<class URBG>
|
| 49 |
result_type operator()(URBG& g, const param_type& parm);
|
|
|
|
| 53 |
vector<result_type> densities() const;
|
| 54 |
param_type param() const;
|
| 55 |
void param(const param_type& parm);
|
| 56 |
result_type min() const;
|
| 57 |
result_type max() const;
|
| 58 |
+
|
| 59 |
+
// inserters and extractors
|
| 60 |
+
template<class charT, class traits>
|
| 61 |
+
friend basic_ostream<charT, traits>&
|
| 62 |
+
operator<<(basic_ostream<charT, traits>& os, const piecewise_linear_distribution& x);
|
| 63 |
+
template<class charT, class traits>
|
| 64 |
+
friend basic_istream<charT, traits>&
|
| 65 |
+
operator>>(basic_istream<charT, traits>& is, piecewise_linear_distribution& x);
|
| 66 |
};
|
| 67 |
+
}
|
| 68 |
```
|
| 69 |
|
| 70 |
``` cpp
|
| 71 |
piecewise_linear_distribution();
|
| 72 |
```
|