You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2016/01/17 11:42:02 UTC
[13/22] [math] Reverting commit
d8e2f892e48423fda73204be3ec239d282e71c65 as per Gilles request.
Reverting commit d8e2f892e48423fda73204be3ec239d282e71c65 as per Gilles request.
The work on revamping the random packages is perfoemd in the random-ravamp branch.
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/4abfe08a
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/4abfe08a
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/4abfe08a
Branch: refs/heads/master
Commit: 4abfe08ae38927921ce2d754f0fde4221fccbed7
Parents: b144fa5
Author: Luc Maisonobe <lu...@apache.org>
Authored: Sun Jan 17 11:35:24 2016 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Sun Jan 17 11:40:27 2016 +0100
----------------------------------------------------------------------
.../distribution/ZipfDistributionTest.java | 37 ++++++++------------
1 file changed, 15 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-math/blob/4abfe08a/src/test/java/org/apache/commons/math4/distribution/ZipfDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/ZipfDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/ZipfDistributionTest.java
index 1a71626..eeae81f 100644
--- a/src/test/java/org/apache/commons/math4/distribution/ZipfDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/ZipfDistributionTest.java
@@ -20,7 +20,7 @@ package org.apache.commons.math4.distribution;
import org.apache.commons.math4.TestUtils;
import org.apache.commons.math4.distribution.ZipfDistribution.ZipfRejectionInversionSampler;
import org.apache.commons.math4.exception.NotStrictlyPositiveException;
-import org.apache.commons.math4.random.BaseRandomGenerator;
+import org.apache.commons.math4.random.AbstractRandomGenerator;
import org.apache.commons.math4.random.RandomGenerator;
import org.apache.commons.math4.random.Well1024a;
import org.apache.commons.math4.util.FastMath;
@@ -215,27 +215,20 @@ public class ZipfDistributionTest extends IntegerDistributionAbstractTest {
long start = System.currentTimeMillis();
final int[] randomNumberCounter = new int[1];
- RandomGenerator randomGenerator = new BaseRandomGenerator() {
- private final RandomGenerator r = new Well1024a(0L);
-
- @Override
- public void setSeed(long s) {
- r.setSeed(s);
- }
- @Override
- public void setSeed(int s) {
- r.setSeed(s);
- }
- @Override
- public void setSeed(int[] s) {
- r.setSeed(s);
- }
- @Override
- public int nextInt() {
- randomNumberCounter[0] += 1;
- return r.nextInt();
- }
- };
+ RandomGenerator randomGenerator = new AbstractRandomGenerator() {
+
+ private final RandomGenerator r = new Well1024a(0L);
+
+ @Override
+ public void setSeed(long seed) {
+ }
+
+ @Override
+ public double nextDouble() {
+ randomNumberCounter[0]+=1;
+ return r.nextDouble();
+ }
+ };
final ZipfDistribution distribution = new ZipfDistribution(randomGenerator, numPoints, exponent);
for (int i = 0; i < numGeneratedSamples; ++i) {