Merge pull request #185 from mkolod/random-number-generator XORShift RNG with unit tests and benchmark
This patch was introduced to address SPARK-950 - the discussion below the ticket explains not only the rationale, but also the design and testing decisions: https://spark-project.atlassian.net/browse/SPARK-950 To run unit test, start SBT console and type: compile test-only org.apache.spark.util.XORShiftRandomSuite To run benchmark, type: project core console Once the Scala console starts, type: org.apache.spark.util.XORShiftRandom.benchmark(100000000) XORShiftRandom is also an object with a main method taking the number of iterations as an argument, so you can also run it from the command line. Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/65de73c7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/65de73c7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/65de73c7 Branch: refs/heads/master Commit: 65de73c7f8529be363e9ae814d0d4eab0da112aa Parents: 972171b 2272465 Author: Matei Zaharia <[email protected]> Authored: Sun Nov 24 15:52:33 2013 -0800 Committer: Matei Zaharia <[email protected]> Committed: Sun Nov 24 15:52:33 2013 -0800 ---------------------------------------------------------------------- .../scala/org/apache/spark/util/Utils.scala | 24 +++++ .../org/apache/spark/util/XORShiftRandom.scala | 94 ++++++++++++++++++++ .../apache/spark/util/XORShiftRandomSuite.scala | 76 ++++++++++++++++ .../apache/spark/mllib/clustering/KMeans.scala | 11 +-- 4 files changed, 200 insertions(+), 5 deletions(-) ----------------------------------------------------------------------
