[phobos] [D-Programming-Language/phobos] 8d9233: Partial fix for Issues 7067 and 10434 - std.random...

GitHub noreply at github.com
Thu Aug 29 00:34:43 PDT 2013


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/phobos
  Commit: 8d9233cf8b9e4d27bd70dd0fcd171d2f6dc2f2c0
      https://github.com/D-Programming-Language/phobos/commit/8d9233cf8b9e4d27bd70dd0fcd171d2f6dc2f2c0
  Author: Joseph Rushton Wakeling <joe at webdrake.net>
  Date:   2013-08-26 (Mon, 26 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Partial fix for Issues 7067 and 10434 - std.random.RandomCover

The existing RandomCover design is fatally flawed because it
requires a RNG as input, which it then copies internally by
value.  So, unless the user is smart enough to pass something
like e.g. SomeRNG(unpredictableSeed), there will be unintended
correlations in random behaviour.

This partial fix follows the design of RandomSample in allowing
RandomCover to use the thread-global default RNG rndGen.  It
also improves the choice of template parameter and variable
names in line with Issue 10434.


  Commit: 2c9ecb8bd146a77c5ca450a69771b0d9dfcdf732
      https://github.com/D-Programming-Language/phobos/commit/2c9ecb8bd146a77c5ca450a69771b0d9dfcdf732
  Author: Joseph Rushton Wakeling <joe at webdrake.net>
  Date:   2013-08-26 (Mon, 26 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Partial fix for Issue 10434 - std.random.RandomSample

In line with changes to RandomCover, this patch tweaks
the choice of template parameter and variable names in
order to bring clarity and uniformity to the module.


  Commit: 8e4b77fb3af04be23faca4ef59f7896fa5c3c15b
      https://github.com/D-Programming-Language/phobos/commit/8e4b77fb3af04be23faca4ef59f7896fa5c3c15b
  Author: Joseph Rushton Wakeling <joe at webdrake.net>
  Date:   2013-08-26 (Mon, 26 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Correct the .save methods for RandomCover and RandomSample.

RandomCover and RandomSample should only be save'able if:

   * the input is a forward range

   * the thread-global RNG rndGen is not being used

   * the RNG being used is a forward range.


  Commit: c06ca0ce09a6e1cdff2fb171bf5f7fd3f46ec48e
      https://github.com/D-Programming-Language/phobos/commit/c06ca0ce09a6e1cdff2fb171bf5f7fd3f46ec48e
  Author: Joseph Rushton Wakeling <joe at webdrake.net>
  Date:   2013-08-26 (Mon, 26 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Unittests for RandomCover and RandomSample should test with all RNG types.


  Commit: a3ead0ac3145c79982fa61ec6bbc4e0a995b8f3b
      https://github.com/D-Programming-Language/phobos/commit/a3ead0ac3145c79982fa61ec6bbc4e0a995b8f3b
  Author: Joseph Rushton Wakeling <joe at webdrake.net>
  Date:   2013-08-26 (Mon, 26 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Documentation updates for RandomCover and RandomSample.

Mostly regarding the statistical safety-related concerns
when passing a specified RNG, plus a few corrections.


  Commit: c000b794a665018f005bc35e61ae95835ff8f1ff
      https://github.com/D-Programming-Language/phobos/commit/c000b794a665018f005bc35e61ae95835ff8f1ff
  Author: Joseph Rushton Wakeling <joe at webdrake.net>
  Date:   2013-08-26 (Mon, 26 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Small stylistic tweaks for Andrei :-)


  Commit: 40ee13749f9166ab9cff1e831aecf1490b1a8437
      https://github.com/D-Programming-Language/phobos/commit/40ee13749f9166ab9cff1e831aecf1490b1a8437
  Author: Joseph Rushton Wakeling <joe at webdrake.net>
  Date:   2013-08-26 (Mon, 26 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Ensure bool[] _chosen is filled with false at start of cover.


  Commit: 691efb167d7221df0f0777b22de8085ee2cb75d2
      https://github.com/D-Programming-Language/phobos/commit/691efb167d7221df0f0777b22de8085ee2cb75d2
  Author: Joseph Rushton Wakeling <joe at webdrake.net>
  Date:   2013-08-26 (Mon, 26 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Make sure RNGs are passed to Random{Cover, Sample} by ref/auto ref.


  Commit: 98a3efb62151a887d76b55393ffaafcbec4f0803
      https://github.com/D-Programming-Language/phobos/commit/98a3efb62151a887d76b55393ffaafcbec4f0803
  Author: Joseph Rushton Wakeling <joe at webdrake.net>
  Date:   2013-08-26 (Mon, 26 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Restore Random{Cover, Sample} constructors accepting value-type RNG.


  Commit: 3bdda604a8df6f9f64cdd654259b0396518aa61d
      https://github.com/D-Programming-Language/phobos/commit/3bdda604a8df6f9f64cdd654259b0396518aa61d
  Author: Joseph Rushton Wakeling <joe at webdrake.net>
  Date:   2013-08-26 (Mon, 26 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Slightly tone down warning message about value-type RNGs and Random{Cover, Sample}.


  Commit: fcaefd7bd0c0cf64a65528e156cde6dc07dc2522
      https://github.com/D-Programming-Language/phobos/commit/fcaefd7bd0c0cf64a65528e156cde6dc07dc2522
  Author: monarch dodra <monarchdodra at gmail.com>
  Date:   2013-08-29 (Thu, 29 Aug 2013)

  Changed paths:
    M std/random.d

  Log Message:
  -----------
  Merge pull request #1499 from WebDrake/randomcover-randomsample

Improved design for RandomCover and RandomSample


Compare: https://github.com/D-Programming-Language/phobos/compare/d6b8a21157ca...fcaefd7bd0c0


More information about the phobos mailing list