tmp/tmpdgqdsfyf/{from.md → to.md}
RENAMED
|
@@ -1,19 +1,7 @@
|
|
| 1 |
#### Function template `generate_canonical` <a id="rand.util.canonical">[[rand.util.canonical]]</a>
|
| 2 |
|
| 3 |
-
Each function instantiated from the template described in this section
|
| 4 |
-
[[rand.util.canonical]] maps the result of one or more invocations of a
|
| 5 |
-
supplied uniform random bit generator `g` to one member of the specified
|
| 6 |
-
`RealType` such that, if the values gᵢ produced by `g` are uniformly
|
| 7 |
-
distributed, the instantiation’s results tⱼ, 0 ≤ tⱼ < 1, are distributed
|
| 8 |
-
as uniformly as possible as specified below.
|
| 9 |
-
|
| 10 |
-
[*Note 1*: Obtaining a value in this way can be a useful step in the
|
| 11 |
-
process of transforming a value generated by a uniform random bit
|
| 12 |
-
generator into a value that can be delivered by a random number
|
| 13 |
-
distribution. — *end note*]
|
| 14 |
-
|
| 15 |
``` cpp
|
| 16 |
template<class RealType, size_t bits, class URBG>
|
| 17 |
RealType generate_canonical(URBG& g);
|
| 18 |
```
|
| 19 |
|
|
@@ -26,7 +14,16 @@ respectively. Calculates a quantity
|
|
| 26 |
$$S = \sum_{i=0}^{k-1} (g_i - \texttt{g.min()})
|
| 27 |
\cdot R^i$$ using arithmetic of type `RealType`.
|
| 28 |
|
| 29 |
*Returns:* S / Rᵏ.
|
| 30 |
|
|
|
|
|
|
|
| 31 |
*Throws:* What and when `g` throws.
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
#### Function template `generate_canonical` <a id="rand.util.canonical">[[rand.util.canonical]]</a>
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
``` cpp
|
| 4 |
template<class RealType, size_t bits, class URBG>
|
| 5 |
RealType generate_canonical(URBG& g);
|
| 6 |
```
|
| 7 |
|
|
|
|
| 14 |
$$S = \sum_{i=0}^{k-1} (g_i - \texttt{g.min()})
|
| 15 |
\cdot R^i$$ using arithmetic of type `RealType`.
|
| 16 |
|
| 17 |
*Returns:* S / Rᵏ.
|
| 18 |
|
| 19 |
+
[*Note 1*: 0 ≤ S / Rᵏ < 1. — *end note*]
|
| 20 |
+
|
| 21 |
*Throws:* What and when `g` throws.
|
| 22 |
|
| 23 |
+
[*Note 2*: If the values gᵢ produced by `g` are uniformly distributed,
|
| 24 |
+
the instantiation’s results are distributed as uniformly as possible.
|
| 25 |
+
Obtaining a value in this way can be a useful step in the process of
|
| 26 |
+
transforming a value generated by a uniform random bit generator into a
|
| 27 |
+
value that can be delivered by a random number
|
| 28 |
+
distribution. — *end note*]
|
| 29 |
+
|