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:09 UTC

[20/22] [math] Reverting commit 921d0d60d40d8fbda29f14a64e848c70026ea32e as per Gilles request.

Reverting commit 921d0d60d40d8fbda29f14a64e848c70026ea32e 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/aaf4027b
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/aaf4027b
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/aaf4027b

Branch: refs/heads/master
Commit: aaf4027bfb90785279ce2ee68bdf056380b8ff1c
Parents: df46ed5
Author: Luc Maisonobe <lu...@apache.org>
Authored: Sun Jan 17 11:35:25 2016 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Sun Jan 17 11:40:27 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/commons/math4/random/ISAACRandom.java | 10 ++++------
 .../java/org/apache/commons/math4/random/ISAACTest.java   |  2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/aaf4027b/src/main/java/org/apache/commons/math4/random/ISAACRandom.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/random/ISAACRandom.java b/src/main/java/org/apache/commons/math4/random/ISAACRandom.java
index b9c0e36..ed07ddf 100644
--- a/src/main/java/org/apache/commons/math4/random/ISAACRandom.java
+++ b/src/main/java/org/apache/commons/math4/random/ISAACRandom.java
@@ -41,11 +41,9 @@ import org.apache.commons.math4.util.FastMath;
  *
  * @since 3.0
  */
-public class ISAACRandom
-    extends BaseRandomGenerator
-    implements Serializable {
+public class ISAACRandom extends BitsStreamGenerator implements Serializable {
     /** Serializable version identifier */
-    private static final long serialVersionUID = 20151227L;
+    private static final long serialVersionUID = 7288197941165002400L;
     /** Log of size of rsl[] and mem[] */
     private static final int SIZE_L = 8;
     /** Size of rsl[] and mem[] */
@@ -140,12 +138,12 @@ public class ISAACRandom
 
     /** {@inheritDoc} */
     @Override
-    public int nextInt() {
+    protected int next(int bits) {
         if (count < 0) {
             isaac();
             count = SIZE - 1;
         }
-        return rsl[count--];
+        return rsl[count--] >>> 32 - bits;
     }
 
     /** Generate 256 results */

http://git-wip-us.apache.org/repos/asf/commons-math/blob/aaf4027b/src/test/java/org/apache/commons/math4/random/ISAACTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/ISAACTest.java b/src/test/java/org/apache/commons/math4/random/ISAACTest.java
index 6db04ba..f8e7e65 100644
--- a/src/test/java/org/apache/commons/math4/random/ISAACTest.java
+++ b/src/test/java/org/apache/commons/math4/random/ISAACTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.math4.random.RandomGenerator;
 import org.junit.Assert;
 import org.junit.Test;
 
-public final class ISAACTest extends BaseRandomGeneratorTest {
+public final class ISAACTest extends RandomGeneratorAbstractTest {
 
     @Override
     protected RandomGenerator makeGenerator() {