tmp/tmp8w__d4zi/{from.md → to.md}
RENAMED
|
@@ -8,27 +8,26 @@ probability function $$%
|
|
| 8 |
P(i\,|\,a,b) = 1 / (b - a + 1)
|
| 9 |
\; \mbox{.}$$
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
template<class IntType = int>
|
| 13 |
-
|
| 14 |
-
{
|
| 15 |
public:
|
| 16 |
// types
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
// constructors and reset functions
|
| 21 |
explicit uniform_int_distribution(IntType a = 0, IntType b = numeric_limits<IntType>::max());
|
| 22 |
explicit uniform_int_distribution(const param_type& parm);
|
| 23 |
void reset();
|
| 24 |
|
| 25 |
// generating functions
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
|
| 31 |
// property functions
|
| 32 |
result_type a() const;
|
| 33 |
result_type b() const;
|
| 34 |
param_type param() const;
|
|
@@ -67,29 +66,31 @@ A `uniform_real_distribution` random number distribution produces random
|
|
| 67 |
numbers x, a ≤ x < b, distributed according to the constant probability
|
| 68 |
density function $$%
|
| 69 |
p(x\,|\,a,b) = 1 / (b - a)
|
| 70 |
\; \mbox{.}$$
|
| 71 |
|
|
|
|
|
|
|
|
|
|
| 72 |
``` cpp
|
| 73 |
template<class RealType = double>
|
| 74 |
-
|
| 75 |
-
{
|
| 76 |
public:
|
| 77 |
// types
|
| 78 |
-
|
| 79 |
-
|
| 80 |
|
| 81 |
// constructors and reset functions
|
| 82 |
explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0);
|
| 83 |
explicit uniform_real_distribution(const param_type& parm);
|
| 84 |
void reset();
|
| 85 |
|
| 86 |
// generating functions
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
|
| 92 |
// property functions
|
| 93 |
result_type a() const;
|
| 94 |
result_type b() const;
|
| 95 |
param_type param() const;
|
|
|
|
| 8 |
P(i\,|\,a,b) = 1 / (b - a + 1)
|
| 9 |
\; \mbox{.}$$
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
template<class IntType = int>
|
| 13 |
+
class uniform_int_distribution {
|
|
|
|
| 14 |
public:
|
| 15 |
// types
|
| 16 |
+
using result_type = IntType;
|
| 17 |
+
using param_type = unspecified;
|
| 18 |
|
| 19 |
// constructors and reset functions
|
| 20 |
explicit uniform_int_distribution(IntType a = 0, IntType b = numeric_limits<IntType>::max());
|
| 21 |
explicit uniform_int_distribution(const param_type& parm);
|
| 22 |
void reset();
|
| 23 |
|
| 24 |
// generating functions
|
| 25 |
+
template<class URBG>
|
| 26 |
+
result_type operator()(URBG& g);
|
| 27 |
+
template<class URBG>
|
| 28 |
+
result_type operator()(URBG& g, const param_type& parm);
|
| 29 |
|
| 30 |
// property functions
|
| 31 |
result_type a() const;
|
| 32 |
result_type b() const;
|
| 33 |
param_type param() const;
|
|
|
|
| 66 |
numbers x, a ≤ x < b, distributed according to the constant probability
|
| 67 |
density function $$%
|
| 68 |
p(x\,|\,a,b) = 1 / (b - a)
|
| 69 |
\; \mbox{.}$$
|
| 70 |
|
| 71 |
+
[*Note 1*: This implies that p(x | a,b) is undefined when
|
| 72 |
+
`a == b`. — *end note*]
|
| 73 |
+
|
| 74 |
``` cpp
|
| 75 |
template<class RealType = double>
|
| 76 |
+
class uniform_real_distribution {
|
|
|
|
| 77 |
public:
|
| 78 |
// types
|
| 79 |
+
using result_type = RealType;
|
| 80 |
+
using param_type = unspecified;
|
| 81 |
|
| 82 |
// constructors and reset functions
|
| 83 |
explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0);
|
| 84 |
explicit uniform_real_distribution(const param_type& parm);
|
| 85 |
void reset();
|
| 86 |
|
| 87 |
// generating functions
|
| 88 |
+
template<class URBG>
|
| 89 |
+
result_type operator()(URBG& g);
|
| 90 |
+
template<class URBG>
|
| 91 |
+
result_type operator()(URBG& g, const param_type& parm);
|
| 92 |
|
| 93 |
// property functions
|
| 94 |
result_type a() const;
|
| 95 |
result_type b() const;
|
| 96 |
param_type param() const;
|