tmp/tmp2aycukvf/{from.md → to.md}
RENAMED
|
@@ -1,12 +1,10 @@
|
|
| 1 |
##### Class template `uniform_real_distribution` <a id="rand.dist.uni.real">[[rand.dist.uni.real]]</a>
|
| 2 |
|
| 3 |
A `uniform_real_distribution` random number distribution produces random
|
| 4 |
numbers x, a ≤ x < b, distributed according to the constant probability
|
| 5 |
-
density function $$
|
| 6 |
-
p(x\,|\,a,b) = 1 / (b - a)
|
| 7 |
-
\; \mbox{.}$$
|
| 8 |
|
| 9 |
[*Note 1*: This implies that p(x | a,b) is undefined when
|
| 10 |
`a == b`. — *end note*]
|
| 11 |
|
| 12 |
``` cpp
|
|
@@ -16,11 +14,12 @@ template<class RealType = double>
|
|
| 16 |
// types
|
| 17 |
using result_type = RealType;
|
| 18 |
using param_type = unspecified;
|
| 19 |
|
| 20 |
// constructors and reset functions
|
| 21 |
-
|
|
|
|
| 22 |
explicit uniform_real_distribution(const param_type& parm);
|
| 23 |
void reset();
|
| 24 |
|
| 25 |
// generating functions
|
| 26 |
template<class URBG>
|
|
@@ -37,17 +36,18 @@ template<class RealType = double>
|
|
| 37 |
result_type max() const;
|
| 38 |
};
|
| 39 |
```
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
-
explicit uniform_real_distribution(RealType a
|
| 43 |
```
|
| 44 |
|
| 45 |
-
*
|
|
|
|
| 46 |
|
| 47 |
-
*
|
| 48 |
-
|
| 49 |
|
| 50 |
``` cpp
|
| 51 |
result_type a() const;
|
| 52 |
```
|
| 53 |
|
|
|
|
| 1 |
##### Class template `uniform_real_distribution` <a id="rand.dist.uni.real">[[rand.dist.uni.real]]</a>
|
| 2 |
|
| 3 |
A `uniform_real_distribution` random number distribution produces random
|
| 4 |
numbers x, a ≤ x < b, distributed according to the constant probability
|
| 5 |
+
density function $$p(x\,|\,a,b) = 1 / (b - a) \text{ .}$$
|
|
|
|
|
|
|
| 6 |
|
| 7 |
[*Note 1*: This implies that p(x | a,b) is undefined when
|
| 8 |
`a == b`. — *end note*]
|
| 9 |
|
| 10 |
``` cpp
|
|
|
|
| 14 |
// types
|
| 15 |
using result_type = RealType;
|
| 16 |
using param_type = unspecified;
|
| 17 |
|
| 18 |
// constructors and reset functions
|
| 19 |
+
uniform_real_distribution() : uniform_real_distribution(0.0) {}
|
| 20 |
+
explicit uniform_real_distribution(RealType a, RealType b = 1.0);
|
| 21 |
explicit uniform_real_distribution(const param_type& parm);
|
| 22 |
void reset();
|
| 23 |
|
| 24 |
// generating functions
|
| 25 |
template<class URBG>
|
|
|
|
| 36 |
result_type max() const;
|
| 37 |
};
|
| 38 |
```
|
| 39 |
|
| 40 |
``` cpp
|
| 41 |
+
explicit uniform_real_distribution(RealType a, RealType b = 1.0);
|
| 42 |
```
|
| 43 |
|
| 44 |
+
*Preconditions:* `a` ≤ `b` and
|
| 45 |
+
`b` - `a` ≤ `numeric_limits<RealType>::max()`.
|
| 46 |
|
| 47 |
+
*Remarks:* `a` and `b` correspond to the respective parameters of the
|
| 48 |
+
distribution.
|
| 49 |
|
| 50 |
``` cpp
|
| 51 |
result_type a() const;
|
| 52 |
```
|
| 53 |
|