digitalmars.D.bugs - [Issue 9607] New: std.random.randomShuffle and partialShuffle don't work with Xorshift
- d-bugmail puremagic.com (52/52) Feb 27 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9607
- d-bugmail puremagic.com (12/12) Jun 21 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9607
- d-bugmail puremagic.com (7/9) Jun 22 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9607
- d-bugmail puremagic.com (19/19) Jul 15 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9607
- d-bugmail puremagic.com (10/10) Jul 15 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9607
- d-bugmail puremagic.com (6/6) Jul 16 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9607
http://d.puremagic.com/issues/show_bug.cgi?id=9607 Summary: std.random.randomShuffle and partialShuffle don't work with Xorshift Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: bearophile_hugs eml.cc import std.random: randomShuffle, rndGen, Mt19937, Xorshift, partialShuffle; void main() { int[] items = [10, 20, 30]; randomShuffle(items); // OK randomShuffle(items, rndGen); // OK Mt19937 gen; randomShuffle(items, gen); // OK Xorshift rng; randomShuffle(items, rng); // Error. partialShuffle(items, 2, rng); // Error. } DMD 2.063alpha gives: ...\dmd2\src\phobos\std\random.d(1346): Error: constructor std.random.XorshiftEngine!(uint, 128, 11, 8, 19).XorshiftEngine.this (uint x0) is not callable using argument types (MersenneTwisterEngine!(uint, 32, 624, 397, 31, 2567483615u, 11, 7, 2636928640u, 15, 4022730752u, 18)) ...\dmd2\src\phobos\std\random.d(1346): Error: cannot implicitly convert expression (rndGen()) of type MersenneTwisterEngine!(uint, 32, 624, 397, 31, 2567483615u, 11, 7, 2636928640u, 15, 4022730752u, 18) to uint ...\dmd2\src\phobos\std\random.d(1376): Error: constructor std.random.XorshiftEngine!(uint, 128, 11, 8, 19).XorshiftEngine.this (uint x0) is not callable using argument types (MersenneTwisterEngine!(uint, 32, 624, 397, 31, 2567483615u, 11, 7, 2636928640u, 15, 4022730752u, 18)) ...\dmd2\src\phobos\std\random.d(1376): Error: cannot implicitly convert expression (rndGen()) of type MersenneTwisterEngine!(uint, 32, 624, 397, 31, 2567483615u, 11, 7, 2636928640u, 15, 4022730752u, 18) to uint ...\dmd2\src\phobos\std\random.d(1349): Error: template instance std.random.partialShuffle!(int[], XorshiftEngine!(uint, 128, 11, 8, 19)) error instantiating temp3.d(10): instantiated from here: randomShuffle!(int[], XorshiftEngine!(uint, 128, 11, 8, 19)) temp3.d(10): Error: template instance std.random.randomShuffle!(int[], XorshiftEngine!(uint, 128, 11, 8, 19)) error instantiating -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 27 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9607 Joseph Rushton Wakeling <joseph.wakeling webdrake.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joseph.wakeling webdrake.ne | |t 2013-06-21 07:10:47 PDT --- -- will submit a pull request soon. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 21 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9607 2013-06-22 02:03:34 PDT ----- will submit a pull request soon.https://github.com/D-Programming-Language/phobos/pull/1362 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 22 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9607 Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/e86bc65639036d240d5ec6ce0254ccebee097943 Fix Issue 9607 - std.random.randomShuffle() and partialShuffle() don't work with Xorshift. This is an instance of Issue 2803, a clash between a template parameter and a default argument. I've used the workaround proposed in that issue thread: http://d.puremagic.com/issues/show_bug.cgi?id=2803#c1 Tests have been included to ensure that these functions work with all possible RNG types. https://github.com/D-Programming-Language/phobos/commit/443b54e30b4b67b8968ecde51dcae66c855c135b Fix Issue 9607 - std.random.randomShuffle() and partialShuffle() don't work with Xorshift. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 15 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9607 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |andrej.mitrovich gmail.com Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 15 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9607 2013-07-16 02:32:31 PDT --- *** Issue 7863 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 16 2013