Created on 2024-02-04.00:00:00 last changed 9 months ago
[ 2024-03-12; Reflector poll ]
Set priority to 4 after reflector poll. The copy & paste error was fixed editorially.
In the second constructor of [rand.dist.samp.plinear], P1719R2 replaced:
withtemplate<class InputIteratorB, class InputIteratorW> piecewise_linear_distribution(InputIteratorB firstB, InputIteratorB lastB, InputIteratorW firstW);
Effects: [...] Moreover, the id-expressions
iterator_traits<InputIteratorB>::value_type
anditerator_traits<InputIteratorW>::value_type
shall each denote a type that is convertible todouble
.
template<class InputIteratorB, class InputIteratorW> piecewise_linear_distribution(InputIteratorB firstB, InputIteratorB lastB, InputIteratorW firstW);
Mandates:
is_invocable_r_v<double, UnaryOperation&, double>
istrue
.Preconditions: [...]
Effects: [...]
This was a copy & paste error from the next constructor,
and was obviously not intended. There is no UnaryOperation
in that constructor.
A less obviously wrong issue is the use of double
there
in the first place. Shouldn't it be RealType
instead?
That seems to be incorrect throughout both
[rand.dist.samp.pconst]
and
[rand.dist.samp.plinear],
and was only partially fixed by LWG 1439.
Finally, the preconditions also say:
Preconditions: [...] IffirstB == lastB
or++firstB == lastB
, let n = 1, ρ0 = ρ1 = 1, b0 = 0, and b1 = 1. Otherwise, [firstB
,lastB
) forms a sequence b of length n + 1, the length of the sequence w starting fromfirstW
is at least n, and any wk for k ≥ n are ignored by the distribution.
These are not preconditions. I think it is trying to say something like:
Preconditions: [...] [
firstB
,lastB
) is a valid range and [firstW
,firstW + (lastB - firstB)
) is a valid range.Effects: If
firstB == lastB
or++firstB == lastB
, let n = 1, ρ0 = ρ1 = 1, b0 = 0, and b1 = 1. Otherwise, let [firstB
,lastB
) form a sequence b0, …, bn, and let wk =*firstW++
for k = 0, …, n.
The equivalent constructor for piecewise_constant_distribution
has similar problems with its preconditions in terms of n + 1.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-03-12 01:17:28 | admin | set | messages: + msg14001 |
2024-02-05 12:11:19 | admin | set | messages: + msg13946 |
2024-02-05 12:11:19 | admin | restored | |
2024-02-04 17:03:55 | admin | retired | |
2024-02-04 17:03:55 | admin | set | messages: - msg13944, msg13945 |
2024-02-04 15:47:01 | admin | set | messages: + msg13945 |
2024-02-04 00:00:00 | admin | create |