Minimal example demonstrating the issue. Outputs 4 random samples, the latter 3 of which have all been differently seeded.
text/x-dsrc
550
Comments
Comment #0 by joseph.wakeling — 2012-04-17T21:14:53Z
Created attachment 1097
Minimal example demonstrating the issue. Outputs 4 random samples, the latter 3 of which have all been differently seeded.
If randomSample is passed a user-defined random number generator, e.g.
auto urng = Random(unpredictableSeed);
auto s = randomSample(iota(0, 100), 5, urng);
... then the first value of the sample will always be identical (for a given
RNG type), regardless of how the RNG is seeded.
As an example, try the attached code. The 3 seeded cases all have a first
value of 21 on my system.
This error is occurring with the latest Phobos from GitHub.