From Jason Turner

[rand.util.canonical]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmphaimlz3d/{from.md → to.md} +10 -9
tmp/tmphaimlz3d/{from.md → to.md} RENAMED
@@ -1,21 +1,22 @@
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 number generator `g` to one member of the
6
- specified `RealType` such that, if the values gᵢ produced by `g` are
7
- uniformly distributed, the instantiation’s results tⱼ, 0 ≤ tⱼ < 1, are
8
- distributed as uniformly as possible as specified below.
9
 
10
- Obtaining a value in this way can be a useful step in the process of
11
- transforming a value generated by a uniform random number generator into
12
- a value that can be delivered by a random number distribution.
 
13
 
14
  ``` cpp
15
- template<class RealType, size_t bits, class URNG>
16
- RealType generate_canonical(URNG& g);
17
  ```
18
 
19
  *Complexity:* Exactly k = max(1, ⌈ b / log₂ R ⌉) invocations of `g`,
20
  where b[^5] is the lesser of `numeric_limits<RealType>::digits` and
21
  `bits`, and R is the value of `g.max()` - `g.min()` + 1.
 
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
 
20
  *Complexity:* Exactly k = max(1, ⌈ b / log₂ R ⌉) invocations of `g`,
21
  where b[^5] is the lesser of `numeric_limits<RealType>::digits` and
22
  `bits`, and R is the value of `g.max()` - `g.min()` + 1.