tmp/tmpsw7i5a0h/{from.md → to.md}
RENAMED
|
@@ -15,16 +15,15 @@ the values wₖ, commonly known as the *weights* , shall be non-negative,
|
|
| 15 |
non-NaN, and non-infinity. Moreover, the following relation shall hold:
|
| 16 |
0 < S = w₀ + ⋯ + wₙ₋₁.
|
| 17 |
|
| 18 |
``` cpp
|
| 19 |
template<class IntType = int>
|
| 20 |
-
|
| 21 |
-
{
|
| 22 |
public:
|
| 23 |
// types
|
| 24 |
-
|
| 25 |
-
|
| 26 |
|
| 27 |
// constructor and reset functions
|
| 28 |
discrete_distribution();
|
| 29 |
template<class InputIterator>
|
| 30 |
discrete_distribution(InputIterator firstW, InputIterator lastW);
|
|
@@ -33,14 +32,14 @@ public:
|
|
| 33 |
discrete_distribution(size_t nw, double xmin, double xmax, UnaryOperation fw);
|
| 34 |
explicit discrete_distribution(const param_type& parm);
|
| 35 |
void reset();
|
| 36 |
|
| 37 |
// generating functions
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
|
| 43 |
// property functions
|
| 44 |
vector<double> probabilities() const;
|
| 45 |
param_type param() const;
|
| 46 |
void param(const param_type& parm);
|
|
@@ -52,19 +51,22 @@ public:
|
|
| 52 |
``` cpp
|
| 53 |
discrete_distribution();
|
| 54 |
```
|
| 55 |
|
| 56 |
*Effects:* Constructs a `discrete_distribution` object with n = 1 and
|
| 57 |
-
p₀ = 1.
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
``` cpp
|
| 60 |
template<class InputIterator>
|
| 61 |
discrete_distribution(InputIterator firstW, InputIterator lastW);
|
| 62 |
```
|
| 63 |
|
| 64 |
*Requires:* `InputIterator` shall satisfy the requirements of an input
|
| 65 |
-
iterator
|
| 66 |
`iterator_traits<InputIterator>::value_type` shall denote a type that is
|
| 67 |
convertible to `double`. If `firstW == lastW`, let n = 1 and w₀ = 1.
|
| 68 |
Otherwise, [`firstW`, `lastW`) shall form a sequence w of length n > 0.
|
| 69 |
|
| 70 |
*Effects:* Constructs a `discrete_distribution` object with
|
|
@@ -125,34 +127,34 @@ commonly known as the *weights* , shall be non-negative, non-NaN, and
|
|
| 125 |
non-infinity. Moreover, the following relation shall hold:
|
| 126 |
0 < S = w₀ + ⋯ + wₙ₋₁.
|
| 127 |
|
| 128 |
``` cpp
|
| 129 |
template<class RealType = double>
|
| 130 |
-
|
| 131 |
-
{
|
| 132 |
public:
|
| 133 |
// types
|
| 134 |
-
|
| 135 |
-
|
| 136 |
|
| 137 |
// constructor and reset functions
|
| 138 |
piecewise_constant_distribution();
|
| 139 |
template<class InputIteratorB, class InputIteratorW>
|
| 140 |
piecewise_constant_distribution(InputIteratorB firstB, InputIteratorB lastB,
|
| 141 |
InputIteratorW firstW);
|
| 142 |
template<class UnaryOperation>
|
| 143 |
piecewise_constant_distribution(initializer_list<RealType> bl, UnaryOperation fw);
|
| 144 |
template<class UnaryOperation>
|
| 145 |
-
|
|
|
|
| 146 |
explicit piecewise_constant_distribution(const param_type& parm);
|
| 147 |
void reset();
|
| 148 |
|
| 149 |
// generating functions
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
|
| 155 |
// property functions
|
| 156 |
vector<result_type> intervals() const;
|
| 157 |
vector<result_type> densities() const;
|
| 158 |
param_type param() const;
|
|
@@ -265,16 +267,15 @@ relation shall hold: $$%
|
|
| 265 |
\cdot \sum_{k=0}^{n-1} (w_k + w_{k+1}) \cdot (b_{k+1} - b_k)
|
| 266 |
\; \mbox{.}$$
|
| 267 |
|
| 268 |
``` cpp
|
| 269 |
template<class RealType = double>
|
| 270 |
-
|
| 271 |
-
{
|
| 272 |
public:
|
| 273 |
// types
|
| 274 |
-
|
| 275 |
-
|
| 276 |
|
| 277 |
// constructor and reset functions
|
| 278 |
piecewise_linear_distribution();
|
| 279 |
template<class InputIteratorB, class InputIteratorW>
|
| 280 |
piecewise_linear_distribution(InputIteratorB firstB, InputIteratorB lastB,
|
|
@@ -285,14 +286,14 @@ public:
|
|
| 285 |
piecewise_linear_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw);
|
| 286 |
explicit piecewise_linear_distribution(const param_type& parm);
|
| 287 |
void reset();
|
| 288 |
|
| 289 |
// generating functions
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
|
| 295 |
// property functions
|
| 296 |
vector<result_type> intervals() const;
|
| 297 |
vector<result_type> densities() const;
|
| 298 |
param_type param() const;
|
|
|
|
| 15 |
non-NaN, and non-infinity. Moreover, the following relation shall hold:
|
| 16 |
0 < S = w₀ + ⋯ + wₙ₋₁.
|
| 17 |
|
| 18 |
``` cpp
|
| 19 |
template<class IntType = int>
|
| 20 |
+
class discrete_distribution {
|
|
|
|
| 21 |
public:
|
| 22 |
// types
|
| 23 |
+
using result_type = IntType;
|
| 24 |
+
using param_type = unspecified;
|
| 25 |
|
| 26 |
// constructor and reset functions
|
| 27 |
discrete_distribution();
|
| 28 |
template<class InputIterator>
|
| 29 |
discrete_distribution(InputIterator firstW, InputIterator lastW);
|
|
|
|
| 32 |
discrete_distribution(size_t nw, double xmin, double xmax, UnaryOperation fw);
|
| 33 |
explicit discrete_distribution(const param_type& parm);
|
| 34 |
void reset();
|
| 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);
|
| 41 |
|
| 42 |
// property functions
|
| 43 |
vector<double> probabilities() const;
|
| 44 |
param_type param() const;
|
| 45 |
void param(const param_type& parm);
|
|
|
|
| 51 |
``` cpp
|
| 52 |
discrete_distribution();
|
| 53 |
```
|
| 54 |
|
| 55 |
*Effects:* Constructs a `discrete_distribution` object with n = 1 and
|
| 56 |
+
p₀ = 1.
|
| 57 |
+
|
| 58 |
+
[*Note 1*: Such an object will always deliver the value
|
| 59 |
+
0. — *end note*]
|
| 60 |
|
| 61 |
``` cpp
|
| 62 |
template<class InputIterator>
|
| 63 |
discrete_distribution(InputIterator firstW, InputIterator lastW);
|
| 64 |
```
|
| 65 |
|
| 66 |
*Requires:* `InputIterator` shall satisfy the requirements of an input
|
| 67 |
+
iterator ([[input.iterators]]). Moreover,
|
| 68 |
`iterator_traits<InputIterator>::value_type` shall denote a type that is
|
| 69 |
convertible to `double`. If `firstW == lastW`, let n = 1 and w₀ = 1.
|
| 70 |
Otherwise, [`firstW`, `lastW`) shall form a sequence w of length n > 0.
|
| 71 |
|
| 72 |
*Effects:* Constructs a `discrete_distribution` object with
|
|
|
|
| 127 |
non-infinity. Moreover, the following relation shall hold:
|
| 128 |
0 < S = w₀ + ⋯ + wₙ₋₁.
|
| 129 |
|
| 130 |
``` cpp
|
| 131 |
template<class RealType = double>
|
| 132 |
+
class piecewise_constant_distribution {
|
|
|
|
| 133 |
public:
|
| 134 |
// types
|
| 135 |
+
using result_type = RealType;
|
| 136 |
+
using param_type = unspecified;
|
| 137 |
|
| 138 |
// constructor and reset functions
|
| 139 |
piecewise_constant_distribution();
|
| 140 |
template<class InputIteratorB, class InputIteratorW>
|
| 141 |
piecewise_constant_distribution(InputIteratorB firstB, InputIteratorB lastB,
|
| 142 |
InputIteratorW firstW);
|
| 143 |
template<class UnaryOperation>
|
| 144 |
piecewise_constant_distribution(initializer_list<RealType> bl, UnaryOperation fw);
|
| 145 |
template<class UnaryOperation>
|
| 146 |
+
piecewise_constant_distribution(size_t nw, RealType xmin, RealType xmax,
|
| 147 |
+
UnaryOperation fw);
|
| 148 |
explicit piecewise_constant_distribution(const param_type& parm);
|
| 149 |
void reset();
|
| 150 |
|
| 151 |
// generating functions
|
| 152 |
+
template<class URBG>
|
| 153 |
+
result_type operator()(URBG& g);
|
| 154 |
+
template<class URBG>
|
| 155 |
+
result_type operator()(URBG& g, const param_type& parm);
|
| 156 |
|
| 157 |
// property functions
|
| 158 |
vector<result_type> intervals() const;
|
| 159 |
vector<result_type> densities() const;
|
| 160 |
param_type param() const;
|
|
|
|
| 267 |
\cdot \sum_{k=0}^{n-1} (w_k + w_{k+1}) \cdot (b_{k+1} - b_k)
|
| 268 |
\; \mbox{.}$$
|
| 269 |
|
| 270 |
``` cpp
|
| 271 |
template<class RealType = double>
|
| 272 |
+
class piecewise_linear_distribution {
|
|
|
|
| 273 |
public:
|
| 274 |
// types
|
| 275 |
+
using result_type = RealType;
|
| 276 |
+
using param_type = unspecified;
|
| 277 |
|
| 278 |
// constructor and reset functions
|
| 279 |
piecewise_linear_distribution();
|
| 280 |
template<class InputIteratorB, class InputIteratorW>
|
| 281 |
piecewise_linear_distribution(InputIteratorB firstB, InputIteratorB lastB,
|
|
|
|
| 286 |
piecewise_linear_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw);
|
| 287 |
explicit piecewise_linear_distribution(const param_type& parm);
|
| 288 |
void reset();
|
| 289 |
|
| 290 |
// generating functions
|
| 291 |
+
template<class URBG>
|
| 292 |
+
result_type operator()(URBG& g);
|
| 293 |
+
template<class URBG>
|
| 294 |
+
result_type operator()(URBG& g, const param_type& parm);
|
| 295 |
|
| 296 |
// property functions
|
| 297 |
vector<result_type> intervals() const;
|
| 298 |
vector<result_type> densities() const;
|
| 299 |
param_type param() const;
|