boolean isNativeSeed(SEED seed) {
- return getSeed().equals(seed.getClass());
- }
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/StateSettable.java b/src/main/java/org/apache/commons/math4/rng/internal/StateSettable.java
deleted file mode 100644
index 6c7e7a565..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/StateSettable.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal;
-
-import org.apache.commons.math4.rng.RandomSource;
-
-/**
- * Indicates that the state of the instance can be saved and restored.
- *
- * @since 4.0
- */
-public interface StateSettable {
- /**
- * Sets the instance's state.
- *
- * @param state State. The given argument must have been retrieved
- * by a call to {@link #getState()}.
- *
- * @throws org.apache.commons.math4.exception.MathUnsupportedOperationException
- * if not implemented.
- */
- void setState(RandomSource.State state);
-
- /**
- * Gets the instance's state.
- *
- * @return the current state. The given argument can then be passed
- * to {@link #setState(RandomSource.State)} in order to recover the
- * current state.
- *
- * @throws org.apache.commons.math4.exception.MathUnsupportedOperationException
- * if not implemented.
- */
- RandomSource.State getState();
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/package-info.java b/src/main/java/org/apache/commons/math4/rng/internal/package-info.java
deleted file mode 100644
index 47ad828e7..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/package-info.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Base classes for the {@link org.apache.commons.math4.rng.UniformRandomProvider
- * generation of uniformly distributed random numbers}.
- *
- *
- *
- * For internal use only: Direct access to classes in this package
- * and below, is discouraged, as they could be modified without notice.
- *
- *
- * Notes for developers
- *
- *
- * This package contains the common functionality.
- *
- * Implementations that produce
- * {@link org.apache.commons.math4.rng.internal.source32.RandomIntSource int}
- * values are defined in the
- * {@link org.apache.commons.math4.rng.internal.source32 source32} package.
- *
- * Implementations that produce
- * {@link org.apache.commons.math4.rng.internal.source64.RandomLongSource long}
- * values are defined in the
- * {@link org.apache.commons.math4.rng.internal.source64 source64} package.
- *
- *
- *
- * Each implementation must have an identifier in
- * {@link org.apache.commons.math4.rng.internal.ProviderBuilder.RandomSourceInternal}
- * which must be referred to from the {@link org.apache.commons.math4.rng.RandomSource public API}.
- *
- */
-
-package org.apache.commons.math4.rng.internal;
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/AbstractWell.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/AbstractWell.java
deleted file mode 100644
index c9737db17..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/AbstractWell.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import java.util.Arrays;
-import org.apache.commons.math4.exception.InsufficientDataException;
-import org.apache.commons.math4.rng.internal.util.NumberFactory;
-
-/**
- * This abstract class implements the WELL class of pseudo-random number
- * generator from François Panneton, Pierre L'Ecuyer and Makoto
- * Matsumoto.
- *
- * This generator is described in a paper by François Panneton,
- * Pierre L'Ecuyer and Makoto Matsumoto
- *
- * Improved Long-Period Generators Based on Linear Recurrences Modulo 2
- * ACM Transactions on Mathematical Software, 32, 1 (2006).
- * The errata for the paper are in
- * wellrng-errata.txt.
- *
- *
- * @see WELL Random number generator
- *
- * @since 4.0
- */
-public abstract class AbstractWell extends IntProvider {
- /** Current index in the bytes pool. */
- protected int index;
- /** Bytes pool. */
- protected final int[] v;
-
- /**
- * Creates a new random number generator using an int array seed.
- *
- * @param k Number of bits in the pool (not necessarily a multiple of 32).
- * @param seed Initial seed.
- */
- protected AbstractWell(final int k,
- final int[] seed) {
- final int r = calculateBlockCount(k);
- v = new int[r];
- index = 0;
-
- // Initialize the pool content.
- setSeedInternal(seed);
- }
-
- /** {@inheritDoc} */
- @Override
- protected byte[] getStateInternal() {
- final int[] s = Arrays.copyOf(v, v.length + 1);
- s[v.length] = index;
-
- return NumberFactory.makeByteArray(s);
- }
-
- /** {@inheritDoc} */
- @Override
- protected void setStateInternal(byte[] s) {
- if (s.length != (v.length + 1) * 4) {
- throw new InsufficientDataException();
- }
-
- final int[] tmp = NumberFactory.makeIntArray(s);
-
- System.arraycopy(tmp, 0, v, 0, v.length);
- index = tmp[v.length];
- }
-
- /**
- * Reinitialize the generator as if just built with the given int array seed.
- *
- * The state of the generator is exactly the same as a new generator built
- * with the same seed.
- *
- * @param seed Seed. Cannot be null.
- */
- private void setSeedInternal(final int[] seed) {
- System.arraycopy(seed, 0, v, 0, Math.min(seed.length, v.length));
-
- if (seed.length < v.length) {
- for (int i = seed.length; i < v.length; ++i) {
- final long current = v[i - seed.length];
- v[i] = (int) ((1812433253L * (current ^ (current >> 30)) + i) & 0xffffffffL);
- }
- }
-
- index = 0;
- }
-
- /**
- * Calculate the number of 32-bits blocks.
- *
- * @param k Number of bits in the pool (not necessarily a multiple of 32).
- * @return the number of 32-bits blocks.
- */
- private static int calculateBlockCount(final int k) {
- // the bits pool contains k bits, k = r w - p where r is the number
- // of w bits blocks, w is the block size (always 32 in the original paper)
- // and p is the number of unused bits in the last block
- final int w = 32;
- final int r = (k + w - 1) / w;
- return r;
- }
-
- /**
- * Inner class used to store the indirection index table which is fixed for a given
- * type of WELL class of pseudo-random number generator.
- */
- protected static final class IndexTable {
- /** Index indirection table giving for each index its predecessor taking table size into account. */
- private final int[] iRm1;
- /** Index indirection table giving for each index its second predecessor taking table size into account. */
- private final int[] iRm2;
- /** Index indirection table giving for each index the value index + m1 taking table size into account. */
- private final int[] i1;
- /** Index indirection table giving for each index the value index + m2 taking table size into account. */
- private final int[] i2;
- /** Index indirection table giving for each index the value index + m3 taking table size into account. */
- private final int[] i3;
-
- /** Creates a new pre-calculated indirection index table.
- * @param k number of bits in the pool (not necessarily a multiple of 32)
- * @param m1 first parameter of the algorithm
- * @param m2 second parameter of the algorithm
- * @param m3 third parameter of the algorithm
- */
- public IndexTable(final int k, final int m1, final int m2, final int m3) {
-
- final int r = calculateBlockCount(k);
-
- // precompute indirection index tables. These tables are used for optimizing access
- // they allow saving computations like "(j + r - 2) % r" with costly modulo operations
- iRm1 = new int[r];
- iRm2 = new int[r];
- i1 = new int[r];
- i2 = new int[r];
- i3 = new int[r];
- for (int j = 0; j < r; ++j) {
- iRm1[j] = (j + r - 1) % r;
- iRm2[j] = (j + r - 2) % r;
- i1[j] = (j + m1) % r;
- i2[j] = (j + m2) % r;
- i3[j] = (j + m3) % r;
- }
- }
-
- /**
- * Returns the predecessor of the given index modulo the table size.
- * @param index the index to look at
- * @return (index - 1) % table size
- */
- public int getIndexPred(final int index) {
- return iRm1[index];
- }
-
- /**
- * Returns the second predecessor of the given index modulo the table size.
- * @param index the index to look at
- * @return (index - 2) % table size
- */
- public int getIndexPred2(final int index) {
- return iRm2[index];
- }
-
- /**
- * Returns index + M1 modulo the table size.
- * @param index the index to look at
- * @return (index + M1) % table size
- */
- public int getIndexM1(final int index) {
- return i1[index];
- }
-
- /**
- * Returns index + M2 modulo the table size.
- * @param index the index to look at
- * @return (index + M2) % table size
- */
- public int getIndexM2(final int index) {
- return i2[index];
- }
-
- /**
- * Returns index + M3 modulo the table size.
- * @param index the index to look at
- * @return (index + M3) % table size
- */
- public int getIndexM3(final int index) {
- return i3[index];
- }
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/ISAACRandom.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/ISAACRandom.java
deleted file mode 100644
index c7dd73aec..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/ISAACRandom.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math4.rng.internal.source32;
-
-import java.util.Arrays;
-import org.apache.commons.math4.exception.InsufficientDataException;
-import org.apache.commons.math4.rng.internal.util.NumberFactory;
-
-/**
- * A fast cryptographic pseudo-random number generator.
- *
- * ISAAC (Indirection, Shift, Accumulate, Add, and Count) generates 32-bit
- * random numbers.
- * ISAAC has been designed to be cryptographically secure and is inspired
- * by RC4.
- * Cycles are guaranteed to be at least 240 values long, and they
- * are 28295 values long on average.
- * The results are uniformly distributed, unbiased, and unpredictable unless
- * you know the seed.
- *
- * This code is based (with minor changes and improvements) on the original
- * implementation of the algorithm by Bob Jenkins.
- *
- * @see
- * ISAAC: a fast cryptographic pseudo-random number generator
- *
- * @since 4.0
- */
-public class ISAACRandom extends IntProvider {
- /** Log of size of rsl[] and mem[] */
- private static final int SIZE_L = 8;
- /** Size of rsl[] and mem[] */
- private static final int SIZE = 1 << SIZE_L;
- /** Half-size of rsl[] and mem[] */
- private static final int H_SIZE = SIZE >> 1;
- /** For pseudo-random lookup */
- private static final int MASK = SIZE - 1 << 2;
- /** The golden ratio */
- private static final int GLD_RATIO = 0x9e3779b9;
- /** The results given to the user */
- private final int[] rsl = new int[SIZE];
- /** The internal state */
- private final int[] mem = new int[SIZE];
- /** Count through the results in rsl[] */
- private int count;
- /** Accumulator */
- private int isaacA;
- /** The last result */
- private int isaacB;
- /** Counter, guarantees cycle is at least 2^40 */
- private int isaacC;
- /** Service variable. */
- private final int[] arr = new int[8];
- /** Service variable. */
- private int isaacX;
- /** Service variable. */
- private int isaacI;
- /** Service variable. */
- private int isaacJ;
-
- /**
- * Creates a new ISAAC random number generator.
- *
- * @param seed Initial seed
- */
- public ISAACRandom(int[] seed) {
- setSeedInternal(seed);
- }
-
- /** {@inheritDoc} */
- @Override
- protected byte[] getStateInternal() {
- final int[] sRsl = Arrays.copyOf(rsl, SIZE);
- final int[] sMem = Arrays.copyOf(mem, SIZE);
- final int[] sRem = Arrays.copyOf(new int[] { count, isaacA, isaacB, isaacC }, 4);
-
- final int[] s = new int[2 * SIZE + sRem.length];
- System.arraycopy(sRsl, 0, s, 0, SIZE);
- System.arraycopy(sMem, 0, s, SIZE, SIZE);
- System.arraycopy(sRem, 0, s, 2 * SIZE, sRem.length);
-
- return NumberFactory.makeByteArray(s);
- }
-
- /** {@inheritDoc} */
- @Override
- protected void setStateInternal(byte[] s) {
- if (s.length != (2 * SIZE + 4) * 4) {
- throw new InsufficientDataException();
- }
-
- final int[] tmp = NumberFactory.makeIntArray(s);
-
- System.arraycopy(tmp, 0, rsl, 0, SIZE);
- System.arraycopy(tmp, SIZE, mem, 0, SIZE);
- final int offset = 2 * SIZE;
- count = tmp[offset];
- isaacA = tmp[offset + 1];
- isaacB = tmp[offset + 2];
- isaacC = tmp[offset + 3];
- }
-
- /**
- * Reseeds the RNG.
- *
- * @param seed Seed. Cannot be null.
- */
- private void setSeedInternal(int[] seed) {
- final int seedLen = seed.length;
- final int rslLen = rsl.length;
- System.arraycopy(seed, 0, rsl, 0, Math.min(seedLen, rslLen));
- if (seedLen < rslLen) {
- for (int j = seedLen; j < rslLen; j++) {
- long k = rsl[j - seedLen];
- rsl[j] = (int) (0x6c078965L * (k ^ k >> 30) + j & 0xffffffffL);
- }
- }
- initState();
- }
-
- /** {@inheritDoc} */
- @Override
- public int next() {
- if (count < 0) {
- isaac();
- count = SIZE - 1;
- }
- return rsl[count--];
- }
-
- /** Generate 256 results */
- private void isaac() {
- isaacI = 0;
- isaacJ = H_SIZE;
- isaacB += ++isaacC;
- while (isaacI < H_SIZE) {
- isaac2();
- }
- isaacJ = 0;
- while (isaacJ < H_SIZE) {
- isaac2();
- }
- }
-
- /** Intermediate internal loop. */
- private void isaac2() {
- isaacX = mem[isaacI];
- isaacA ^= isaacA << 13;
- isaacA += mem[isaacJ++];
- isaac3();
- isaacX = mem[isaacI];
- isaacA ^= isaacA >>> 6;
- isaacA += mem[isaacJ++];
- isaac3();
- isaacX = mem[isaacI];
- isaacA ^= isaacA << 2;
- isaacA += mem[isaacJ++];
- isaac3();
- isaacX = mem[isaacI];
- isaacA ^= isaacA >>> 16;
- isaacA += mem[isaacJ++];
- isaac3();
- }
-
- /** Lowest level internal loop. */
- private void isaac3() {
- mem[isaacI] = mem[(isaacX & MASK) >> 2] + isaacA + isaacB;
- isaacB = mem[(mem[isaacI] >> SIZE_L & MASK) >> 2] + isaacX;
- rsl[isaacI++] = isaacB;
- }
-
- /** Initialize, or reinitialize, this instance of rand. */
- private void initState() {
- isaacA = 0;
- isaacB = 0;
- isaacC = 0;
- for (int j = 0; j < arr.length; j++) {
- arr[j] = GLD_RATIO;
- }
- for (int j = 0; j < 4; j++) {
- shuffle();
- }
- // fill in mem[] with messy stuff
- for (int j = 0; j < SIZE; j += 8) {
- arr[0] += rsl[j];
- arr[1] += rsl[j + 1];
- arr[2] += rsl[j + 2];
- arr[3] += rsl[j + 3];
- arr[4] += rsl[j + 4];
- arr[5] += rsl[j + 5];
- arr[6] += rsl[j + 6];
- arr[7] += rsl[j + 7];
- shuffle();
- setState(j);
- }
- // second pass makes all of seed affect all of mem
- for (int j = 0; j < SIZE; j += 8) {
- arr[0] += mem[j];
- arr[1] += mem[j + 1];
- arr[2] += mem[j + 2];
- arr[3] += mem[j + 3];
- arr[4] += mem[j + 4];
- arr[5] += mem[j + 5];
- arr[6] += mem[j + 6];
- arr[7] += mem[j + 7];
- shuffle();
- setState(j);
- }
- isaac();
- count = SIZE - 1;
- }
-
- /** Shuffle array. */
- private void shuffle() {
- arr[0] ^= arr[1] << 11;
- arr[3] += arr[0];
- arr[1] += arr[2];
- arr[1] ^= arr[2] >>> 2;
- arr[4] += arr[1];
- arr[2] += arr[3];
- arr[2] ^= arr[3] << 8;
- arr[5] += arr[2];
- arr[3] += arr[4];
- arr[3] ^= arr[4] >>> 16;
- arr[6] += arr[3];
- arr[4] += arr[5];
- arr[4] ^= arr[5] << 10;
- arr[7] += arr[4];
- arr[5] += arr[6];
- arr[5] ^= arr[6] >>> 4;
- arr[0] += arr[5];
- arr[6] += arr[7];
- arr[6] ^= arr[7] << 8;
- arr[1] += arr[6];
- arr[7] += arr[0];
- arr[7] ^= arr[0] >>> 9;
- arr[2] += arr[7];
- arr[0] += arr[1];
- }
-
- /** Set the state by copying the internal arrays.
- *
- * @param start First index into {@link #mem} array.
- */
- private void setState(int start) {
- mem[start] = arr[0];
- mem[start + 1] = arr[1];
- mem[start + 2] = arr[2];
- mem[start + 3] = arr[3];
- mem[start + 4] = arr[4];
- mem[start + 5] = arr[5];
- mem[start + 6] = arr[6];
- mem[start + 7] = arr[7];
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/IntProvider.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/IntProvider.java
deleted file mode 100644
index bae33fc78..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/IntProvider.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math4.rng.internal.source32;
-
-import org.apache.commons.math4.exception.OutOfRangeException;
-import org.apache.commons.math4.rng.internal.util.NumberFactory;
-import org.apache.commons.math4.rng.internal.BaseProvider;
-
-/**
- * Base class for all implementations that provide an {@code int}-based
- * source randomness.
- */
-public abstract class IntProvider
- extends BaseProvider
- implements RandomIntSource {
-
- /** {@inheritDoc} */
- @Override
- public abstract int next();
-
- /** {@inheritDoc} */
- @Override
- public int nextInt() {
- return next();
- }
-
- /** {@inheritDoc} */
- @Override
- public boolean nextBoolean() {
- return NumberFactory.makeBoolean(nextInt());
- }
-
- /** {@inheritDoc} */
- @Override
- public double nextDouble() {
- return NumberFactory.makeDouble(nextInt(), nextInt());
- }
-
- /** {@inheritDoc} */
- @Override
- public float nextFloat() {
- return NumberFactory.makeFloat(nextInt());
- }
-
- /** {@inheritDoc} */
- @Override
- public long nextLong() {
- return NumberFactory.makeLong(nextInt(), nextInt());
- }
-
- /** {@inheritDoc} */
- @Override
- public void nextBytes(byte[] bytes) {
- nextBytesFill(this, bytes, 0, bytes.length);
- }
-
- /** {@inheritDoc} */
- @Override
- public void nextBytes(byte[] bytes,
- int start,
- int len) {
- if (start < 0 ||
- start >= bytes.length) {
- throw new OutOfRangeException(start, 0, bytes.length);
- }
- if (len < 0 ||
- len > bytes.length - start) {
- throw new OutOfRangeException(len, 0, bytes.length - start);
- }
-
- nextBytesFill(this, bytes, start, len);
- }
-
- /**
- * Generates random bytes and places them into a user-supplied array.
- *
- *
- * The array is filled with bytes extracted from random {@code int} values.
- * This implies that the number of random bytes generated may be larger than
- * the length of the byte array.
- *
- *
- * @param source Source of randomness.
- * @param bytes Array in which to put the generated bytes. Cannot be null.
- * @param start Index at which to start inserting the generated bytes.
- * @param len Number of bytes to insert.
- */
- static void nextBytesFill(RandomIntSource source,
- byte[] bytes,
- int start,
- int len) {
- int index = start; // Index of first insertion.
-
- // Index of first insertion plus multiple of 4 part of length
- // (i.e. length with 2 least significant bits unset).
- final int indexLoopLimit = index + (len & 0x7ffffffc);
-
- // Start filling in the byte array, 4 bytes at a time.
- while (index < indexLoopLimit) {
- final int random = source.next();
- bytes[index++] = (byte) random;
- bytes[index++] = (byte) (random >>> 8);
- bytes[index++] = (byte) (random >>> 16);
- bytes[index++] = (byte) (random >>> 24);
- }
-
- final int indexLimit = start + len; // Index of last insertion + 1.
-
- // Fill in the remaining bytes.
- if (index < indexLimit) {
- int random = source.next();
- while (true) {
- bytes[index++] = (byte) random;
- if (index < indexLimit) {
- random >>>= 8;
- } else {
- break;
- }
- }
- }
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/JDKRandom.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/JDKRandom.java
deleted file mode 100644
index e393c123a..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/JDKRandom.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import java.util.Random;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ByteArrayInputStream;
-
-/**
- * A provider that uses the {@link Random#nextInt()} method of the JDK's
- * {@code Random} class as the source of randomness.
- *
- *
- * Caveat: All the other calls will be redirected to the methods
- * implemented within this library.
- *
- *
- *
- * The state of this source of randomness is saved and restored through
- * the serialization of the {@link Random} instance.
- *
- *
- * @since 4.0
- */
-public class JDKRandom extends IntProvider {
- /** Delegate. Cannot be "final" (to allow serialization). */
- private Random delegate;
-
- /**
- * Creates an instance with the given seed.
- *
- * @param seed Initial seed.
- */
- public JDKRandom(Long seed) {
- delegate = new Random(seed);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see Random#nextInt()
- */
- @Override
- public int next() {
- return delegate.nextInt();
- }
-
- /** {@inheritDoc} */
- @Override
- protected byte[] getStateInternal() {
- try {
- final ByteArrayOutputStream bos = new ByteArrayOutputStream();
- final ObjectOutputStream oos = new ObjectOutputStream(bos);
-
- // Serialize the "delegate".
- oos.writeObject(delegate);
-
- return bos.toByteArray();
- } catch (IOException e) {
- // Workaround checked exception.
- throw new RuntimeException(e);
- }
- }
-
- /** {@inheritDoc} */
- @Override
- protected void setStateInternal(byte[] s) {
- try {
- final ByteArrayInputStream bis = new ByteArrayInputStream(s);
- final ObjectInputStream ois = new ObjectInputStream(bis);
-
- delegate = (Random) ois.readObject();
- } catch (ClassNotFoundException|IOException e) {
- // Workaround checked exception.
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/MersenneTwister.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/MersenneTwister.java
deleted file mode 100644
index 7ae5fd8ba..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/MersenneTwister.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import java.util.Arrays;
-import org.apache.commons.math4.exception.InsufficientDataException;
-import org.apache.commons.math4.rng.internal.util.NumberFactory;
-
-/**
- * This class implements a powerful pseudo-random number generator
- * developed by Makoto Matsumoto and Takuji Nishimura during
- * 1996-1997.
- *
- *
- * This generator features an extremely long period
- * (219937-1) and 623-dimensional equidistribution up to
- * 32 bits accuracy. The home page for this generator is located at
- *
- * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html.
- *
- *
- *
- * This generator is described in a paper by Makoto Matsumoto and
- * Takuji Nishimura in 1998:
- *
- * Mersenne Twister: A 623-Dimensionally Equidistributed Uniform Pseudo-Random
- * Number Generator,
- * ACM Transactions on Modeling and Computer Simulation, Vol. 8, No. 1,
- * January 1998, pp 3--30
- *
- *
- *
- * This class is mainly a Java port of the
- *
- * 2002-01-26 version of the generator written in C by Makoto Matsumoto
- * and Takuji Nishimura. Here is their original copyright:
- *
- *
- *
- * Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
- * All rights reserved. |
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * - The names of its contributors may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- * |
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE. |
- *
- *
- * @since 4.0
- */
-public class MersenneTwister extends IntProvider {
- /** Mask 32 most significant bits. */
- private static final long INT_MASK_LONG = 0xffffffffL;
- /** Most significant w-r bits. */
- private static final long UPPER_MASK_LONG = 0x80000000L;
- /** Least significant r bits */
- private static final long LOWER_MASK_LONG = 0x7fffffffL;
- /** Most significant w-r bits. */
- private static final int UPPER_MASK = 0x80000000;
- /** Least significant r bits */
- private static final int LOWER_MASK = 0x7fffffff;
- /** Size of the bytes pool. */
- private static final int N = 624;
- /** Period second parameter. */
- private static final int M = 397;
- /** X * MATRIX_A for X = {0, 1}. */
- private static final int[] MAG01 = { 0x0, 0x9908b0df };
- /** Bytes pool. */
- private int[] mt = new int[N];
- /** Current index in the bytes pool. */
- private int mti;
-
- /**
- * Creates a new random number generator.
- *
- * @param seed Initial seed.
- */
- public MersenneTwister(int[] seed) {
- setSeedInternal(seed);
- }
-
- /** {@inheritDoc} */
- @Override
- protected byte[] getStateInternal() {
- final int[] s = Arrays.copyOf(mt, N + 1);
- s[N] = mti;
-
- return NumberFactory.makeByteArray(s);
- }
-
- /** {@inheritDoc} */
- @Override
- protected void setStateInternal(byte[] s) {
- if (s.length != (N + 1) * 4) {
- throw new InsufficientDataException();
- }
-
- final int[] tmp = NumberFactory.makeIntArray(s);
-
- System.arraycopy(tmp, 0, mt, 0, N);
- mti = tmp[N];
- }
-
- /**
- * Reinitializes the generator as if just built with the given seed.
- *
- * @param seed Initial seed.
- */
- private void setSeedInternal(int[] seed) {
- initState(19650218);
- int i = 1;
- int j = 0;
-
- for (int k = Math.max(N, seed.length); k != 0; k--) {
- final long l0 = (mt[i] & LOWER_MASK_LONG) | ((mt[i] < 0) ? UPPER_MASK_LONG : 0);
- final long l1 = (mt[i-1] & LOWER_MASK_LONG) | ((mt[i-1] < 0) ? UPPER_MASK_LONG : 0);
- final long l = (l0 ^ ((l1 ^ (l1 >> 30)) * 1664525l)) + seed[j] + j; // non linear
- mt[i] = (int) (l & INT_MASK_LONG);
- i++; j++;
- if (i >= N) {
- mt[0] = mt[N - 1];
- i = 1;
- }
- if (j >= seed.length) {
- j = 0;
- }
- }
-
- for (int k = N - 1; k != 0; k--) {
- final long l0 = (mt[i] & LOWER_MASK_LONG) | ((mt[i] < 0) ? UPPER_MASK_LONG : 0);
- final long l1 = (mt[i-1] & LOWER_MASK_LONG) | ((mt[i-1] < 0) ? UPPER_MASK_LONG : 0);
- final long l = (l0 ^ ((l1 ^ (l1 >> 30)) * 1566083941l)) - i; // non linear
- mt[i] = (int) (l & INT_MASK_LONG);
- i++;
- if (i >= N) {
- mt[0] = mt[N - 1];
- i = 1;
- }
- }
-
- mt[0] = UPPER_MASK; // MSB is 1; assuring non-zero initial array
- }
-
- /**
- * Initialize the internal state of this instance.
- *
- * @param seed Seed.
- */
- private void initState(int seed) {
- long longMT = seed & INT_MASK_LONG;
- mt[0]= (int) longMT;
- for (mti = 1; mti < N; ++mti) {
- longMT = (1812433253L * (longMT ^ (longMT >> 30)) + mti) & INT_MASK_LONG;
- mt[mti]= (int) longMT;
- }
- }
-
- /** {@inheritDoc} */
- @Override
- public int next() {
- int y;
-
- if (mti >= N) { // Generate N words at one time.
- int mtNext = mt[0];
- for (int k = 0; k < N - M; ++k) {
- int mtCurr = mtNext;
- mtNext = mt[k + 1];
- y = (mtCurr & UPPER_MASK) | (mtNext & LOWER_MASK);
- mt[k] = mt[k + M] ^ (y >>> 1) ^ MAG01[y & 1];
- }
- for (int k = N - M; k < N - 1; ++k) {
- int mtCurr = mtNext;
- mtNext = mt[k + 1];
- y = (mtCurr & UPPER_MASK) | (mtNext & LOWER_MASK);
- mt[k] = mt[k + (M - N)] ^ (y >>> 1) ^ MAG01[y & 1];
- }
- y = (mtNext & UPPER_MASK) | (mt[0] & LOWER_MASK);
- mt[N - 1] = mt[M - 1] ^ (y >>> 1) ^ MAG01[y & 1];
-
- mti = 0;
- }
-
- y = mt[mti++];
-
- // Tempering.
- y ^= y >>> 11;
- y ^= (y << 7) & 0x9d2c5680;
- y ^= (y << 15) & 0xefc60000;
- y ^= y >>> 18;
-
- return y;
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/RandomIntSource.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/RandomIntSource.java
deleted file mode 100644
index 88f420c7c..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/RandomIntSource.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math4.rng.internal.source32;
-
-/**
- * Source of randomness that generate values of type {@code int}.
- *
- * @since 4.0
- */
-public interface RandomIntSource {
- /**
- * @return the next random value.
- */
- int next();
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well1024a.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/Well1024a.java
deleted file mode 100644
index 86c84c329..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well1024a.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-/**
- * This class implements the WELL1024a pseudo-random number generator
- * from François Panneton, Pierre L'Ecuyer and Makoto Matsumoto.
- *
- * This generator is described in a paper by François Panneton,
- * Pierre L'Ecuyer and Makoto Matsumoto
- *
- * Improved Long-Period Generators Based on Linear Recurrences Modulo 2
- * ACM Transactions on Mathematical Software, 32, 1 (2006).
- * The errata for the paper are in
- * wellrng-errata.txt.
- *
- *
- * @see WELL Random number generator
- * @since 4.0
- */
-public class Well1024a extends AbstractWell {
- /** Number of bits in the pool. */
- private static final int K = 1024;
- /** First parameter of the algorithm. */
- private static final int M1 = 3;
- /** Second parameter of the algorithm. */
- private static final int M2 = 24;
- /** Third parameter of the algorithm. */
- private static final int M3 = 10;
- /** The indirection index table. */
- private static final IndexTable TABLE = new IndexTable(K, M1, M2, M3);
-
- /**
- * Creates a new random number generator.
- *
- * @param seed Initial seed.
- */
- public Well1024a(int[] seed) {
- super(K, seed);
- }
-
- /** {@inheritDoc} */
- @Override
- public int next() {
- final int indexRm1 = TABLE.getIndexPred(index);
-
- final int v0 = v[index];
- final int vM1 = v[TABLE.getIndexM1(index)];
- final int vM2 = v[TABLE.getIndexM2(index)];
- final int vM3 = v[TABLE.getIndexM3(index)];
-
- final int z0 = v[indexRm1];
- final int z1 = v0 ^ (vM1 ^ (vM1 >>> 8));
- final int z2 = (vM2 ^ (vM2 << 19)) ^ (vM3 ^ (vM3 << 14));
- final int z3 = z1 ^ z2;
- final int z4 = (z0 ^ (z0 << 11)) ^ (z1 ^ (z1 << 7)) ^ (z2 ^ (z2 << 13));
-
- v[index] = z3;
- v[indexRm1] = z4;
- index = indexRm1;
-
- return z4;
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well19937a.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/Well19937a.java
deleted file mode 100644
index 7f83ddf00..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well19937a.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-/**
- * This class implements the WELL19937a pseudo-random number generator
- * from François Panneton, Pierre L'Ecuyer and Makoto Matsumoto.
- *
- * This generator is described in a paper by François Panneton,
- * Pierre L'Ecuyer and Makoto Matsumoto
- *
- * Improved Long-Period Generators Based on Linear Recurrences Modulo 2
- * ACM Transactions on Mathematical Software, 32, 1 (2006).
- * The errata for the paper are in
- * wellrng-errata.txt.
- *
- *
- * @see WELL Random number generator
- * @since 4.0
- */
-public class Well19937a extends AbstractWell {
- /** Number of bits in the pool. */
- private static final int K = 19937;
- /** First parameter of the algorithm. */
- private static final int M1 = 70;
- /** Second parameter of the algorithm. */
- private static final int M2 = 179;
- /** Third parameter of the algorithm. */
- private static final int M3 = 449;
- /** The indirection index table. */
- private static final IndexTable TABLE = new IndexTable(K, M1, M2, M3);
-
- /**
- * Creates a new random number generator.
- *
- * @param seed Initial seed.
- */
- public Well19937a(int[] seed) {
- super(K, seed);
- }
-
- /** {@inheritDoc} */
- @Override
- public int next() {
- final int indexRm1 = TABLE.getIndexPred(index);
- final int indexRm2 = TABLE.getIndexPred2(index);
-
- final int v0 = v[index];
- final int vM1 = v[TABLE.getIndexM1(index)];
- final int vM2 = v[TABLE.getIndexM2(index)];
- final int vM3 = v[TABLE.getIndexM3(index)];
-
- final int z0 = (0x80000000 & v[indexRm1]) ^ (0x7FFFFFFF & v[indexRm2]);
- final int z1 = (v0 ^ (v0 << 25)) ^ (vM1 ^ (vM1 >>> 27));
- final int z2 = (vM2 >>> 9) ^ (vM3 ^ (vM3 >>> 1));
- final int z3 = z1 ^ z2;
- final int z4 = z0 ^ (z1 ^ (z1 << 9)) ^ (z2 ^ (z2 << 21)) ^ (z3 ^ (z3 >>> 21));
-
- v[index] = z3;
- v[indexRm1] = z4;
- v[indexRm2] &= 0x80000000;
- index = indexRm1;
-
- return z4;
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well19937c.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/Well19937c.java
deleted file mode 100644
index 25b9d0365..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well19937c.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-/**
- * This class implements the WELL19937c pseudo-random number generator
- * from François Panneton, Pierre L'Ecuyer and Makoto Matsumoto.
- *
- * This generator is described in a paper by François Panneton,
- * Pierre L'Ecuyer and Makoto Matsumoto
- *
- * Improved Long-Period Generators Based on Linear Recurrences Modulo 2
- * ACM Transactions on Mathematical Software, 32, 1 (2006).
- * The errata for the paper are in
- * wellrng-errata.txt.
- *
- *
- * @see WELL Random number generator
- * @since 2.2
- */
-public class Well19937c extends AbstractWell {
- /** Number of bits in the pool. */
- private static final int K = 19937;
- /** First parameter of the algorithm. */
- private static final int M1 = 70;
- /** Second parameter of the algorithm. */
- private static final int M2 = 179;
- /** Third parameter of the algorithm. */
- private static final int M3 = 449;
- /** The indirection index table. */
- private static final IndexTable TABLE = new IndexTable(K, M1, M2, M3);
-
- /**
- * Creates a new random number generator.
- *
- * @param seed Initial seed.
- */
- public Well19937c(int[] seed) {
- super(K, seed);
- }
-
- /** {@inheritDoc} */
- @Override
- public int next() {
- final int indexRm1 = TABLE.getIndexPred(index);
- final int indexRm2 = TABLE.getIndexPred2(index);
-
- final int v0 = v[index];
- final int vM1 = v[TABLE.getIndexM1(index)];
- final int vM2 = v[TABLE.getIndexM2(index)];
- final int vM3 = v[TABLE.getIndexM3(index)];
-
- final int z0 = (0x80000000 & v[indexRm1]) ^ (0x7FFFFFFF & v[indexRm2]);
- final int z1 = (v0 ^ (v0 << 25)) ^ (vM1 ^ (vM1 >>> 27));
- final int z2 = (vM2 >>> 9) ^ (vM3 ^ (vM3 >>> 1));
- final int z3 = z1 ^ z2;
- int z4 = z0 ^ (z1 ^ (z1 << 9)) ^ (z2 ^ (z2 << 21)) ^ (z3 ^ (z3 >>> 21));
-
- v[index] = z3;
- v[indexRm1] = z4;
- v[indexRm2] &= 0x80000000;
- index = indexRm1;
-
- // add Matsumoto-Kurita tempering
- // to get a maximally-equidistributed generator
- z4 ^= (z4 << 7) & 0xe46e1700;
- z4 ^= (z4 << 15) & 0x9b868000;
-
- return z4;
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well44497a.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/Well44497a.java
deleted file mode 100644
index 8b72b83bf..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well44497a.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-/**
- * This class implements the WELL44497a pseudo-random number generator
- * from François Panneton, Pierre L'Ecuyer and Makoto Matsumoto.
- *
- * This generator is described in a paper by François Panneton,
- * Pierre L'Ecuyer and Makoto Matsumoto
- *
- * Improved Long-Period Generators Based on Linear Recurrences Modulo 2
- * ACM Transactions on Mathematical Software, 32, 1 (2006).
- * The errata for the paper are in
- * wellrng-errata.txt.
- *
- *
- * @see WELL Random number generator
- * @since 4.0
- */
-public class Well44497a extends AbstractWell {
- /** Number of bits in the pool. */
- private static final int K = 44497;
- /** First parameter of the algorithm. */
- private static final int M1 = 23;
- /** Second parameter of the algorithm. */
- private static final int M2 = 481;
- /** Third parameter of the algorithm. */
- private static final int M3 = 229;
- /** The indirection index table. */
- private static final IndexTable TABLE = new IndexTable(K, M1, M2, M3);
-
- /**
- * Creates a new random number generator.
- *
- * @param seed Initial seed.
- */
- public Well44497a(int[] seed) {
- super(K, seed);
- }
-
- /** {@inheritDoc} */
- @Override
- public int next() {
- final int indexRm1 = TABLE.getIndexPred(index);
- final int indexRm2 = TABLE.getIndexPred2(index);
-
- final int v0 = v[index];
- final int vM1 = v[TABLE.getIndexM1(index)];
- final int vM2 = v[TABLE.getIndexM2(index)];
- final int vM3 = v[TABLE.getIndexM3(index)];
-
- // the values below include the errata of the original article
- final int z0 = (0xFFFF8000 & v[indexRm1]) ^ (0x00007FFF & v[indexRm2]);
- final int z1 = (v0 ^ (v0 << 24)) ^ (vM1 ^ (vM1 >>> 30));
- final int z2 = (vM2 ^ (vM2 << 10)) ^ (vM3 << 26);
- final int z3 = z1 ^ z2;
- final int z2Prime = ((z2 << 9) ^ (z2 >>> 23)) & 0xfbffffff;
- final int z2Second = ((z2 & 0x00020000) != 0) ? (z2Prime ^ 0xb729fcec) : z2Prime;
- final int z4 = z0 ^ (z1 ^ (z1 >>> 20)) ^ z2Second ^ z3;
-
- v[index] = z3;
- v[indexRm1] = z4;
- v[indexRm2] &= 0xFFFF8000;
- index = indexRm1;
-
- return z4;
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well44497b.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/Well44497b.java
deleted file mode 100644
index 5300aba27..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well44497b.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-/**
- * This class implements the WELL44497b pseudo-random number generator
- * from François Panneton, Pierre L'Ecuyer and Makoto Matsumoto.
- *
- * This generator is described in a paper by François Panneton,
- * Pierre L'Ecuyer and Makoto Matsumoto
- *
- * Improved Long-Period Generators Based on Linear Recurrences Modulo 2
- * ACM Transactions on Mathematical Software, 32, 1 (2006).
- * The errata for the paper are in
- * wellrng-errata.txt.
- *
- *
- * @see WELL Random number generator
- * @since 4.0
- */
-public class Well44497b extends AbstractWell {
- /** Number of bits in the pool. */
- private static final int K = 44497;
- /** First parameter of the algorithm. */
- private static final int M1 = 23;
- /** Second parameter of the algorithm. */
- private static final int M2 = 481;
- /** Third parameter of the algorithm. */
- private static final int M3 = 229;
- /** The indirection index table. */
- private static final IndexTable TABLE = new IndexTable(K, M1, M2, M3);
-
- /**
- * Creates a new random number generator.
- *
- * @param seed Initial seed.
- */
- public Well44497b(int[] seed) {
- super(K, seed);
- }
-
- /** {@inheritDoc} */
- @Override
- public int next() {
- // compute raw value given by WELL44497a generator
- // which is NOT maximally-equidistributed
- final int indexRm1 = TABLE.getIndexPred(index);
- final int indexRm2 = TABLE.getIndexPred2(index);
-
- final int v0 = v[index];
- final int vM1 = v[TABLE.getIndexM1(index)];
- final int vM2 = v[TABLE.getIndexM2(index)];
- final int vM3 = v[TABLE.getIndexM3(index)];
-
- // the values below include the errata of the original article
- final int z0 = (0xFFFF8000 & v[indexRm1]) ^ (0x00007FFF & v[indexRm2]);
- final int z1 = (v0 ^ (v0 << 24)) ^ (vM1 ^ (vM1 >>> 30));
- final int z2 = (vM2 ^ (vM2 << 10)) ^ (vM3 << 26);
- final int z3 = z1 ^ z2;
- final int z2Prime = ((z2 << 9) ^ (z2 >>> 23)) & 0xfbffffff;
- final int z2Second = ((z2 & 0x00020000) != 0) ? (z2Prime ^ 0xb729fcec) : z2Prime;
- int z4 = z0 ^ (z1 ^ (z1 >>> 20)) ^ z2Second ^ z3;
-
- v[index] = z3;
- v[indexRm1] = z4;
- v[indexRm2] &= 0xFFFF8000;
- index = indexRm1;
-
- // add Matsumoto-Kurita tempering
- // to get a maximally-equidistributed generator
- z4 ^= (z4 << 7) & 0x93dd1400;
- z4 ^= (z4 << 15) & 0xfa118000;
-
- return z4;
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well512a.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/Well512a.java
deleted file mode 100644
index 1faf5711d..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/Well512a.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-/**
- * This class implements the WELL512a pseudo-random number generator
- * from François Panneton, Pierre L'Ecuyer and Makoto Matsumoto.
- *
- * This generator is described in a paper by François Panneton,
- * Pierre L'Ecuyer and Makoto Matsumoto
- *
- * Improved Long-Period Generators Based on Linear Recurrences Modulo 2
- * ACM Transactions on Mathematical Software, 32, 1 (2006).
- * The errata for the paper are in
- * wellrng-errata.txt.
- *
- *
- * @see WELL Random number generator
- * @since 4.0
- */
-public class Well512a extends AbstractWell {
- /** Number of bits in the pool. */
- private static final int K = 512;
- /** First parameter of the algorithm. */
- private static final int M1 = 13;
- /** Second parameter of the algorithm. */
- private static final int M2 = 9;
- /** Third parameter of the algorithm. */
- private static final int M3 = 5;
- /** The indirection index table. */
- private static final IndexTable TABLE = new IndexTable(K, M1, M2, M3);
-
- /**
- * Creates a new random number generator.
- *
- * @param seed Initial seed.
- */
- public Well512a(int[] seed) {
- super(K, seed);
- }
-
- /** {@inheritDoc} */
- @Override
- public int next() {
- final int indexRm1 = TABLE.getIndexPred(index);
-
- final int vi = v[index];
- final int vi1 = v[TABLE.getIndexM1(index)];
- final int vi2 = v[TABLE.getIndexM2(index)];
- final int z0 = v[indexRm1];
-
- // the values below include the errata of the original article
- final int z1 = (vi ^ (vi << 16)) ^ (vi1 ^ (vi1 << 15));
- final int z2 = vi2 ^ (vi2 >>> 11);
- final int z3 = z1 ^ z2;
- final int z4 = (z0 ^ (z0 << 2)) ^ (z1 ^ (z1 << 18)) ^ (z2 << 28) ^ (z3 ^ ((z3 << 5) & 0xda442d24));
-
- v[index] = z3;
- v[indexRm1] = z4;
- index = indexRm1;
-
- return z4;
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source32/package-info.java b/src/main/java/org/apache/commons/math4/rng/internal/source32/package-info.java
deleted file mode 100644
index bb7d2e2d4..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source32/package-info.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- *
- * Concrete algorithms for {@code int}-based sources of randomness
- *
- *
- *
- * For internal use only: Direct access to classes in this package
- * is discouraged, as they could be modified without notice.
- *
- *
- * Notes for developers
- *
- *
- * -
- * A source of randomness must inherit from
- * {@link org.apache.commons.math4.rng.internal.source32.IntProvider}
- *
- * -
- * The "provider" must specify one way for setting the seed.
- * For a given seed, the generated sequence must always be the same.
- *
- * -
- * The "provider" must implement methods {@code getStateInternal} and
- * {@code setStateInternal} in order to save and restore the state of an
- * instance (cf. {@link org.apache.commons.math4.rng.internal.BaseProvider}).
- *
- * -
- * When a new class is implemented here, user-access to it must be provided
- * through associated {@link org.apache.commons.math4.rng.RandomSource
- * factory methods}.
- *
- *
- */
-
-package org.apache.commons.math4.rng.internal.source32;
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source64/LongProvider.java b/src/main/java/org/apache/commons/math4/rng/internal/source64/LongProvider.java
deleted file mode 100644
index 3e73f058a..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source64/LongProvider.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math4.rng.internal.source64;
-
-import org.apache.commons.math4.exception.OutOfRangeException;
-import org.apache.commons.math4.rng.internal.util.NumberFactory;
-import org.apache.commons.math4.rng.internal.BaseProvider;
-
-/**
- * Base class for all implementations that provide a {@code long}-based
- * source randomness.
- */
-public abstract class LongProvider
- extends BaseProvider
- implements RandomLongSource {
-
- /** {@inheritDoc} */
- @Override
- public abstract long next();
-
- /** {@inheritDoc} */
- @Override
- public long nextLong() {
- return next();
- }
-
- /** {@inheritDoc} */
- @Override
- public int nextInt() {
- return NumberFactory.makeInt(nextLong());
- }
-
- /** {@inheritDoc} */
- @Override
- public double nextDouble() {
- return NumberFactory.makeDouble(nextLong());
- }
-
- /** {@inheritDoc} */
- @Override
- public boolean nextBoolean() {
- return NumberFactory.makeBoolean(nextLong());
- }
-
- /** {@inheritDoc} */
- @Override
- public float nextFloat() {
- return NumberFactory.makeFloat(nextInt());
- }
-
- /** {@inheritDoc} */
- @Override
- public void nextBytes(byte[] bytes) {
- nextBytesFill(this, bytes, 0, bytes.length);
- }
-
- /** {@inheritDoc} */
- @Override
- public void nextBytes(byte[] bytes,
- int start,
- int len) {
- if (start < 0 ||
- start >= bytes.length) {
- throw new OutOfRangeException(start, 0, bytes.length);
- }
- if (len < 0 ||
- len > bytes.length - start) {
- throw new OutOfRangeException(len, 0, bytes.length - start);
- }
-
- nextBytesFill(this, bytes, start, len);
- }
-
- /**
- * Generates random bytes and places them into a user-supplied array.
- *
- *
- * The array is filled with bytes extracted from random {@code long} values.
- * This implies that the number of random bytes generated may be larger than
- * the length of the byte array.
- *
- *
- * @param source Source of randomness.
- * @param bytes Array in which to put the generated bytes. Cannot be null.
- * @param start Index at which to start inserting the generated bytes.
- * @param len Number of bytes to insert.
- */
- static void nextBytesFill(RandomLongSource source,
- byte[] bytes,
- int start,
- int len) {
- int index = start; // Index of first insertion.
-
- // Index of first insertion plus multiple of 8 part of length
- // (i.e. length with 3 least significant bits unset).
- final int indexLoopLimit = index + (len & 0x7ffffff8);
-
- // Start filling in the byte array, 8 bytes at a time.
- while (index < indexLoopLimit) {
- final long random = source.next();
- bytes[index++] = (byte) random;
- bytes[index++] = (byte) (random >>> 8);
- bytes[index++] = (byte) (random >>> 16);
- bytes[index++] = (byte) (random >>> 24);
- bytes[index++] = (byte) (random >>> 32);
- bytes[index++] = (byte) (random >>> 40);
- bytes[index++] = (byte) (random >>> 48);
- bytes[index++] = (byte) (random >>> 56);
- }
-
- final int indexLimit = start + len; // Index of last insertion + 1.
-
- // Fill in the remaining bytes.
- if (index < indexLimit) {
- long random = source.next();
- while (true) {
- bytes[index++] = (byte) random;
- if (index < indexLimit) {
- random >>>= 8;
- } else {
- break;
- }
- }
- }
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source64/MersenneTwister64.java b/src/main/java/org/apache/commons/math4/rng/internal/source64/MersenneTwister64.java
deleted file mode 100644
index 0280842b4..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source64/MersenneTwister64.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source64;
-
-import java.util.Arrays;
-import org.apache.commons.math4.exception.InsufficientDataException;
-import org.apache.commons.math4.rng.internal.util.NumberFactory;
-
-/**
- * This class provides the 64-bits version of the originally 32-bits
- * {@link org.apache.commons.math4.rng.internal.source32.MersenneTwister
- * Mersenne Twister}.
- *
- *
- * This class is mainly a Java port of
- *
- * the 2014/2/23 version of the generator
- * written in C by Takuji Nishimura and Makoto Matsumoto.
- *
- *
- *
- * Here is their original copyright:
- *
- *
- *
- * Copyright (C) 2004, Makoto Matsumoto and Takuji Nishimura,
- * All rights reserved. |
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * - The names of its contributors may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- * |
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE. |
- *
- *
- * @since 4.0
- */
-public class MersenneTwister64 extends LongProvider {
- /** Size of the bytes pool. */
- private static final int NN = 312;
- /** Period second parameter. */
- private static final int MM = 156;
- /** X * MATRIX_A for X = {0, 1}. */
- private static final long[] MAG01 = { 0x0, 0xb5026f5aa96619e9L };
- /** Most significant 33 bits. */
- private static final long UM = 0xffffffff80000000L;
- /** Least significant 31 bits. */
- private static final long LM = 0x7fffffffL;
- /** Bytes pool. */
- private long[] mt = new long[NN];
- /** Current index in the bytes pool. */
- private int mti;
-
- /**
- * Creates a new random number generator.
- *
- * @param seed Initial seed.
- */
- public MersenneTwister64(long[] seed) {
- setSeedInternal(seed);
- }
-
- /** {@inheritDoc} */
- @Override
- protected byte[] getStateInternal() {
- final long[] s = Arrays.copyOf(mt, NN + 1);
- s[NN] = mti;
-
- return NumberFactory.makeByteArray(s);
- }
-
- /** {@inheritDoc} */
- @Override
- protected void setStateInternal(byte[] s) {
- if (s.length != (NN + 1) * 8) {
- throw new InsufficientDataException();
- }
-
- final long[] tmp = NumberFactory.makeLongArray(s);
-
- System.arraycopy(tmp, 0, mt, 0, NN);
- mti = (int) tmp[NN];
- }
-
- /**
- * Reinitializes the generator as if just built with the given seed.
- *
- * @param seed Initial seed.
- */
- private void setSeedInternal(long[] seed) {
- initState(19650218L);
-
- int i = 1;
- int j = 0;
-
- for (int k = Math.max(NN, seed.length); k != 0; k--) {
- final long mm1 = mt[i - 1];
- mt[i] = (mt[i] ^ ((mm1 ^ (mm1 >>> 62)) * 0x369dea0f31a53f85L)) + seed[j] + j; // non linear
- i++;
- j++;
- if (i >= NN) {
- mt[0] = mt[NN - 1];
- i = 1;
- }
- if (j >= seed.length) {
- j = 0;
- }
- }
- for (int k = NN - 1; k != 0; k--) {
- final long mm1 = mt[i - 1];
- mt[i] = (mt[i] ^ ((mm1 ^ (mm1 >>> 62)) * 0x27bb2ee687b0b0fdL)) - i; // non linear
- i++;
- if (i >= NN) {
- mt[0] = mt[NN - 1];
- i = 1;
- }
- }
-
- mt[0] = 0x8000000000000000L; // MSB is 1; assuring non-zero initial array
- }
-
- /**
- * Initialize the internal state of this instance.
- *
- * @param seed Seed.
- */
- private void initState(long seed) {
- mt[0] = seed;
- for (mti = 1; mti < NN; mti++) {
- final long mm1 = mt[mti - 1];
- mt[mti] = 0x5851f42d4c957f2dL * (mm1 ^ (mm1 >>> 62)) + mti;
- }
- }
-
- /** {@inheritDoc} */
- @Override
- public long next() {
- long x;
-
- if (mti >= NN) { // generate NN words at one time
- for (int i = 0; i < NN - MM; i++) {
- x = (mt[i] & UM) | (mt[i + 1] & LM);
- mt[i] = mt[i + MM] ^ (x >>> 1) ^ MAG01[(int)(x & 0x1L)];
- }
- for (int i = NN - MM; i < NN - 1; i++) {
- x = (mt[i] & UM) | (mt[i + 1] & LM);
- mt[i] = mt[ i + (MM - NN)] ^ (x >>> 1) ^ MAG01[(int)(x & 0x1L)];
- }
-
- x = (mt[NN - 1] & UM) | (mt[0] & LM);
- mt[NN - 1] = mt[MM - 1] ^ (x >>> 1) ^ MAG01[(int)(x & 0x1L)];
-
- mti = 0;
- }
-
- x = mt[mti++];
-
- x ^= (x >>> 29) & 0x5555555555555555L;
- x ^= (x << 17) & 0x71d67fffeda60000L;
- x ^= (x << 37) & 0xfff7eee000000000L;
- x ^= x >>> 43;
-
- return x;
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source64/RandomLongSource.java b/src/main/java/org/apache/commons/math4/rng/internal/source64/RandomLongSource.java
deleted file mode 100644
index 0daa0684b..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source64/RandomLongSource.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math4.rng.internal.source64;
-
-/**
- * Source of randomness that generate values of type {@code long}.
- *
- * @since 4.0
- */
-public interface RandomLongSource {
- /**
- * @return the next random value.
- */
- long next();
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source64/SplitMix64.java b/src/main/java/org/apache/commons/math4/rng/internal/source64/SplitMix64.java
deleted file mode 100644
index 086bd0322..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source64/SplitMix64.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math4.rng.internal.source64;
-
-import org.apache.commons.math4.exception.InsufficientDataException;
-import org.apache.commons.math4.rng.internal.util.NumberFactory;
-
-/**
- * A fast RNG, with 64 bits of state, that can be used to initialize the
- * state of other generators.
- *
- * @see
- * Original source code
- *
- * @since 4.0
- */
-public class SplitMix64 extends LongProvider {
- /** State. */
- private long state;
-
- /**
- * Creates a new instance.
- *
- * @param seed Initial seed.
- */
- public SplitMix64(Long seed) {
- setSeedInternal(seed);
- }
-
- /**
- * Seeds the RNG.
- *
- * @param seed Seed.
- */
- private void setSeedInternal(Long seed) {
- state = seed;
- }
-
- /** {@inheritDoc} */
- @Override
- public long next() {
- long z = state += 0x9e3779b97f4a7c15L;
- z = (z ^ (z >>> 30)) * 0xbf58476d1ce4e5b9L;
- z = (z ^ (z >>> 27)) * 0x94d049bb133111ebL;
- return z ^ (z >>> 31);
- }
-
- /** {@inheritDoc} */
- @Override
- protected byte[] getStateInternal() {
- return NumberFactory.makeByteArray(state);
- }
-
- /** {@inheritDoc} */
- @Override
- protected void setStateInternal(byte[] s) {
- if (s.length != 8) {
- throw new InsufficientDataException();
- }
-
- state = NumberFactory.makeLong(s);
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source64/TwoCmres.java b/src/main/java/org/apache/commons/math4/rng/internal/source64/TwoCmres.java
deleted file mode 100644
index d6fdcd6e5..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source64/TwoCmres.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math4.rng.internal.source64;
-
-import java.util.List;
-import java.util.ArrayList;
-import org.apache.commons.math4.exception.MathInternalError;
-import org.apache.commons.math4.exception.OutOfRangeException;
-import org.apache.commons.math4.exception.InsufficientDataException;
-import org.apache.commons.math4.rng.internal.util.NumberFactory;
-
-/**
- * Random number generator designed by Mark D. Overton.
- *
- * It is one of the many generators described by the author in the following article series:
- *
- *
- *
- * @since 4.0
- */
-public class TwoCmres extends LongProvider {
- /** A small positive integer. */
- private static final byte SEED_GUARD = 9;
- /** Factory of instances of this class. Singleton. */
- private static final Cmres.Factory FACTORY = new Cmres.Factory();
- /** First subcycle generator. */
- private final Cmres x;
- /** Second subcycle generator. */
- private final Cmres y;
- /** State of first subcycle generator. */
- private long xx;
- /** State of second subcycle generator. */
- private long yy;
-
- /**
- * Creates a new instance.
- *
- * @param seed Initial seed.
- * @param x First subcycle generator.
- * @param y Second subcycle generator.
- * @throws InsufficientDataException if {@code x == y}.
- */
- private TwoCmres(int seed,
- Cmres x,
- Cmres y) {
- if (x == y) {
- throw new InsufficientDataException();
- }
- this.x = x;
- this.y = y;
- setSeedInternal(seed);
- }
-
- /**
- * Creates a new instance.
- *
- * @param seed Seed.
- */
- public TwoCmres(Integer seed) {
- this(seed, 0, 1);
- }
-
- /**
- * Creates a new instance.
- *
- * @param seed Seed.
- * @param i Table entry for first subcycle generator.
- * @param j Table entry for second subcycle generator.
- * @throws InsufficientDataException if {@code i == j}.
- * @throws OutOfRangeException if {@code i < 0} or
- * {@code i >= numberOfSubcycleGenerators()}.
- * @throws OutOfRangeException if {@code j < 0} or
- * {@code j >= numberOfSubcycleGenerators()}.
- */
- public TwoCmres(Integer seed,
- int i,
- int j) {
- this(seed, FACTORY.get(i), FACTORY.get(j));
- }
-
- /** {@inheritDoc} */
- @Override
- public long next() {
- xx = x.transform(xx);
- yy = y.transform(yy);
-
- return xx + yy;
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return super.toString() + " (" + x + " + " + y + ")";
- }
-
- /**
- * @return the number of subcycle generators.
- */
- public static int numberOfSubcycleGenerators() {
- return FACTORY.numberOfSubcycleGenerators();
- }
-
- /** {@inheritDoc} */
- @Override
- protected byte[] getStateInternal() {
- return NumberFactory.makeByteArray(new long[] { xx, yy });
- }
-
- /** {@inheritDoc} */
- @Override
- protected void setStateInternal(byte[] s) {
- if (s.length != 16) {
- throw new InsufficientDataException();
- }
-
- final long[] state = NumberFactory.makeLongArray(s);
- xx = state[0];
- yy = state[1];
- }
-
- /**
- * @param seed Seed.
- */
- private void setSeedInternal(int seed) {
- // The seeding procedure consists in going away from some
- // point known to be in the cycle.
- // The total number of calls to the "transform" method will
- // not exceed about 130,000 (which is negligible as seeding
- // will not occur more than once in normal usage).
-
- // Make two positive 16-bits integers.
- final long s = NumberFactory.makeLong(0, seed); // s >= 0
- final int xMax = (int) (s & 0xffff + SEED_GUARD);
- final int yMax = (int) ((s >> 16) + SEED_GUARD);
-
- if (xMax < 0 ||
- yMax < 0) {
- throw new MathInternalError();
- }
-
- xx = x.getStart();
- for (int i = xMax; i > 0; i--) {
- xx = x.transform(xx);
- }
-
- yy = y.getStart();
- for (int i = yMax; i > 0; i--) {
- yy = y.transform(yy);
- }
- }
-
- /**
- * Subcycle generator.
- * Class is immutable.
- */
- static class Cmres {
- /** Cycle start. */
- private final int start;
- /** Multiplier. */
- private final long multiply;
- /** Rotation. */
- private final int rotate;
-
- /**
- * @param multiply Multiplier.
- * @param rotate Positive number. Must be in {@code [0, 64]}.
- * @param start Cycle start.
- */
- Cmres(long multiply,
- int rotate,
- int start) {
- this.multiply = multiply;
- this.rotate = rotate;
- this.start = start;
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- final String sep = ", ";
- // Use hexadecimal for "multiplier" field.
- final String m = String.format((java.util.Locale) null, "0x%016xL", multiply);
- return "Cmres: [" + m + sep + rotate + sep + start + "]";
- }
-
- /**
- * @return the multiplier.
- */
- public long getMultiply() {
- return multiply;
- }
-
- /**
- * @return the cycle start.
- */
- public int getStart() {
- return start;
- }
-
- /**
- * @param state Current state.
- * @return the new state.
- */
- long transform(long state) {
- long s = state;
- s *= multiply;
- s = rotl(s);
- s -= state;
- return s;
- }
-
- /**
- * @param state State.
- * @return the rotated state.
- */
- private long rotl(long state) {
- return (state << rotate) | (state >>> (64 - rotate));
- }
-
- /** Factory. */
- static class Factory {
- /** List of good "Cmres" subcycle generators. */
- private static final List TABLE = new ArrayList();
-
- /**
- * Populates the table.
- * It lists parameters known to be good (provided in
- * the article referred to above).
- * To maintain compatibility, new entries must be added
- * only at the end of the table.
- */
- static {
- add(0xedce446814d3b3d9L, 33, 0x13b572e7);
- add(0xc5b3cf786c806df7L, 33, 0x13c8e18a);
- add(0xdd91bbb8ab9e0e65L, 31, 0x06dd03a6);
- add(0x7b69342c0790221dL, 31, 0x1646bb8b);
- add(0x0c72c0d18614c32bL, 33, 0x06014a3d);
- add(0xd8d98c13bebe26c9L, 33, 0x014e8475);
- add(0xcb039dc328bbc40fL, 31, 0x008684bd);
- add(0x858c5ef3c021ed2fL, 32, 0x0dc8d622);
- add(0x4c8be96bfc23b127L, 33, 0x0b6b20cc);
- add(0x11eab77f808cf641L, 32, 0x06534421);
- add(0xbc9bd78810fd28fdL, 31, 0x1d9ba40d);
- add(0x0f1505c780688cb5L, 33, 0x0b7b7b67);
- add(0xadc174babc2053afL, 31, 0x267f4197);
- add(0x900b6b82b31686d9L, 31, 0x023c6985);
- // Add new entries here.
- }
-
- /**
- * @return the number of subcycle generators.
- */
- int numberOfSubcycleGenerators() {
- return TABLE.size();
- }
-
- /**
- * @param index Index into the list of available generators.
- * @return the subcycle generator entry at index {@code index}.
- */
- Cmres get(int index) {
- if (index < 0 ||
- index >= TABLE.size()) {
- throw new OutOfRangeException(index, 0, TABLE.size());
- }
-
- return TABLE.get(index);
- }
-
- /**
- * Adds an entry to the {@link Factory#TABLE}.
- *
- * @param multiply Multiplier.
- * @param rotate Rotate.
- * @param start Cycle start.
- */
- private static void add(long multiply,
- int rotate,
- int start) {
- // Sanity check: if there are duplicates, the class initialization
- // will fail (and the JVM will report "NoClassDefFoundError").
- for (Cmres sg : TABLE) {
- if (multiply == sg.getMultiply()) {
- throw new MathInternalError();
- }
- }
-
- TABLE.add(new Cmres(multiply, rotate, start));
- }
- }
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source64/XorShift1024Star.java b/src/main/java/org/apache/commons/math4/rng/internal/source64/XorShift1024Star.java
deleted file mode 100644
index c6bcfaae2..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source64/XorShift1024Star.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math4.rng.internal.source64;
-
-import java.util.Arrays;
-import org.apache.commons.math4.exception.InsufficientDataException;
-import org.apache.commons.math4.rng.internal.util.NumberFactory;
-
-/**
- * A fast RNG.
- *
- * @see
- * Original source code
- *
- * @since 4.0
- */
-public class XorShift1024Star extends LongProvider {
- /** Size of the state vector. */
- private static final int SEED_SIZE = 16;
- /** State. */
- private final long[] state = new long[SEED_SIZE];
- /** Index in "state" array. */
- private int index;
-
- /**
- * Creates a new instance.
- *
- * @param seed Initial seed.
- * If the length is larger than 16, only the first 16 elements will
- * be used; if smaller, the remaining elements will be automatically
- * set.
- */
- public XorShift1024Star(long[] seed) {
- setSeedInternal(seed);
- }
-
- /** {@inheritDoc} */
- @Override
- protected byte[] getStateInternal() {
- final long[] s = Arrays.copyOf(state, SEED_SIZE + 1);
- s[SEED_SIZE] = index;
-
- return NumberFactory.makeByteArray(s);
- }
-
- /** {@inheritDoc} */
- @Override
- protected void setStateInternal(byte[] s) {
- if (s.length != (SEED_SIZE + 1) * 8) {
- throw new InsufficientDataException();
- }
-
- final long[] tmp = NumberFactory.makeLongArray(s);
-
- System.arraycopy(tmp, 0, state, 0, SEED_SIZE);
- index = (int) tmp[SEED_SIZE];
- }
-
- /**
- * Seeds the RNG.
- *
- * @param seed Seed.
- */
- private void setSeedInternal(long[] seed) {
- // Reset the whole state of this RNG (i.e. "state" and "index").
- // Seeding procedure is not part of the reference code.
-
- System.arraycopy(seed, 0, state, 0, Math.min(seed.length, state.length));
-
- if (seed.length < SEED_SIZE) {
- for (int i = seed.length; i < SEED_SIZE; i++) {
- state[i] = 26021969L * i;
- }
- for (int i = SEED_SIZE - 1; i > seed.length; i--) {
- state[i] ^= state[SEED_SIZE - i - 1];
- }
-
- state[seed.length] = 0x8000000000000000L; // Ensuring non-zero initial array.
- }
-
- index = 0;
- }
-
- /** {@inheritDoc} */
- @Override
- public long next() {
- final long s0 = state[index];
- long s1 = state[index = (index + 1) & 15];
- s1 ^= s1 << 31; // a
- state[index] = s1 ^ s0 ^ (s1 >>> 11) ^ (s0 >>> 30); // b,c
- return state[index] * 1181783497276652981L;
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/source64/package-info.java b/src/main/java/org/apache/commons/math4/rng/internal/source64/package-info.java
deleted file mode 100644
index 8afab2c9d..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/source64/package-info.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- *
- * Concrete algorithms for {@code long}-based sources of randomness
- *
- *
- *
- * For internal use only: Direct access to classes in this package
- * is discouraged, as they could be modified without notice.
- *
- *
- * Notes for developers
- *
- *
- * -
- * A source of randomness must inherit from
- * {@link org.apache.commons.math4.rng.internal.source64.LongProvider}
- *
- * -
- * The "provider" must specify one way for setting the seed.
- * For a given seed, the generated sequence must always be the same.
- *
- * -
- * The "provider" must implement methods {@code getStateInternal} and
- * {@code setStateInternal} in order to save and restore the state of an
- * instance (cf. {@link org.apache.commons.math4.rng.internal.BaseProvider}).
- *
- * -
- * When a new class is implemented here, user-access to it must be provided
- * through associated {@link org.apache.commons.math4.rng.RandomSource
- * factory methods}.
- *
- *
- */
-
-package org.apache.commons.math4.rng.internal.source64;
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/Int2Long.java b/src/main/java/org/apache/commons/math4/rng/internal/util/Int2Long.java
deleted file mode 100644
index d423c084e..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/Int2Long.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-/**
- * Converts a {@code Integer} to an {@code Long}.
- *
- * @since 4.0
- */
-public class Int2Long implements SeedConverter {
- /** {@inheritDoc} */
- @Override
- public Long convert(Integer seed) {
- final int s = seed;
- return NumberFactory.makeLong(s, ~s);
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName();
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/IntArray2Int.java b/src/main/java/org/apache/commons/math4/rng/internal/util/IntArray2Int.java
deleted file mode 100644
index 030895d06..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/IntArray2Int.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-/**
- * Creates a single value by "xor" of all the values in the input array.
- *
- * @since 4.0
- */
-public class IntArray2Int implements SeedConverter {
- /** {@inheritDoc} */
- @Override
- public Integer convert(int[] seed) {
- int out = 0;
- for (int i = 0; i < seed.length; i++) {
- out ^= seed[i];
- }
-
- return out;
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName();
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/IntArray2LongArray.java b/src/main/java/org/apache/commons/math4/rng/internal/util/IntArray2LongArray.java
deleted file mode 100644
index 399de7f51..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/IntArray2LongArray.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-/**
- * Creates a {@code long[]} from an {@code int[]}.
- *
- * @since 4.0
- */
-public class IntArray2LongArray implements SeedConverter {
- /** {@inheritDoc} */
- @Override
- public long[] convert(int[] seed) {
- final int outSize = (seed.length + 1) / 2;
- final long[] out = new long[outSize];
- for (int i = 0; i < outSize; i++) {
- final int lo = seed[i];
- final int hi = outSize + i < seed.length ? seed[outSize + i] : 0;
- out[i] = NumberFactory.makeLong(hi, lo) ;
- }
-
- return out;
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName();
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/Long2Int.java b/src/main/java/org/apache/commons/math4/rng/internal/util/Long2Int.java
deleted file mode 100644
index 638b17337..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/Long2Int.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-/**
- * Converts a {@code Long} to an {@code Integer}.
- *
- * @since 4.0
- */
-public class Long2Int implements SeedConverter {
- /** {@inheritDoc} */
- @Override
- public Integer convert(Long seed) {
- return NumberFactory.makeInt(seed);
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName();
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/Long2IntArray.java b/src/main/java/org/apache/commons/math4/rng/internal/util/Long2IntArray.java
deleted file mode 100644
index 84e5016ea..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/Long2IntArray.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-import org.apache.commons.math4.rng.internal.source64.SplitMix64;
-
-/**
- * Uses a {@code long} value to seed a {@link SplitMix64} RNG and
- * create a {@code int[]} with the requested number of random
- * values.
- *
- * @since 4.0
- */
-public class Long2IntArray implements SeedConverter {
- /** Size of the output array. */
- private final int size;
-
- /**
- * @param size Size of the output array.
- */
- public Long2IntArray(int size) {
- this.size = size;
- }
-
- /** {@inheritDoc} */
- @Override
- public int[] convert(Long seed) {
- return SeedFactory.createIntArray(size, new SplitMix64(seed));
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName() + "(size=" + size + ")";
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/Long2LongArray.java b/src/main/java/org/apache/commons/math4/rng/internal/util/Long2LongArray.java
deleted file mode 100644
index 9d8b70078..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/Long2LongArray.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-import org.apache.commons.math4.rng.internal.source64.SplitMix64;
-
-/**
- * Uses a {@code Long} value to seed a {@link SplitMix64} RNG and
- * create a {@code long[]} with the requested number of random
- * values.
- *
- * @since 4.0
- */
-public class Long2LongArray implements SeedConverter {
- /** Size of the output array. */
- private final int size;
-
- /**
- * @param size Size of the output array.
- */
- public Long2LongArray(int size) {
- this.size = size;
- }
-
- /** {@inheritDoc} */
- @Override
- public long[] convert(Long seed) {
- final long[] out = new long[size];
- final SplitMix64 rng = new SplitMix64(seed);
- for (int i = 0; i < size; i++) {
- out[i] = rng.nextLong();
- }
-
- return out;
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName() + "(size: " + size + ")";
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/LongArray2IntArray.java b/src/main/java/org/apache/commons/math4/rng/internal/util/LongArray2IntArray.java
deleted file mode 100644
index 67b2ba84e..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/LongArray2IntArray.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-/**
- * Creates an {@code int[]} from a {@code long[]}.
- *
- * @since 4.0
- */
-public class LongArray2IntArray implements SeedConverter {
- /** {@inheritDoc} */
- @Override
- public int[] convert(long[] seed) {
- final int[] out = new int[seed.length * 2];
- for (int i = 0; i < seed.length; i++) {
- final long current = seed[i];
- out[i] = NumberFactory.extractLo(current);
- out[seed.length + i] = NumberFactory.extractHi(current);
- }
-
- return out;
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName();
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/LongArray2Long.java b/src/main/java/org/apache/commons/math4/rng/internal/util/LongArray2Long.java
deleted file mode 100644
index 4556aaf64..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/LongArray2Long.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-/**
- * Creates a single value by "xor" of all the values in the input array.
- *
- * @since 4.0
- */
-public class LongArray2Long implements SeedConverter {
- /** {@inheritDoc} */
- @Override
- public Long convert(long[] seed) {
- long out = 0;
- for (int i = 0; i < seed.length; i++) {
- out ^= seed[i];
- }
-
- return out;
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName();
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/LongMixInt.java b/src/main/java/org/apache/commons/math4/rng/internal/util/LongMixInt.java
deleted file mode 100644
index e30a0727e..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/LongMixInt.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-import org.apache.commons.math4.rng.internal.source64.SplitMix64;
-
-/**
- * Uses a {@code long} value to seed a {@link SplitMix64} RNG and
- * create an {@code int[]} with the requested number of random
- * values.
- *
- * @since 4.0
- */
-public class LongMixInt implements SeedConverter {
- /** Size of the output array. */
- private final int size;
-
- /**
- * @param size Size of the output array.
- */
- public LongMixInt(int size) {
- this.size = size;
- }
-
- /** {@inheritDoc} */
- @Override
- public int[] convert(Long seed) {
- return SeedFactory.createIntArray(size, new SplitMix64(seed));
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName() + "(size=" + size + ")";
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/LongMixLong.java b/src/main/java/org/apache/commons/math4/rng/internal/util/LongMixLong.java
deleted file mode 100644
index 12fb59e17..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/LongMixLong.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-import org.apache.commons.math4.rng.internal.source64.SplitMix64;
-
-/**
- * Uses a {@code long} value to seed a {@link SplitMix64} RNG and
- * create a {@code long[]} with the requested number of random
- * values.
- *
- * @since 4.0
- */
-public class LongMixLong implements SeedConverter {
- /** Size of the output array. */
- private final int size;
-
- /**
- * @param size Size of the output array.
- */
- public LongMixLong(int size) {
- this.size = size;
- }
-
- /** {@inheritDoc} */
- @Override
- public long[] convert(Long seed) {
- final long[] out = new long[size];
- final SplitMix64 rng = new SplitMix64(seed);
- for (int i = 0; i < size; i++) {
- out[i] = rng.nextLong();
- }
-
- return out;
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName() + "(size: " + size + ")";
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/NoOpConverter.java b/src/main/java/org/apache/commons/math4/rng/internal/util/NoOpConverter.java
deleted file mode 100644
index 08aee80f4..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/NoOpConverter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-
-/**
- * Dummy converter that simply passes on its input.
- * It can be useful to avoid "unchecked" compiler warnings.
- *
- * @param Seed type.
- *
- * @since 4.0
- */
-public class NoOpConverter implements SeedConverter {
- /** {@inheritDoc} */
- @Override
- public SEED convert(SEED seed) {
- return seed;
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return "Pass-through";
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/NumberFactory.java b/src/main/java/org/apache/commons/math4/rng/internal/util/NumberFactory.java
deleted file mode 100644
index befb16c3c..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/NumberFactory.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-import java.util.Arrays;
-import org.apache.commons.math4.exception.DimensionMismatchException;
-
-/**
- * Utility for creating number types from one or two {@code int} values
- * or one {@code long} value, or a sequence of bytes.
- */
-public final class NumberFactory {
- /** See {@link #makeDouble(long)} */
- private static final long DOUBLE_HIGH_BITS = 0x3ffL << 52;
- /** See {@link #makeFloat(int)} */
- private static final float FLOAT_MULTIPLIER = 0x1.0p-23f;
- /** See {@link #makeDouble(int, int)} */
- private static final double DOUBLE_MULTIPLIER = 0x1.0p-52d;
- /** Lowest byte mask. */
- private static final long LONG_LOWEST_BYTE_MASK = 0xffL;
- /** Number of bytes in a {@code long} */
- private static final int LONG_SIZE = 8;
- /** Lowest byte mask. */
- private static final int INT_LOWEST_BYTE_MASK = 0xff;
- /** Number of bytes in a {@code int} */
- private static final int INT_SIZE = 4;
-
- /**
- * Class contains only static methods.
- */
- private NumberFactory() {}
-
- /**
- * @param v Number.
- * @return a boolean.
- */
- public static boolean makeBoolean(int v) {
- return (v >>> 31) != 0;
- }
-
- /**
- * @param v Number.
- * @return a boolean.
- */
- public static boolean makeBoolean(long v) {
- return (v >>> 63) != 0;
- }
-
- /**
- * @param v Number.
- * @return a {@code double} value in the interval {@code [0, 1]}.
- */
- public static double makeDouble(long v) {
- // http://xorshift.di.unimi.it
- return Double.longBitsToDouble(DOUBLE_HIGH_BITS | v >>> 12) - 1d;
- }
-
- /**
- * @param v Number (high order bits).
- * @param w Number (low order bits).
- * @return a {@code double} value in the interval {@code [0, 1]}.
- */
- public static double makeDouble(int v,
- int w) {
- final long high = ((long) (v >>> 6)) << 26;
- final int low = w >>> 6;
- return (high | low) * DOUBLE_MULTIPLIER;
- }
-
- /**
- * @param v Number.
- * @return a {@code float} value in the interval {@code [0, 1]}.
- */
- public static float makeFloat(int v) {
- return (v >>> 9) * FLOAT_MULTIPLIER;
- }
-
- /**
- * @param v Number (high order bits).
- * @param w Number (low order bits).
- * @return a {@code long} value.
- */
- public static long makeLong(int v,
- int w) {
- return (((long) v) << 32) | (w & 0xffffffffL);
- }
-
- /**
- * Creates an {@code int} from a {@code long}.
- *
- * @param v Number.
- * @return an {@code int} value made from the "xor" of the
- * {@link #extractHi(long) high order bits} and
- * {@link #extractLo(long) low order bits} of {@code v}.
- */
- public static int makeInt(long v) {
- return extractHi(v) ^ extractLo(v);
- }
-
- /**
- * Creates an {@code int} from a {@code long}, using the high order bits.
- *
- * The returned value is such that if
- *
- * vL = extractLo(v);
- * vH = extractHi(v);
- *
- * then {@code v} is equal to {@link #makeLong(int,int) makeLong(vH, vL)}.
- *
- *
- * @param v Number.
- * @return an {@code int} value made from the most significant bits
- * of {@code v}.
- */
- public static int extractHi(long v) {
- return (int) (v >>> 32);
- }
-
- /**
- * Creates an {@code int} from a {@code long}, using the low order bits.
- *
- * The returned value is such that if
- *
- * vL = extractLo(v);
- * vH = extractHi(v);
- *
- * then {@code v} is equal to {@link #makeLong(int,int) makeLong(vH, vL)}.
- *
- *
- * @param v Number.
- * @return an {@code int} value made from the least significant bits
- * of {@code v}.
- */
- public static int extractLo(long v) {
- return (int) v;
- }
-
- /**
- * Splits a {@code long} into 8 bytes.
- *
- * @param v Value.
- * @return the bytes that compose the given value (least-significant
- * byte first).
- */
- public static byte[] makeByteArray(long v) {
- final byte[] b = new byte[LONG_SIZE];
-
- for (int i = 0; i < LONG_SIZE; i++) {
- final int shift = i * 8;
- b[i] = (byte) ((v >>> shift) & LONG_LOWEST_BYTE_MASK);
- }
-
- return b;
- }
-
- /**
- * Creates a {@code long} from 8 bytes.
- *
- * @param input Input.
- * @return the value that correspond to the given bytes assuming
- * that the is ordered in increasing byte significance (i.e. the
- * first byte in the array is the least-siginficant).
- * @throws DimensionMismatchException if {@code input.length != 8}.
- */
- public static long makeLong(byte[] input) {
- if (input.length != LONG_SIZE) {
- throw new DimensionMismatchException(input.length, LONG_SIZE);
- }
-
- long v = 0;
- for (int i = 0; i < LONG_SIZE; i++) {
- final int shift = i * 8;
- v |= (((long) input[i]) & LONG_LOWEST_BYTE_MASK) << shift;
- }
-
- return v;
- }
-
- /**
- * Splits an array of {@code long} values into a sequence of bytes.
- * This method calls {@link #makeByteArray(long)} for each element of
- * the {@code input}.
- *
- * @param input Input.
- * @return an array of bytes.
- */
- public static byte[] makeByteArray(long[] input) {
- final int size = input.length * LONG_SIZE;
- final byte[] b = new byte[size];
-
- for (int i = 0; i < input.length; i++) {
- final byte[] current = makeByteArray(input[i]);
- System.arraycopy(current, 0, b, i * LONG_SIZE, LONG_SIZE);
- }
-
- return b;
- }
-
- /**
- * Creates an array of {@code long} values from a sequence of bytes.
- * This method calls {@link #makeLong(byte[])} for each subsequence
- * of 8 bytes.
- *
- * @param input Input.
- * @return an array of {@code long}.
- * @throws DimensionMismatchException if {@code input.length} is not
- * a multiple of 8.
- */
- public static long[] makeLongArray(byte[] input) {
- final int size = input.length;
- final int num = size / LONG_SIZE;
- if (num * LONG_SIZE != size) {
- throw new DimensionMismatchException(size, num * LONG_SIZE);
- }
-
- final long[] output = new long[num];
- for (int i = 0; i < num; i++) {
- final int from = i * LONG_SIZE;
- final byte[] current = Arrays.copyOfRange(input, from, from + LONG_SIZE);
- output[i] = makeLong(current);
- }
-
- return output;
- }
-
- /**
- * Splits an {@code int} into 4 bytes.
- *
- * @param v Value.
- * @return the bytes that compose the given value (least-significant
- * byte first).
- */
- public static byte[] makeByteArray(int v) {
- final byte[] b = new byte[INT_SIZE];
-
- for (int i = 0; i < INT_SIZE; i++) {
- final int shift = i * 8;
- b[i] = (byte) ((v >>> shift) & INT_LOWEST_BYTE_MASK);
- }
-
- return b;
- }
-
- /**
- * Creates an {@code int} from 4 bytes.
- *
- * @param input Input.
- * @return the value that correspond to the given bytes assuming
- * that the is ordered in increasing byte significance (i.e. the
- * first byte in the array is the least-siginficant).
- * @throws DimensionMismatchException if {@code input.length != 4}.
- */
- public static int makeInt(byte[] input) {
- if (input.length != INT_SIZE) {
- throw new DimensionMismatchException(input.length, INT_SIZE);
- }
-
- int v = 0;
- for (int i = 0; i < INT_SIZE; i++) {
- final int shift = i * 8;
- v |= (((int) input[i]) & INT_LOWEST_BYTE_MASK) << shift;
- }
-
- return v;
- }
-
- /**
- * Splits an array of {@code int} values into a sequence of bytes.
- * This method calls {@link #makeByteArray(int)} for each element of
- * the {@code input}.
- *
- * @param input Input.
- * @return an array of bytes.
- */
- public static byte[] makeByteArray(int[] input) {
- final int size = input.length * INT_SIZE;
- final byte[] b = new byte[size];
-
- for (int i = 0; i < input.length; i++) {
- final byte[] current = makeByteArray(input[i]);
- System.arraycopy(current, 0, b, i * INT_SIZE, INT_SIZE);
- }
-
- return b;
- }
-
- /**
- * Creates an array of {@code int} values from a sequence of bytes.
- * This method calls {@link #makeInt(byte[])} for each subsequence
- * of 4 bytes.
- *
- * @param input Input. Length must be a multiple of 4.
- * @return an array of {@code int}.
- * @throws DimensionMismatchException if {@code input.length} is not
- * a multiple of 4.
- */
- public static int[] makeIntArray(byte[] input) {
- final int size = input.length;
- final int num = size / INT_SIZE;
- if (num * INT_SIZE != size) {
- throw new DimensionMismatchException(size, num * INT_SIZE);
- }
-
- final int[] output = new int[num];
- for (int i = 0; i < num; i++) {
- final int from = i * INT_SIZE;
- final byte[] current = Arrays.copyOfRange(input, from, from + INT_SIZE);
- output[i] = makeInt(current);
- }
-
- return output;
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/SeedConverter.java b/src/main/java/org/apache/commons/math4/rng/internal/util/SeedConverter.java
deleted file mode 100644
index 532277b15..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/SeedConverter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-/**
- * Seed converter.
- *
- * @param Input seed type.
- * @param Output seed type.
- *
- * @since 4.0
- */
-public interface SeedConverter {
- /**
- * Converts seed from input type to output type.
- *
- * @param seed Original seed value.
- * @return the converted seed value.
- */
- OUT convert(IN seed);
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/SeedConverterComposer.java b/src/main/java/org/apache/commons/math4/rng/internal/util/SeedConverterComposer.java
deleted file mode 100644
index c39c7d893..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/SeedConverterComposer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-/**
- * Composes two {@link SeedConverter converters}.
- *
- * @param Input seed type.
- * @param Transitional seed type.
- * @param Output seed type.
- *
- * @since 4.0
- */
-public class SeedConverterComposer implements SeedConverter {
- /** First conversion. */
- private SeedConverter first;
- /** Second conversion. */
- private SeedConverter second;
-
- /**
- * @param first First conversion.
- * @param second second conversion.
- */
- public SeedConverterComposer(SeedConverter first,
- SeedConverter second) {
- this.first = first;
- this.second = second;
- }
-
- /** {@inheritDoc} */
- @Override
- public OUT convert(IN seed) {
- final TRANS trans = first.convert(seed);
- return second.convert(trans);
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return getClass().getSimpleName() + " (" + second + " o " + first + ")";
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/SeedFactory.java b/src/main/java/org/apache/commons/math4/rng/internal/util/SeedFactory.java
deleted file mode 100644
index dc867f2e2..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/SeedFactory.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-import org.apache.commons.math4.rng.internal.source32.RandomIntSource;
-import org.apache.commons.math4.rng.internal.source32.Well44497b;
-import org.apache.commons.math4.rng.internal.source64.RandomLongSource;
-import org.apache.commons.math4.rng.internal.source64.SplitMix64;
-
-/**
- * Utilities related to seeding.
- *
- *
- * This class provides methods to generate random seeds (single values
- * or arrays of values, of {@code int} or {@code long} types) that can
- * be passed to the {@link org.apache.commons.math4.rng.RandomSource
- * methods that create a generator instance}.
- *
- * Although the seed-generating methods defined in this class will likely
- * return different values for all calls, there is no guarantee that the
- * produced seed will result always in a "good" sequence of numbers (even
- * if the generator initialized with that seed is good).
- *
- * There is no guarantee that sequences will not overlap.
- *
- *
- * @since 4.0
- */
-public class SeedFactory {
- /** Generator with a long period. */
- private static final RandomIntSource SEED_GENERATOR;
-
- static {
- // Another RNG for initializing the "SEED_GENERATOR".
- final long t = System.currentTimeMillis();
- final int h = System.identityHashCode(Runtime.getRuntime());
- final SplitMix64 rng = new SplitMix64(t ^ NumberFactory.makeLong(h, ~h));
-
- final int blockCount = 1391; // Size of the state array of "Well44497b".
- SEED_GENERATOR = new Well44497b(createIntArray(blockCount, rng));
- }
-
- /**
- * Class contains only static methods.
- */
- private SeedFactory() {}
-
- /**
- * Creates a number for use as a seed.
- *
- * @return a random number.
- */
- public static int createInt() {
- return createInt(SEED_GENERATOR, System.identityHashCode(new Object()));
- }
-
- /**
- * Creates a number for use as a seed.
- *
- * @return a random number.
- */
- public static long createLong() {
- return createLong(SEED_GENERATOR, System.identityHashCode(new Object()));
- }
-
- /**
- * Creates an array of numbers for use as a seed.
- *
- * @param n Size of the array to create.
- * @return an array of {@code n} random numbers.
- */
- public static int[] createIntArray(int n) {
- return createIntArray(n, SEED_GENERATOR, new Object());
- }
-
- /**
- * Creates an array of numbers for use as a seed.
- *
- * @param n Size of the array to create.
- * @return an array of {@code n} random numbers.
- */
- public static long[] createLongArray(int n) {
- return createLongArray(n, SEED_GENERATOR, new Object());
- }
-
- /**
- * Creates an array of numbers for use as a seed.
- *
- * @param n Size of the array to create.
- * @param source Source of randomness.
- * @return an array of {@code n} random numbers drawn from the
- * {@code source}.
- */
- static long[] createLongArray(int n,
- RandomIntSource source) {
- return createLongArray(n, source, null);
- }
-
- /**
- * Creates an array of numbers for use as a seed.
- *
- * @param n Size of the array to create.
- * @param source Source of randomness.
- * @return an array of {@code n} random numbers drawn from the
- * {@code source}.
- */
- static int[] createIntArray(int n,
- RandomLongSource source) {
- return createIntArray(n, source, null);
- }
-
- /**
- * Creates an array of numbers for use as a seed.
- *
- * @param n Size of the array to create.
- * @param source Source of randomness.
- * @return an array of {@code n} random numbers drawn from the
- * {@code source}.
- */
- static int[] createIntArray(int n,
- RandomIntSource source) {
- return createIntArray(n, source, null);
- }
-
- /**
- * Creates an array of numbers for use as a seed.
- *
- * @param n Size of the array to create.
- * @param source Source of randomness.
- * @param h Arbitrary object whose {@link System#identityHashCode(Object)
- * hash code} will be combined with the next number drawn from
- * the {@code source}.
- * @return an array of {@code n} random numbers.
- */
- private static long[] createLongArray(int n,
- RandomIntSource source,
- Object h) {
- final long[] array = new long[n];
-
- final int hash = System.identityHashCode(h);
- for (int i = 0; i < n; i++) {
- array[i] = createLong(source, hash);
- }
-
- return array;
- }
-
- /**
- * Creates an array of numbers for use as a seed.
- *
- * @param n Size of the array to create.
- * @param source Source of randomness.
- * @param h Arbitrary object whose {@link System#identityHashCode(Object)
- * hash code} will be combined with the next number drawn from
- * the {@code source}.
- * @return an array of {@code n} random numbers.
- */
- private static int[] createIntArray(int n,
- RandomLongSource source,
- Object h) {
- final int[] array = new int[n];
-
- final int hash = System.identityHashCode(h);
- for (int i = 0; i < n; i += 2) {
- final long v = createLong(source, hash);
-
- array[i] = NumberFactory.extractHi(v);
-
- if (i + 1 < n) {
- array[i + 1] = NumberFactory.extractLo(v);
- }
- }
-
- return array;
- }
-
- /**
- * Creates an array of numbers for use as a seed.
- *
- * @param n Size of the array to create.
- * @param source Source of randomness.
- * @param h Arbitrary object whose {@link System#identityHashCode(Object)
- * hash code} will be combined with the next number drawn from
- * the {@code source}.
- * @return an array of {@code n} random numbers.
- */
- private static int[] createIntArray(int n,
- RandomIntSource source,
- Object h) {
- final int[] array = new int[n];
-
- final int hash = System.identityHashCode(h);
- for (int i = 0; i < n; i++) {
- array[i] = createInt(source, hash);
- }
-
- return array;
- }
-
- /**
- * Creates a random number by performing an "xor" between the
- * next value in the sequence of the {@code source} and the
- * given {@code number}.
- *
- * @param source Source of randomness.
- * @param number Arbitrary number.
- * @return a random number.
- */
- private static long createLong(RandomLongSource source,
- int number) {
- synchronized (source) {
- return source.next() ^ NumberFactory.makeLong(number, number);
- }
- }
-
- /**
- * Creates a random number by performing an "xor" between the
- * the next value in the sequence of the {@code source} and the
- * given {@code number}.
- *
- * @param source Source of randomness.
- * @param number Arbitrary number.
- * @return a random number.
- */
- private static long createLong(RandomIntSource source,
- int number) {
- synchronized (source) {
- return NumberFactory.makeLong(source.next() ^ number,
- source.next() ^ number);
- }
- }
-
- /**
- * Creates a random number by performing an "xor" between the
- * next value in the sequence of the {@code source} and the
- * given {@code number}.
- *
- * @param source Source of randomness.
- * @param number Arbitrary number.
- * @return a random number.
- */
- private static int createInt(RandomIntSource source,
- int number) {
- synchronized (source) {
- return source.next() ^ number;
- }
- }
-}
diff --git a/src/main/java/org/apache/commons/math4/rng/internal/util/package-info.java b/src/main/java/org/apache/commons/math4/rng/internal/util/package-info.java
deleted file mode 100644
index 9ce521321..000000000
--- a/src/main/java/org/apache/commons/math4/rng/internal/util/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Utilities for seed conversion.
- */
-
-package org.apache.commons.math4.rng.internal.util;
diff --git a/src/main/java/org/apache/commons/math4/rng/package-info.java b/src/main/java/org/apache/commons/math4/rng/package-info.java
deleted file mode 100644
index 19c5755d1..000000000
--- a/src/main/java/org/apache/commons/math4/rng/package-info.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Randomness Providers
- *
- *
- * This package contains the public API for generating sequences of
- * pseudo-random numbers that are uniformly distributed in a
- * specified range.
- *
- * All implemented generators can be instantiated through
- * {@link org.apache.commons.math4.rng.RandomSource factory methods}.
- * The low-level classes, that define how the randomness is produced,
- * are implemented in package {@link org.apache.commons.math4.rng.internal}
- * and its sub-packages, but should not be used directly.
- *
- * The generators are not thread-safe: Parallel applications must
- * use different generator instances in different threads.
- *
- *
- *
- * In the case of pseudo-random generators, the source of randomness is
- * usually a set of numbers whose bits representation are scrambled in such
- * a way as to produce a random-looking sequence.
- *
- * The main property of the sequence is that the numbers must be uniformly
- * distributed within their allowed range.
- *
- * Classes in this package do not provide any further processing of the
- * number generation such as to match other types of distribution.
- *
- *
- *
- * Which source of randomness to choose may depend on which properties
- * are more important.
- * Considerations can include speed of generation, memory usage, period
- * size, equidistribution, correlation, etc.
- *
- * For some of the generators, interesting properties (of the reference
- * implementations) are proven in scientific papers.
- * Some generators can also suffer from potential weaknesses.
- *
- *
- *
- * For simple sampling, any of the generators implemented in this library
- * may be sufficient.
- *
- * For Monte-Carlo simulations that require generating high-dimensional
- * vectors), equidistribution and non-correlation are crucial.
- * The Mersenne Twister and Well generators have
- * equidistribution properties proven according to their bits pool size
- * which is directly related to their period (all of them have maximal
- * period, i.e. a generator with size {@code n} pool has a period
- * 2n-1
).
- * They also have equidistribution properties for 32 bits blocks up to
- * {@code s/32} dimension where {@code s} is their pool size.
- *
- * For example, {@code Well19937c} is equidistributed up to dimension 623
- * (i.e. 19937 divided by 32).
- * It means that a Monte-Carlo simulation generating vectors of {@code n}
- * (32-bits integer) variables at each iteration has some guarantee on the
- * properties of its components as long as {@code n < 623}.
- * Note that if the variables are of type {@code double}, the limit is
- * divided by two (since 64 bits are needed to create a {@code double}).
- *
- * Reference to the relevant publications are listed in the specific
- * documentation of each class.
- *
- *
- *
- * Memory usage can vary a lot between providers.
- * The state of {@code MersenneTwister} is composed of 624 integers,
- * using about 2.5 kB.
- * The Well generators use 6 integer arrays, the length of each
- * being equal to the pool size; thus, for example, {@code Well44497b}
- * uses about 33 kB.
- *
- */
-
-package org.apache.commons.math4.rng;
diff --git a/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java b/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java
index 79451dd55..269c8a3fa 100644
--- a/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java
+++ b/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java
@@ -40,8 +40,8 @@ import org.apache.commons.math4.linear.Array2DRowFieldMatrix;
import org.apache.commons.math4.linear.FieldMatrix;
import org.apache.commons.math4.linear.MatrixUtils;
import org.apache.commons.math4.linear.RealMatrix;
-import org.apache.commons.math4.rng.RandomSource;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.math4.util.CombinatoricsUtils;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
diff --git a/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java b/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
index 9b28a8e35..9d468fd19 100644
--- a/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
+++ b/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
@@ -24,8 +24,8 @@ import java.util.List;
import org.apache.commons.math4.exception.MathInternalError;
import org.apache.commons.math4.exception.NotANumberException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.random.RandomUtils;
import org.apache.commons.math4.util.FastMath;
diff --git a/src/main/java/org/apache/commons/math4/util/MathArrays.java b/src/main/java/org/apache/commons/math4/util/MathArrays.java
index e1e44780d..cddf5de79 100644
--- a/src/main/java/org/apache/commons/math4/util/MathArrays.java
+++ b/src/main/java/org/apache/commons/math4/util/MathArrays.java
@@ -39,8 +39,8 @@ import org.apache.commons.math4.exception.NotStrictlyPositiveException;
import org.apache.commons.math4.exception.NullArgumentException;
import org.apache.commons.math4.exception.NumberIsTooLargeException;
import org.apache.commons.math4.exception.util.LocalizedFormats;
-import org.apache.commons.math4.rng.RandomSource;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
/**
* Arrays utilities.
diff --git a/src/main/java/org/apache/commons/math4/util/RandomPivotingStrategy.java b/src/main/java/org/apache/commons/math4/util/RandomPivotingStrategy.java
index dded9f092..8161ccdcd 100644
--- a/src/main/java/org/apache/commons/math4/util/RandomPivotingStrategy.java
+++ b/src/main/java/org/apache/commons/math4/util/RandomPivotingStrategy.java
@@ -21,8 +21,8 @@ import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import org.apache.commons.math4.exception.MathIllegalArgumentException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
/**
* A strategy of selecting random index between begin and end indices.
diff --git a/src/test/java/org/apache/commons/math4/ExtendedFieldElementAbstractTest.java b/src/test/java/org/apache/commons/math4/ExtendedFieldElementAbstractTest.java
index 5f27243e3..240fea4fd 100644
--- a/src/test/java/org/apache/commons/math4/ExtendedFieldElementAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/ExtendedFieldElementAbstractTest.java
@@ -17,8 +17,8 @@
package org.apache.commons.math4;
import org.apache.commons.math4.RealFieldElement;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/PerfTestUtils.java b/src/test/java/org/apache/commons/math4/PerfTestUtils.java
index 622502ecb..e56c81f5f 100644
--- a/src/test/java/org/apache/commons/math4/PerfTestUtils.java
+++ b/src/test/java/org/apache/commons/math4/PerfTestUtils.java
@@ -22,8 +22,8 @@ import java.util.regex.MatchResult;
import java.util.concurrent.Callable;
import org.apache.commons.math4.util.MathArrays;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.exception.MathIllegalStateException;
import org.apache.commons.math4.exception.NumberIsTooLargeException;
import org.apache.commons.math4.exception.util.LocalizedFormats;
diff --git a/src/test/java/org/apache/commons/math4/analysis/differentiation/DerivativeStructureTest.java b/src/test/java/org/apache/commons/math4/analysis/differentiation/DerivativeStructureTest.java
index 1bb771840..7c64d1a14 100644
--- a/src/test/java/org/apache/commons/math4/analysis/differentiation/DerivativeStructureTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/differentiation/DerivativeStructureTest.java
@@ -26,8 +26,8 @@ import org.apache.commons.math4.analysis.differentiation.DerivativeStructure;
import org.apache.commons.math4.analysis.polynomials.PolynomialFunction;
import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.NumberIsTooLargeException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.ArithmeticUtils;
import org.apache.commons.math4.util.CombinatoricsUtils;
import org.apache.commons.math4.util.FastMath;
diff --git a/src/test/java/org/apache/commons/math4/analysis/differentiation/SparseGradientTest.java b/src/test/java/org/apache/commons/math4/analysis/differentiation/SparseGradientTest.java
index 569d540dc..2f2b3475a 100644
--- a/src/test/java/org/apache/commons/math4/analysis/differentiation/SparseGradientTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/differentiation/SparseGradientTest.java
@@ -22,8 +22,8 @@ import java.util.List;
import org.apache.commons.math4.ExtendedFieldElementAbstractTest;
import org.apache.commons.math4.TestUtils;
import org.apache.commons.math4.analysis.polynomials.PolynomialFunction;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/analysis/function/LogitTest.java b/src/test/java/org/apache/commons/math4/analysis/function/LogitTest.java
index ea5c10dce..1bb7fe0a3 100644
--- a/src/test/java/org/apache/commons/math4/analysis/function/LogitTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/function/LogitTest.java
@@ -26,8 +26,8 @@ import org.apache.commons.math4.analysis.function.Sigmoid;
import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.NullArgumentException;
import org.apache.commons.math4.exception.OutOfRangeException;
-import org.apache.commons.math4.rng.RandomSource;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.math4.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/analysis/interpolation/AkimaSplineInterpolatorTest.java b/src/test/java/org/apache/commons/math4/analysis/interpolation/AkimaSplineInterpolatorTest.java
index 9eeb33ace..2fa667eb7 100644
--- a/src/test/java/org/apache/commons/math4/analysis/interpolation/AkimaSplineInterpolatorTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/interpolation/AkimaSplineInterpolatorTest.java
@@ -26,8 +26,8 @@ import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.NonMonotonicSequenceException;
import org.apache.commons.math4.exception.NullArgumentException;
import org.apache.commons.math4.exception.NumberIsTooSmallException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/analysis/interpolation/BicubicInterpolatingFunctionTest.java b/src/test/java/org/apache/commons/math4/analysis/interpolation/BicubicInterpolatingFunctionTest.java
index 105cf70f7..e65a9ddf5 100644
--- a/src/test/java/org/apache/commons/math4/analysis/interpolation/BicubicInterpolatingFunctionTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/interpolation/BicubicInterpolatingFunctionTest.java
@@ -22,8 +22,8 @@ import org.apache.commons.math4.distribution.UniformRealDistribution;
import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.MathIllegalArgumentException;
import org.apache.commons.math4.exception.OutOfRangeException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/analysis/interpolation/BicubicInterpolatorTest.java b/src/test/java/org/apache/commons/math4/analysis/interpolation/BicubicInterpolatorTest.java
index f88ec55a8..bc3b7d247 100644
--- a/src/test/java/org/apache/commons/math4/analysis/interpolation/BicubicInterpolatorTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/interpolation/BicubicInterpolatorTest.java
@@ -21,8 +21,8 @@ import org.apache.commons.math4.distribution.RealDistribution;
import org.apache.commons.math4.distribution.UniformRealDistribution;
import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.MathIllegalArgumentException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/analysis/interpolation/PiecewiseBicubicSplineInterpolatingFunctionTest.java b/src/test/java/org/apache/commons/math4/analysis/interpolation/PiecewiseBicubicSplineInterpolatingFunctionTest.java
index 48ff9a094..c4cfcb28f 100644
--- a/src/test/java/org/apache/commons/math4/analysis/interpolation/PiecewiseBicubicSplineInterpolatingFunctionTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/interpolation/PiecewiseBicubicSplineInterpolatingFunctionTest.java
@@ -23,8 +23,8 @@ import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.InsufficientDataException;
import org.apache.commons.math4.exception.NonMonotonicSequenceException;
import org.apache.commons.math4.exception.NullArgumentException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/analysis/interpolation/PiecewiseBicubicSplineInterpolatorTest.java b/src/test/java/org/apache/commons/math4/analysis/interpolation/PiecewiseBicubicSplineInterpolatorTest.java
index 69bd8b449..e7d6c6e0b 100644
--- a/src/test/java/org/apache/commons/math4/analysis/interpolation/PiecewiseBicubicSplineInterpolatorTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/interpolation/PiecewiseBicubicSplineInterpolatorTest.java
@@ -23,8 +23,8 @@ import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.InsufficientDataException;
import org.apache.commons.math4.exception.NonMonotonicSequenceException;
import org.apache.commons.math4.exception.NullArgumentException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/analysis/interpolation/TricubicInterpolatingFunctionTest.java b/src/test/java/org/apache/commons/math4/analysis/interpolation/TricubicInterpolatingFunctionTest.java
index deac81fac..0277a004e 100644
--- a/src/test/java/org/apache/commons/math4/analysis/interpolation/TricubicInterpolatingFunctionTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/interpolation/TricubicInterpolatingFunctionTest.java
@@ -21,8 +21,8 @@ import org.apache.commons.math4.distribution.RealDistribution;
import org.apache.commons.math4.distribution.UniformRealDistribution;
import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.MathIllegalArgumentException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/distribution/BetaDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/BetaDistributionTest.java
index b7859ba01..2b9b23b12 100644
--- a/src/test/java/org/apache/commons/math4/distribution/BetaDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/BetaDistributionTest.java
@@ -18,8 +18,8 @@ package org.apache.commons.math4.distribution;
import java.util.Arrays;
-import org.apache.commons.math4.rng.RandomSource;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.math4.stat.StatUtils;
import org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest;
import org.apache.commons.math4.stat.inference.InferenceTestUtils;
diff --git a/src/test/java/org/apache/commons/math4/distribution/EmpiricalDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/EmpiricalDistributionTest.java
index 1251ed370..c219f9a20 100644
--- a/src/test/java/org/apache/commons/math4/distribution/EmpiricalDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/EmpiricalDistributionTest.java
@@ -31,7 +31,7 @@ import org.apache.commons.math4.analysis.integration.IterativeLegendreGaussInteg
import org.apache.commons.math4.exception.MathIllegalStateException;
import org.apache.commons.math4.exception.NullArgumentException;
import org.apache.commons.math4.exception.NotStrictlyPositiveException;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.descriptive.SummaryStatistics;
import org.apache.commons.math4.util.FastMath;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistributionTest.java
index d1f3afca7..3e3293492 100644
--- a/src/test/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistributionTest.java
@@ -25,7 +25,7 @@ import org.apache.commons.math4.exception.NotANumberException;
import org.apache.commons.math4.exception.NotFiniteNumberException;
import org.apache.commons.math4.exception.NotPositiveException;
import org.apache.commons.math4.util.FastMath;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
index 7cfebf7b7..44bd3e8f1 100644
--- a/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
@@ -30,8 +30,8 @@ import org.apache.commons.math4.exception.NotFiniteNumberException;
import org.apache.commons.math4.exception.NotPositiveException;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Pair;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/distribution/HypergeometricDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/HypergeometricDistributionTest.java
index 7e7ce8cee..6bfe8d63a 100644
--- a/src/test/java/org/apache/commons/math4/distribution/HypergeometricDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/HypergeometricDistributionTest.java
@@ -24,7 +24,7 @@ import org.apache.commons.math4.exception.NotPositiveException;
import org.apache.commons.math4.exception.NotStrictlyPositiveException;
import org.apache.commons.math4.exception.NumberIsTooLargeException;
import org.apache.commons.math4.util.Precision;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/distribution/IntegerDistributionAbstractTest.java b/src/test/java/org/apache/commons/math4/distribution/IntegerDistributionAbstractTest.java
index dbf8062e3..43e930ee9 100644
--- a/src/test/java/org/apache/commons/math4/distribution/IntegerDistributionAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/IntegerDistributionAbstractTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.math4.TestUtils;
import org.apache.commons.math4.distribution.AbstractIntegerDistribution;
import org.apache.commons.math4.distribution.IntegerDistribution;
import org.apache.commons.math4.exception.MathIllegalArgumentException;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.junit.After;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/distribution/MixtureMultivariateNormalDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/MixtureMultivariateNormalDistributionTest.java
index c4d3a8fda..e6c646f75 100644
--- a/src/test/java/org/apache/commons/math4/distribution/MixtureMultivariateNormalDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/MixtureMultivariateNormalDistributionTest.java
@@ -23,7 +23,7 @@ import org.apache.commons.math4.distribution.MixtureMultivariateRealDistribution
import org.apache.commons.math4.distribution.MultivariateNormalDistribution;
import org.apache.commons.math4.exception.MathArithmeticException;
import org.apache.commons.math4.exception.NotPositiveException;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.Pair;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalDistributionTest.java
index 3e6d9ff6e..70d7e02a3 100644
--- a/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalDistributionTest.java
@@ -20,7 +20,7 @@ package org.apache.commons.math4.distribution;
import org.apache.commons.math4.distribution.MultivariateNormalDistribution;
import org.apache.commons.math4.distribution.NormalDistribution;
import org.apache.commons.math4.linear.RealMatrix;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.correlation.Covariance;
import java.util.Random;
diff --git a/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java b/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
index 7d9db82c0..ca2de4ee1 100644
--- a/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
@@ -32,7 +32,7 @@ import org.apache.commons.math4.analysis.integration.IterativeLegendreGaussInteg
import org.apache.commons.math4.distribution.RealDistribution;
import org.apache.commons.math4.exception.MathIllegalArgumentException;
import org.apache.commons.math4.exception.NumberIsTooLargeException;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.junit.After;
import org.junit.Assert;
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 de23a2685..8752b7551 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.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.junit.Assert;
import org.junit.Ignore;
diff --git a/src/test/java/org/apache/commons/math4/filter/KalmanFilterTest.java b/src/test/java/org/apache/commons/math4/filter/KalmanFilterTest.java
index 131da51cf..8aebc5a5c 100644
--- a/src/test/java/org/apache/commons/math4/filter/KalmanFilterTest.java
+++ b/src/test/java/org/apache/commons/math4/filter/KalmanFilterTest.java
@@ -27,7 +27,7 @@ import org.apache.commons.math4.linear.MatrixDimensionMismatchException;
import org.apache.commons.math4.linear.MatrixUtils;
import org.apache.commons.math4.linear.RealMatrix;
import org.apache.commons.math4.linear.RealVector;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/fitting/PolynomialCurveFitterTest.java b/src/test/java/org/apache/commons/math4/fitting/PolynomialCurveFitterTest.java
index 2b1e2d3f1..d5e7bddd8 100644
--- a/src/test/java/org/apache/commons/math4/fitting/PolynomialCurveFitterTest.java
+++ b/src/test/java/org/apache/commons/math4/fitting/PolynomialCurveFitterTest.java
@@ -26,7 +26,7 @@ import org.apache.commons.math4.exception.ConvergenceException;
import org.apache.commons.math4.fitting.PolynomialCurveFitter;
import org.apache.commons.math4.fitting.WeightedObservedPoints;
import org.apache.commons.math4.util.FastMath;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/fitting/SimpleCurveFitterTest.java b/src/test/java/org/apache/commons/math4/fitting/SimpleCurveFitterTest.java
index 4a3867c51..9b710efae 100644
--- a/src/test/java/org/apache/commons/math4/fitting/SimpleCurveFitterTest.java
+++ b/src/test/java/org/apache/commons/math4/fitting/SimpleCurveFitterTest.java
@@ -25,7 +25,7 @@ import org.apache.commons.math4.distribution.RealDistribution;
import org.apache.commons.math4.distribution.UniformRealDistribution;
import org.apache.commons.math4.fitting.SimpleCurveFitter;
import org.apache.commons.math4.fitting.WeightedObservedPoints;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.junit.Test;
/**
diff --git a/src/test/java/org/apache/commons/math4/fitting/leastsquares/RandomCirclePointGenerator.java b/src/test/java/org/apache/commons/math4/fitting/leastsquares/RandomCirclePointGenerator.java
index 59dd8afe0..07e928601 100644
--- a/src/test/java/org/apache/commons/math4/fitting/leastsquares/RandomCirclePointGenerator.java
+++ b/src/test/java/org/apache/commons/math4/fitting/leastsquares/RandomCirclePointGenerator.java
@@ -20,8 +20,8 @@ import org.apache.commons.math4.distribution.NormalDistribution;
import org.apache.commons.math4.distribution.RealDistribution;
import org.apache.commons.math4.distribution.UniformRealDistribution;
import org.apache.commons.math4.geometry.euclidean.twod.Vector2D;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
diff --git a/src/test/java/org/apache/commons/math4/fitting/leastsquares/RandomStraightLinePointGenerator.java b/src/test/java/org/apache/commons/math4/fitting/leastsquares/RandomStraightLinePointGenerator.java
index beff240a1..52981deca 100644
--- a/src/test/java/org/apache/commons/math4/fitting/leastsquares/RandomStraightLinePointGenerator.java
+++ b/src/test/java/org/apache/commons/math4/fitting/leastsquares/RandomStraightLinePointGenerator.java
@@ -22,8 +22,8 @@ import java.awt.geom.Point2D;
import org.apache.commons.math4.distribution.NormalDistribution;
import org.apache.commons.math4.distribution.RealDistribution;
import org.apache.commons.math4.distribution.UniformRealDistribution;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
/**
* Factory for generating a cloud of points that approximate a straight line.
diff --git a/src/test/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser2DTest.java b/src/test/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser2DTest.java
index 2d39da5d4..54d87ab21 100644
--- a/src/test/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser2DTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser2DTest.java
@@ -25,8 +25,8 @@ import org.apache.commons.math4.geometry.enclosing.WelzlEncloser;
import org.apache.commons.math4.geometry.euclidean.twod.DiskGenerator;
import org.apache.commons.math4.geometry.euclidean.twod.Euclidean2D;
import org.apache.commons.math4.geometry.euclidean.twod.Vector2D;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser3DTest.java b/src/test/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser3DTest.java
index 0860db2b5..2f76e6c11 100644
--- a/src/test/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser3DTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser3DTest.java
@@ -27,8 +27,8 @@ import org.apache.commons.math4.geometry.euclidean.threed.Euclidean3D;
import org.apache.commons.math4.geometry.euclidean.threed.SphereGenerator;
import org.apache.commons.math4.geometry.euclidean.threed.Vector3D;
import org.apache.commons.math4.random.UnitSphereRandomVectorGenerator;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotationDSTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotationDSTest.java
index 2398d0de5..f0cb6b381 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotationDSTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotationDSTest.java
@@ -30,8 +30,8 @@ import org.apache.commons.math4.geometry.euclidean.threed.Vector3D;
import org.apache.commons.math4.linear.MatrixUtils;
import org.apache.commons.math4.linear.RealMatrix;
import org.apache.commons.math4.random.UnitSphereRandomVectorGenerator;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotationDfpTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotationDfpTest.java
index 6dde9f377..7c52892b2 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotationDfpTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotationDfpTest.java
@@ -29,8 +29,8 @@ import org.apache.commons.math4.geometry.euclidean.threed.Rotation;
import org.apache.commons.math4.geometry.euclidean.threed.RotationOrder;
import org.apache.commons.math4.geometry.euclidean.threed.Vector3D;
import org.apache.commons.math4.random.UnitSphereRandomVectorGenerator;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
index 2cf235fa3..29564e642 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
@@ -27,8 +27,8 @@ import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.MathArithmeticException;
import org.apache.commons.math4.geometry.euclidean.threed.FieldVector3D;
import org.apache.commons.math4.geometry.euclidean.threed.Vector3D;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
index c0aaa1301..e8498d8c9 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
@@ -50,8 +50,8 @@ import org.apache.commons.math4.geometry.partitioning.RegionDumper;
import org.apache.commons.math4.geometry.partitioning.RegionFactory;
import org.apache.commons.math4.geometry.partitioning.RegionParser;
import org.apache.commons.math4.geometry.partitioning.SubHyperplane;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
index 8fd36dc47..3d817580f 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
@@ -25,8 +25,8 @@ import org.apache.commons.math4.geometry.euclidean.threed.Euclidean3D;
import org.apache.commons.math4.geometry.euclidean.threed.SphereGenerator;
import org.apache.commons.math4.geometry.euclidean.threed.Vector3D;
import org.apache.commons.math4.random.UnitSphereRandomVectorGenerator;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java
index f9bf79b9f..d54977c56 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.math4.exception.MathArithmeticException;
import org.apache.commons.math4.geometry.Space;
import org.apache.commons.math4.geometry.euclidean.threed.Rotation;
import org.apache.commons.math4.geometry.euclidean.threed.Vector3D;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
index 1500fc55b..18c40eb7f 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
@@ -25,8 +25,8 @@ import org.apache.commons.math4.geometry.euclidean.twod.DiskGenerator;
import org.apache.commons.math4.geometry.euclidean.twod.Euclidean2D;
import org.apache.commons.math4.geometry.euclidean.twod.Vector2D;
import org.apache.commons.math4.random.UnitSphereRandomVectorGenerator;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
index ea32b9cca..7de619a3a 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
@@ -29,8 +29,8 @@ import org.apache.commons.math4.geometry.euclidean.twod.hull.ConvexHull2D;
import org.apache.commons.math4.geometry.euclidean.twod.hull.ConvexHullGenerator2D;
import org.apache.commons.math4.geometry.partitioning.Region;
import org.apache.commons.math4.geometry.partitioning.Region.Location;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.Precision;
diff --git a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java
index c3b14add9..721fc4924 100644
--- a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java
@@ -29,8 +29,8 @@ import org.apache.commons.math4.geometry.spherical.twod.Circle;
import org.apache.commons.math4.geometry.spherical.twod.S2Point;
import org.apache.commons.math4.geometry.spherical.twod.Sphere2D;
import org.apache.commons.math4.random.UnitSphereRandomVectorGenerator;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SphericalPolygonsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SphericalPolygonsSetTest.java
index b8480ec09..4af52d7d4 100644
--- a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SphericalPolygonsSetTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SphericalPolygonsSetTest.java
@@ -35,7 +35,7 @@ import org.apache.commons.math4.geometry.spherical.twod.SphericalPolygonsSet;
import org.apache.commons.math4.geometry.spherical.twod.SubCircle;
import org.apache.commons.math4.geometry.spherical.twod.Vertex;
import org.apache.commons.math4.random.UnitSphereRandomVectorGenerator;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java b/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java
index 683954f65..9d5e33621 100644
--- a/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java
@@ -33,7 +33,7 @@ import org.apache.commons.math4.linear.TriDiagonalTransformer;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.Precision;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
diff --git a/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java b/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java
index af6e83731..441b120dd 100644
--- a/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java
@@ -25,7 +25,7 @@ import org.apache.commons.math4.linear.HessenbergTransformer;
import org.apache.commons.math4.linear.MatrixUtils;
import org.apache.commons.math4.linear.NonSquareMatrixException;
import org.apache.commons.math4.linear.RealMatrix;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.junit.Test;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java b/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java
index f2cf72ee0..b96ee4a1e 100644
--- a/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java
@@ -25,7 +25,7 @@ import org.apache.commons.math4.linear.MatrixUtils;
import org.apache.commons.math4.linear.NonSquareMatrixException;
import org.apache.commons.math4.linear.RealMatrix;
import org.apache.commons.math4.linear.SchurTransformer;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.junit.Test;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/ml/clustering/FuzzyKMeansClustererTest.java b/src/test/java/org/apache/commons/math4/ml/clustering/FuzzyKMeansClustererTest.java
index 4950c806b..5ec30a0d5 100644
--- a/src/test/java/org/apache/commons/math4/ml/clustering/FuzzyKMeansClustererTest.java
+++ b/src/test/java/org/apache/commons/math4/ml/clustering/FuzzyKMeansClustererTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.math4.ml.clustering.DoublePoint;
import org.apache.commons.math4.ml.clustering.FuzzyKMeansClusterer;
import org.apache.commons.math4.ml.distance.CanberraDistance;
import org.apache.commons.math4.ml.distance.DistanceMeasure;
-import org.apache.commons.math4.rng.RandomSource;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java b/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java
index 0e07a1f9a..0d70ea40a 100644
--- a/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java
+++ b/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.math4.ml.clustering.Cluster;
import org.apache.commons.math4.ml.clustering.DoublePoint;
import org.apache.commons.math4.ml.clustering.KMeansPlusPlusClusterer;
import org.apache.commons.math4.ml.distance.EuclideanDistance;
-import org.apache.commons.math4.rng.RandomSource;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java b/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java
index ebd4200da..a946c693a 100644
--- a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java
+++ b/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java
@@ -44,8 +44,8 @@ import org.apache.commons.math4.ml.neuralnet.sofm.LearningFactorFunction;
import org.apache.commons.math4.ml.neuralnet.sofm.LearningFactorFunctionFactory;
import org.apache.commons.math4.ml.neuralnet.sofm.NeighbourhoodSizeFunction;
import org.apache.commons.math4.ml.neuralnet.sofm.NeighbourhoodSizeFunctionFactory;
-import org.apache.commons.math4.rng.RandomSource;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.math4.util.FastMath;
/**
diff --git a/src/test/java/org/apache/commons/math4/ode/events/EventFilterTest.java b/src/test/java/org/apache/commons/math4/ode/events/EventFilterTest.java
index 41585bd73..7fb853df3 100644
--- a/src/test/java/org/apache/commons/math4/ode/events/EventFilterTest.java
+++ b/src/test/java/org/apache/commons/math4/ode/events/EventFilterTest.java
@@ -27,8 +27,8 @@ import org.apache.commons.math4.ode.events.EventFilter;
import org.apache.commons.math4.ode.events.EventHandler;
import org.apache.commons.math4.ode.events.FilterType;
import org.apache.commons.math4.ode.nonstiff.DormandPrince853Integrator;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/MultiStartMultivariateOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/MultiStartMultivariateOptimizerTest.java
index d5b2b845e..1d6ea55c1 100644
--- a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/MultiStartMultivariateOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/MultiStartMultivariateOptimizerTest.java
@@ -30,8 +30,8 @@ import org.apache.commons.math4.optim.nonlinear.scalar.gradient.CircleScalar;
import org.apache.commons.math4.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizer;
import org.apache.commons.math4.optim.nonlinear.scalar.noderiv.NelderMeadSimplex;
import org.apache.commons.math4.optim.nonlinear.scalar.noderiv.SimplexOptimizer;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.random.GaussianRandomGenerator;
import org.apache.commons.math4.random.RandomVectorGenerator;
import org.apache.commons.math4.random.UncorrelatedRandomVectorGenerator;
diff --git a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java
index 50cf6dc62..7d9390ac5 100644
--- a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java
@@ -34,7 +34,7 @@ import org.apache.commons.math4.optim.SimpleBounds;
import org.apache.commons.math4.optim.nonlinear.scalar.GoalType;
import org.apache.commons.math4.optim.nonlinear.scalar.ObjectiveFunction;
import org.apache.commons.math4.optim.nonlinear.scalar.noderiv.CMAESOptimizer;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java
index a452ac808..9232063f0 100644
--- a/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.math4.optim.univariate.SearchInterval;
import org.apache.commons.math4.optim.univariate.UnivariateObjectiveFunction;
import org.apache.commons.math4.optim.univariate.UnivariateOptimizer;
import org.apache.commons.math4.optim.univariate.UnivariatePointValuePair;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java
index 18b654351..902ed783c 100644
--- a/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java
@@ -26,8 +26,8 @@ import org.apache.commons.math4.linear.RealMatrix;
import org.apache.commons.math4.random.CorrelatedRandomVectorGenerator;
import org.apache.commons.math4.random.GaussianRandomGenerator;
import org.apache.commons.math4.random.NormalizedRandomGenerator;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.correlation.StorelessCovariance;
import org.apache.commons.math4.stat.descriptive.moment.VectorialCovariance;
import org.apache.commons.math4.stat.descriptive.moment.VectorialMean;
diff --git a/src/test/java/org/apache/commons/math4/random/GaussianRandomGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/GaussianRandomGeneratorTest.java
index 031f55d59..ba720935a 100644
--- a/src/test/java/org/apache/commons/math4/random/GaussianRandomGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/GaussianRandomGeneratorTest.java
@@ -18,8 +18,8 @@
package org.apache.commons.math4.random;
import org.apache.commons.math4.random.GaussianRandomGenerator;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.StatUtils;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/random/JDKRandomAdaptorTest.java b/src/test/java/org/apache/commons/math4/random/JDKRandomAdaptorTest.java
index 7360a887d..31e947e41 100644
--- a/src/test/java/org/apache/commons/math4/random/JDKRandomAdaptorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/JDKRandomAdaptorTest.java
@@ -18,8 +18,8 @@ package org.apache.commons.math4.random;
import java.util.Random;
import org.apache.commons.math4.exception.MathUnsupportedOperationException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.distribution.RealDistribution;
import org.apache.commons.math4.distribution.NormalDistribution;
import org.apache.commons.math4.TestUtils;
diff --git a/src/test/java/org/apache/commons/math4/random/RandomUtilsDataGeneratorAbstractTest.java b/src/test/java/org/apache/commons/math4/random/RandomUtilsDataGeneratorAbstractTest.java
index f64d0fabe..5a6d29ff1 100644
--- a/src/test/java/org/apache/commons/math4/random/RandomUtilsDataGeneratorAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/random/RandomUtilsDataGeneratorAbstractTest.java
@@ -28,7 +28,7 @@ import org.apache.commons.math4.exception.MathIllegalArgumentException;
import org.apache.commons.math4.stat.Frequency;
import org.apache.commons.math4.stat.inference.ChiSquareTest;
import org.apache.commons.math4.util.FastMath;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.UniformRandomProvider;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java
index 5ad14f07a..f9d8f2832 100644
--- a/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java
@@ -17,8 +17,8 @@
package org.apache.commons.math4.random;
import org.apache.commons.math4.exception.OutOfRangeException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.StatUtils;
import org.apache.commons.math4.stat.descriptive.DescriptiveStatistics;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/random/SynchronizedRandomGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/SynchronizedRandomGeneratorTest.java
index df91d3449..919a81ac8 100644
--- a/src/test/java/org/apache/commons/math4/random/SynchronizedRandomGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/SynchronizedRandomGeneratorTest.java
@@ -24,7 +24,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/random/UncorrelatedRandomVectorGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/UncorrelatedRandomVectorGeneratorTest.java
index 2c2df9d26..e00955dbc 100644
--- a/src/test/java/org/apache/commons/math4/random/UncorrelatedRandomVectorGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/UncorrelatedRandomVectorGeneratorTest.java
@@ -18,7 +18,7 @@
package org.apache.commons.math4.random;
import org.apache.commons.math4.linear.RealMatrix;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.random.GaussianRandomGenerator;
import org.apache.commons.math4.random.UncorrelatedRandomVectorGenerator;
import org.apache.commons.math4.stat.descriptive.moment.VectorialCovariance;
diff --git a/src/test/java/org/apache/commons/math4/random/UniformRandomGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/UniformRandomGeneratorTest.java
index 94534cd9f..edf513793 100644
--- a/src/test/java/org/apache/commons/math4/random/UniformRandomGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/UniformRandomGeneratorTest.java
@@ -17,8 +17,8 @@
package org.apache.commons.math4.random;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.StatUtils;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java
index e5ab5bb07..ba005cbee 100644
--- a/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java
@@ -16,8 +16,8 @@
*/
package org.apache.commons.math4.random;
-import org.apache.commons.math4.rng.RandomSource;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.math4.random.UnitSphereRandomVectorGenerator;
import org.apache.commons.math4.util.FastMath;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/rng/Providers32ParametricTest.java b/src/test/java/org/apache/commons/math4/rng/Providers32ParametricTest.java
deleted file mode 100644
index 0dc28b132..000000000
--- a/src/test/java/org/apache/commons/math4/rng/Providers32ParametricTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng;
-
-import java.util.Arrays;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-/**
- * Tests which all 32-bits based generators must pass.
- */
-@RunWith(value=Parameterized.class)
-public class Providers32ParametricTest {
- /** RNG under test. */
- private final UniformRandomProvider generator;
-
- /**
- * Initializes generator instance.
- *
- * @param rng RNG to be tested.
- */
- public Providers32ParametricTest(ProvidersList.Data data) {
- final RandomSource source = data.getSource();
- final Object seed = data.getSeed();
- final Object[] args = data.getArgs();
- generator = RandomSource.create(source, seed, args);
- }
-
- @Parameters(name = "{index}: data={0}")
- public static Iterable getList() {
- return ProvidersList.list32();
- }
-
-
- @Test
- public void testNextBytesChunks() {
- final int[] chunkSizes = { 4, 8, 12, 16 };
- final int[] chunks = { 1, 2, 3, 4, 5 };
- for (int chunkSize : chunkSizes) {
- for (int numChunks : chunks) {
- ProvidersCommonParametricTest.checkNextBytesChunks(generator,
- chunkSize,
- numChunks);
- }
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/Providers64ParametricTest.java b/src/test/java/org/apache/commons/math4/rng/Providers64ParametricTest.java
deleted file mode 100644
index dcacf58af..000000000
--- a/src/test/java/org/apache/commons/math4/rng/Providers64ParametricTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng;
-
-import java.util.Arrays;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-/**
- * Tests which all 64-bits based generators must pass.
- */
-@RunWith(value=Parameterized.class)
-public class Providers64ParametricTest {
- /** RNG under test. */
- private final UniformRandomProvider generator;
-
- /**
- * Initializes generator instance.
- *
- * @param rng RNG to be tested.
- */
- public Providers64ParametricTest(ProvidersList.Data data) {
- final RandomSource source = data.getSource();
- final Object seed = data.getSeed();
- final Object[] args = data.getArgs();
- generator = RandomSource.create(source, seed, args);
- }
-
- @Parameters(name = "{index}: data={0}")
- public static Iterable getList() {
- return ProvidersList.list64();
- }
-
-
- @Test
- public void testNextBytesChunks() {
- final int[] chunkSizes = { 8, 16, 24 };
- final int[] chunks = { 1, 2, 3, 4, 5 };
- for (int chunkSize : chunkSizes) {
- for (int numChunks : chunks) {
- ProvidersCommonParametricTest.checkNextBytesChunks(generator,
- chunkSize,
- numChunks);
- }
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/ProvidersCommonParametricTest.java b/src/test/java/org/apache/commons/math4/rng/ProvidersCommonParametricTest.java
deleted file mode 100644
index 2e1e8f21b..000000000
--- a/src/test/java/org/apache/commons/math4/rng/ProvidersCommonParametricTest.java
+++ /dev/null
@@ -1,667 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.concurrent.Callable;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ByteArrayInputStream;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.Assume;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-import org.apache.commons.math4.exception.MathUnsupportedOperationException;
-import org.apache.commons.math4.exception.MathIllegalArgumentException;
-import org.apache.commons.math4.exception.InsufficientDataException;
-import org.apache.commons.math4.exception.OutOfRangeException;
-import org.apache.commons.math4.distribution.RealDistribution;
-import org.apache.commons.math4.distribution.UniformRealDistribution;
-import org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest;
-import org.apache.commons.math4.stat.inference.ChiSquareTest;
-import org.apache.commons.math4.util.FastMath;
-import org.apache.commons.math4.rng.internal.util.NumberFactory;
-
-/**
- * Test for tests which all generators must pass.
- */
-@RunWith(value=Parameterized.class)
-public class ProvidersCommonParametricTest {
- /** RNG under test. */
- private final UniformRandomProvider generator;
- /** RNG specifier. */
- private final RandomSource originalSource;
- /** Seed (constructor's first parameter). */
- private final Object originalSeed;
- /** Constructor's additional parameters. */
- private final Object[] originalArgs;
-
- /**
- * Initializes generator instance.
- *
- * @param rng RNG to be tested.
- */
- public ProvidersCommonParametricTest(ProvidersList.Data data) {
- originalSource = data.getSource();
- originalSeed = data.getSeed();
- originalArgs = data.getArgs();
- generator = RandomSource.create(originalSource, originalSeed, originalArgs);
- }
-
- @Parameters(name = "{index}: data={0}")
- public static Iterable getList() {
- return ProvidersList.list();
- }
-
-
- // Precondition tests
-
- @Test(expected=MathIllegalArgumentException.class)
- public void testPreconditionNextInt1() {
- generator.nextInt(-1);
- }
-
- @Test(expected=MathIllegalArgumentException.class)
- public void testPreconditionNextInt2() {
- generator.nextInt(0);
- }
-
- @Test(expected=MathIllegalArgumentException.class)
- public void testPreconditionNextLong1() {
- generator.nextLong(-1);
- }
-
- @Test(expected=MathIllegalArgumentException.class)
- public void testPreconditionNextLong2() {
- generator.nextLong(0);
- }
-
- @Test(expected=OutOfRangeException.class)
- public void testPreconditionNextBytes1() {
- final int size = 10;
- final int num = 1;
- final byte[] buf = new byte[size];
- generator.nextBytes(buf, -1, num);
- }
- @Test(expected=OutOfRangeException.class)
- public void testPreconditionNextBytes2() {
- final int size = 10;
- final byte[] buf = new byte[size];
- generator.nextBytes(buf, size, 0);
- }
- @Test(expected=OutOfRangeException.class)
- public void testPreconditionNextBytes3() {
- final int size = 10;
- final int offset = 2;
- final byte[] buf = new byte[size];
- generator.nextBytes(buf, offset, size - offset + 1);
- }
- @Test(expected=OutOfRangeException.class)
- public void testPreconditionNextBytes4() {
- final int size = 10;
- final int offset = 1;
- final byte[] buf = new byte[size];
- generator.nextBytes(buf, offset, -1);
- }
-
-
- // Uniformity tests
-
- @Test
- public void testUniformNextBytesFullBuffer() {
- // Value chosen to exercise all the code lines in the
- // "nextBytes" methods.
- final int size = 23;
- final byte[] buffer = new byte[size];
-
- final Runnable nextMethod = new Runnable() {
- @Override
- public void run() {
- generator.nextBytes(buffer);
- }
- };
-
- final double smallAlpha = 1e-3;
- Assert.assertTrue(isUniformNextBytes(buffer, 0, size, nextMethod, smallAlpha));
- }
-
- @Test
- public void testUniformNextBytesPartialBuffer() {
- final int totalSize = 1234;
- final int offset = 567;
- final int size = 89;
-
- final byte[] buffer = new byte[totalSize];
-
- final Runnable nextMethod = new Runnable() {
- @Override
- public void run() {
- generator.nextBytes(buffer, offset, size);
- }
- };
-
- // Test should pass for the part of the buffer where values are put.
- final double smallAlpha = 1e-3;
- Assert.assertTrue("Test can fail randomly due to sampling error with probability " + smallAlpha,
- isUniformNextBytes(buffer, offset, offset + size, nextMethod, smallAlpha));
-
- // Test must fail for the parts of the buffer where no values are put.
- final double largeAlpha = 0.5;
- Assert.assertFalse(isUniformNextBytes(buffer, 0, offset, nextMethod, largeAlpha));
- Assert.assertFalse(isUniformNextBytes(buffer, offset + size, buffer.length, nextMethod, largeAlpha));
- }
-
- @Test
- public void testUniformNextIntegerInRange() {
- checkNextIntegerInRange(4, 1000);
- checkNextIntegerInRange(10, 1000);
- checkNextIntegerInRange(12, 1000);
- checkNextIntegerInRange(31, 1000);
- checkNextIntegerInRange(32, 1000);
- checkNextIntegerInRange(2016128993, 1000);
- checkNextIntegerInRange(1834691456, 1000);
- checkNextIntegerInRange(869657561, 1000);
- checkNextIntegerInRange(1570504788, 1000);
- }
-
- @Test
- public void testUniformNextLongInRange() {
- checkNextLongInRange(4, 1000);
- checkNextLongInRange(11, 1000);
- checkNextLongInRange(19, 1000);
- checkNextLongInRange(31, 1000);
- checkNextLongInRange(32, 1000);
-
- final long q = Long.MAX_VALUE / 4;
- checkNextLongInRange(q, 1000);
- checkNextLongInRange(2 * q, 1000);
- checkNextLongInRange(3 * q, 1000);
- }
-
- @Test
- public void testUniformNextFloat() {
- final double[] sample = new double[1000];
- for (int i = 0; i < sample.length; i++) {
- sample[i] = generator.nextFloat();
- }
- final RealDistribution uniformDistribution = new UniformRealDistribution(0, 1);
- final KolmogorovSmirnovTest ks = new KolmogorovSmirnovTest();
- Assert.assertFalse(generator.toString(),
- ks.kolmogorovSmirnovTest(uniformDistribution, sample, 0.01));
- }
-
- @Test
- public void testUniformNextDouble() {
- final double[] sample = new double[1000];
- for (int i = 0; i < sample.length; i++) {
- sample[i] = generator.nextDouble();
- }
- final RealDistribution uniformDistribution = new UniformRealDistribution(0, 1);
- final KolmogorovSmirnovTest ks = new KolmogorovSmirnovTest();
- Assert.assertFalse(generator.toString(),
- ks.kolmogorovSmirnovTest(uniformDistribution, sample, 0.01));
- }
-
- @Test
- public void testUniformNextIntRandomWalk() {
- final Callable nextMethod = new Callable() {
- @Override
- public Boolean call() throws Exception {
- return generator.nextInt() >= 0;
- }
- };
-
- checkRandomWalk(1000, nextMethod);
- }
-
- @Test
- public void testUniformNextLongRandomWalk() {
- final Callable nextMethod = new Callable() {
- @Override
- public Boolean call() throws Exception {
- return generator.nextLong() >= 0;
- }
- };
-
- checkRandomWalk(1000, nextMethod);
- }
-
- @Test
- public void testUniformNextBooleanRandomWalk() {
- final Callable nextMethod = new Callable() {
- @Override
- public Boolean call() throws Exception {
- return generator.nextBoolean();
- }
- };
-
- checkRandomWalk(1000, nextMethod);
- }
-
- // Seeding tests.
-
- @Test(expected=MathUnsupportedOperationException.class)
- public void testUnsupportedSeedType() {
- final byte seed = 123;
- RandomSource.create(originalSource, seed, originalArgs);
- }
-
- @Test
- public void testAllSeedTypes() {
- final Integer intSeed = -12131415;
- final Long longSeed = -1213141516171819L;
- final int[] intArraySeed = new int[] { 0, 11, -22, 33, -44, 55, -66, 77, -88, 99 };
- final long[] longArraySeed = new long[] { 11111L, -222222L, 3333333L, -44444444L };
-
- final Object[] seeds = new Object[] { intSeed, longSeed, intArraySeed, longArraySeed };
-
- int nonNativeSeedCount = 0;
- int seedCount = 0;
- for (Object s : seeds) {
- ++seedCount;
- if (!(originalSource.isNativeSeed(s))) {
- ++nonNativeSeedCount;
- }
-
- Assert.assertNotEquals(intSeed, originalSeed);
- RandomSource.create(originalSource, s, originalArgs);
- }
-
- Assert.assertEquals(4, seedCount);
- Assert.assertEquals(3, nonNativeSeedCount);
- }
-
- // State save and restore tests.
-
- @Test
- public void testStateSettable() {
- // Should be fairly large in order to ensure that all the internal
- // state is away from its initial settings.
- final int n = 10000;
-
- // Save.
- final RandomSource.State state = RandomSource.saveState(generator);
- // Store some values.
- final List listOrig = makeList(n);
- // Discard a few more.
- final List listDiscard = makeList(n);
- Assert.assertTrue(listDiscard.size() != 0);
- Assert.assertFalse(listOrig.equals(listDiscard));
- // Reset.
- RandomSource.restoreState(generator, state);
- // Replay.
- final List listReplay = makeList(n);
- Assert.assertFalse(listOrig == listReplay);
- // Check that the restored state is the same as the orginal.
- Assert.assertTrue(listOrig.equals(listReplay));
- }
-
- @Test
- public void testSerializedState()
- throws IOException,
- ClassNotFoundException {
- // Large "n" is not necessary here as we only test the serialization.
- final int n = 100;
-
- // Save and serialize.
- final RandomSource.State stateOrig = RandomSource.saveState(generator);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(bos);
- oos.writeObject(stateOrig);
-
- // Store some values.
- final List listOrig = makeList(n);
-
- // Discard a few more.
- final List listDiscard = makeList(n);
- Assert.assertTrue(listDiscard.size() != 0);
- Assert.assertFalse(listOrig.equals(listDiscard));
-
- // Retrieve from serialized stream.
- ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
- ObjectInputStream ois = new ObjectInputStream(bis);
- final RandomSource.State stateNew = (RandomSource.State) ois.readObject();
-
- Assert.assertTrue(stateOrig != stateNew);
-
- // Reset.
- RandomSource.restoreState(generator, stateNew);
-
- // Replay.
- final List listReplay = makeList(n);
- Assert.assertFalse(listOrig == listReplay);
-
- // Check that the serialized data recreated the orginal state.
- Assert.assertTrue(listOrig.equals(listReplay));
- }
-
- @Test(expected=ClassCastException.class)
- public void testStateWrongClass() {
- // Try to restore with an invalid state.
- RandomSource.restoreState(generator, new RandomSource.State() {});
- }
-
- @Test(expected=InsufficientDataException.class)
- public void testStateWrongSize() {
- // We don't know what is the state of "java.lang.Random": skipping.
- Assume.assumeTrue(generator.toString().indexOf("JDKRandom") == -1);
-
- final RandomSource.State state = RandomSource.saveState(new DummyGenerator());
- // Try to restore with an invalid state (wrong size).
- RandomSource.restoreState(generator, state);
- }
-
- ///// Support methods below.
-
- /**
- * Populates a list with random numbers.
- *
- * @param n Loop counter.
- * @return a list containing {@code 11 * n} random numbers.
- */
- private List makeList(int n) {
- final List list = new ArrayList();
-
- for (int i = 0; i < n; i++) {
- // Append 11 values.
- list.add(generator.nextInt());
- list.add(generator.nextInt(21));
- list.add(generator.nextInt(436));
- list.add(generator.nextLong());
- list.add(generator.nextLong(157894));
- list.add(generator.nextLong(5745833));
- list.add(generator.nextFloat());
- list.add(generator.nextFloat());
- list.add(generator.nextDouble());
- list.add(generator.nextDouble());
- list.add(generator.nextDouble());
- }
-
- return list;
- }
-
- /**
- * Checks that the generator values can be placed into 256 bins with
- * approximately equal number of counts.
- * Test allows to select only part of the buffer for performong the
- * statistics.
- *
- * @param buffer Buffer to be filled.
- * @param first First element (included) of {@code buffer} range for
- * which statistics must be taken into account.
- * @param last Last element (excluded) of {@code buffer} range for
- * which statistics must be taken into account.
- * for which statistics must be taken into account.
- * @param nextMethod Method that fills the given {@code buffer}.
- * @param alpha Probability for chi-square test.
- * @return {@code true} if the distribution is uniform.
- */
- private boolean isUniformNextBytes(byte[] buffer,
- int first,
- int last,
- Runnable nextMethod,
- double alpha) {
- final int sampleSize = 100000;
-
- // Number of possible values.
- final int byteRange = 256;
- // To transform a byte value into its bin index.
- final int byteRangeOffset = 128;
-
- // Bins.
- final long[] count = new long[byteRange];
- final double[] expected = new double[byteRange];
-
- for (int i = 0; i < byteRange; i++) {
- expected[i] = sampleSize / (double) byteRange;
- }
-
- try {
- for (int k = 0; k < sampleSize; k++) {
- nextMethod.run();
-
- for (int i = first; i < last; i++) {
- final byte b = buffer[i];
- ++count[b + byteRangeOffset];
- }
- }
- } catch (Exception e) {
- // Should never happen.
- throw new RuntimeException("Unexpected");
- }
-
- final boolean reject = new ChiSquareTest().chiSquareTest(expected, count, alpha);
- return !reject;
- }
-
- /**
- * Checks that the generator values can be placed into 2 bins with
- * approximately equal number of counts.
- * The test uses the expectation from a fixed-step "random walk".
- *
- * @param nextMethod Method that returns {@code true} if the generated
- * values are to be placed in the first bin, {@code false} if it must
- * go to the second bin.
- */
- private void checkRandomWalk(int sampleSize,
- Callable nextMethod) {
- int walk = 0;
-
- try {
- for (int k = 0; k < sampleSize; ++k) {
- if (nextMethod.call()) {
- ++walk;
- } else {
- --walk;
- }
- }
- } catch (Exception e) {
- // Should never happen.
- throw new RuntimeException("Unexpected");
- }
-
- final double actual = FastMath.abs(walk);
- final double max = FastMath.sqrt(sampleSize) * 2.576;
- Assert.assertTrue(generator + ": Walked too far astray: " + actual +
- " > " + max +
- " (test will fail randomly about 1 in 100 times)",
- actual < max);
- }
-
- /**
- * Tests uniformity of the distribution produced by the {@code nextInt(int)}.
- *
- * @param max Upper bound.
- * @param sampleSize Number of random values generated.
- */
- private void checkNextIntegerInRange(final int max,
- int sampleSize) {
- final Callable nextMethod = new Callable() {
- @Override
- public Integer call() throws Exception {
- return generator.nextInt(max);
- }
- };
-
- checkNextInRange(max, sampleSize, nextMethod);
- }
-
- /**
- * Tests uniformity of the distribution produced by the {@code nextLong(long)}.
- *
- * @param max Upper bound.
- * @param sampleSize Number of random values generated.
- */
- private void checkNextLongInRange(final long max,
- int sampleSize) {
- final Callable nextMethod = new Callable() {
- @Override
- public Long call() throws Exception {
- return generator.nextLong(max);
- }
- };
-
- checkNextInRange(max, sampleSize, nextMethod);
- }
-
- /**
- * Tests uniformity of the distribution produced by the given
- * {@code nextMethod}.
- * It performs a chi-square test of homogeneity of the observed
- * distribution with the expected uniform distribution.
- * Tests are performed at the 1% level and an average failure rate
- * higher than 2% (i.e. more than 20 null hypothesis rejections)
- * causes the test case to fail.
- *
- * @param max Upper bound.
- * @param nextMethod method to call (either "nextInt(max)"
- * @param sampleSize Number of random values generated.
- */
- private void checkNextInRange(T max,
- int sampleSize,
- Callable nextMethod) {
- final ChiSquareTest testStatistic = new ChiSquareTest();
- final int numTests = 1000;
- final long n = max.longValue();
-
- // Set up bins.
- long[] binUpperBounds;
- if (n < 32) {
- binUpperBounds = new long[(int) n];
- for (int k = 0; k < n; k++) {
- binUpperBounds[k] = k + 1;
- }
- } else {
- final int numBins = 10;
- binUpperBounds = new long[numBins];
- final long step = n / numBins;
- for (int k = 0; k < numBins; k++) {
- binUpperBounds[k] = (k + 1) * step;
- }
- }
-
- // Run the tests.
- int numFailures = 0;
-
- final int binCount = binUpperBounds.length;
- final long[] observed = new long[binCount];
- final double[] expected = new double[binCount];
-
- long previousUpperBound = 0;
- for (int k = 0; k < binCount; k++) {
- final long range = binUpperBounds[k] - previousUpperBound;
- expected[k] = sampleSize * (range / (double) n);
- previousUpperBound = binUpperBounds[k];
- }
-
- try {
- for (int i = 0; i < numTests; i++) {
- Arrays.fill(observed, 0);
- for (int j = 0; j < sampleSize; j++) {
- final long value = nextMethod.call().longValue();
- Assert.assertTrue("Range", (value >= 0) && (value < n));
-
- for (int k = 0; k < binCount; k++) {
- if (value < binUpperBounds[k]) {
- ++observed[k];
- break;
- }
- }
- }
- }
- } catch (Exception e) {
- // Should never happen.
- throw new RuntimeException("Unexpected");
- }
-
- if (testStatistic.chiSquareTest(expected, observed) < 0.01) {
- ++numFailures;
- }
-
- if ((double) numFailures / (double) numTests > 0.02) {
- Assert.fail(generator + ": Too many failures for n = " + n +
- " (" + numFailures + " out of " + numTests + " tests failed)");
- }
- }
-
- /**
- * @param rng Generator.
- * @param chunkSize Size of the small buffer.
- * @param numChunks Number of chunks that make the large buffer.
- */
- static void checkNextBytesChunks(UniformRandomProvider rng,
- int chunkSize,
- int numChunks) {
- final byte[] b1 = new byte[chunkSize * numChunks];
- final byte[] b2 = new byte[chunkSize];
-
- final RandomSource.State state = RandomSource.saveState(rng);
-
- // Generate the chunks in a single call.
- rng.nextBytes(b1);
-
- // Reset to previous state.
- RandomSource.restoreState(rng, state);
-
- // Generate the chunks in consecutive calls.
- for (int i = 0; i < numChunks; i++) {
- rng.nextBytes(b2);
- }
-
- // Store last "chunkSize" bytes of b1 into b3.
- final byte[] b3 = new byte[chunkSize];
- System.arraycopy(b1, b1.length - b3.length, b3, 0, b3.length);
-
- // Sequence of calls must be the same.
- Assert.assertArrayEquals("chunkSize=" + chunkSize + " numChunks=" + numChunks,
- b2, b3);
- }
-}
-
-/**
- * Dummy class for checking that restoring fails when an invalid state is used.
- */
-class DummyGenerator extends org.apache.commons.math4.rng.internal.source32.IntProvider {
- /** State. */
- private int state;
-
- /** {@inheritDoc} */
- @Override
- public int next() {
- return 4; // https://www.xkcd.com/221/
- }
-
- /** {@inheritDoc} */
- @Override
- protected byte[] getStateInternal() {
- return NumberFactory.makeByteArray(state);
- }
-
- /** {@inheritDoc} */
- @Override
- protected void setStateInternal(byte[] s) {
- state = NumberFactory.makeInt(s);
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/ProvidersList.java b/src/test/java/org/apache/commons/math4/rng/ProvidersList.java
deleted file mode 100644
index 4a09ed288..000000000
--- a/src/test/java/org/apache/commons/math4/rng/ProvidersList.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collections;
-
-/**
- * The purpose of this class is to provide the list of all generators
- * implemented in the library.
- * The list must be updated with each new RNG implementation.
- *
- * @see #list()
- * @see #list32()
- * @see #list64()
- */
-public class ProvidersList {
- /** List of all RNGs implemented in the library. */
- private static final List LIST = new ArrayList<>();
- /** List of 32-bits based RNGs. */
- private static final List LIST32 = new ArrayList<>();
- /** List of 64-bits based RNGs. */
- private static final List LIST64 = new ArrayList<>();
-
- static {
- try {
- // "int"-based RNGs.
- add(LIST32, RandomSource.JDK, -122333444455555L);
- add(LIST32, RandomSource.MT, new int[] { -123, -234, -345 });
- add(LIST32, RandomSource.WELL_512_A, new int[] { -23, -34, -45 });
- add(LIST32, RandomSource.WELL_1024_A, new int[] { -1234, -2345, -3456 });
- add(LIST32, RandomSource.WELL_19937_A, new int[] { -2123, -3234, -4345 });
- add(LIST32, RandomSource.WELL_19937_C, new int[] { -123, -234, -345, -456 });
- add(LIST32, RandomSource.WELL_44497_A, new int[] { -12345, -23456, -34567 });
- add(LIST32, RandomSource.WELL_44497_B, new int[] { 123, 234, 345 });
- add(LIST32, RandomSource.ISAAC, new int[] { 123, -234, 345, -456 });
- // ... add more here.
-
- // "long"-based RNGs.
- add(LIST64, RandomSource.SPLIT_MIX_64, -988777666655555L);
- add(LIST64, RandomSource.XOR_SHIFT_1024_S, new long[] { 123456L, 234567L, -345678L });
- add(LIST64, RandomSource.TWO_CMRES, 55443322);
- add(LIST64, RandomSource.TWO_CMRES_SELECT, -987654321, 5, 8);
- add(LIST64, RandomSource.MT_64, new long[] { 1234567L, 2345678L, -3456789L });
- // ... add more here.
-
- // Do not modify the remaining statements.
- // Complete list.
- LIST.addAll(LIST32);
- LIST.addAll(LIST64);
- } catch (Exception e) {
- System.err.println("Unexpected exception while creating the list of generators: " + e);
- e.printStackTrace(System.err);
- throw e;
- }
- }
-
- /**
- * Class contains only static methods.
- */
- private ProvidersList() {}
-
- /**
- * Helper to statisfy Junit requirement that each parameter set contains
- * the same number of objects.
- */
- private static void add(List list,
- RandomSource source,
- Object ... data) {
- final RandomSource rng = source;
- final Object seed = data.length > 0 ? data[0] : null;
- final Object[] args = data.length > 1 ? Arrays.copyOfRange(data, 1, data.length) : null;
-
- list.add(new Data[] { new Data(rng, seed, args) });
- }
-
- /**
- * Subclasses that are "parametric" tests can forward the call to
- * the "@Parameters"-annotated method to this method.
- *
- * @return the list of all generators.
- */
- public static Iterable list() {
- return Collections.unmodifiableList(LIST);
- }
-
- /**
- * Subclasses that are "parametric" tests can forward the call to
- * the "@Parameters"-annotated method to this method.
- *
- * @return the list of 32-bits based generators.
- */
- public static Iterable list32() {
- return Collections.unmodifiableList(LIST32);
- }
-
- /**
- * Subclasses that are "parametric" tests can forward the call to
- * the "@Parameters"-annotated method to this method.
- *
- * @return the list of 32-bits based generators.
- */
- public static Iterable list64() {
- return Collections.unmodifiableList(LIST64);
- }
-
- /**
- * Helper.
- * Better not to mix Junit assumptions of the usage of "Object[]".
- */
- public static class Data {
- private final RandomSource source;
- private final Object seed;
- private final Object[] args;
-
- public Data(RandomSource source,
- Object seed,
- Object[] args) {
- this.source = source;
- this.seed = seed;
- this.args = args;
- }
-
- public RandomSource getSource() {
- return source;
- }
-
- public Object getSeed() {
- return seed;
- }
-
- public Object[] getArgs() {
- return args == null ? null : Arrays.copyOf(args, args.length);
- }
-
- @Override
- public String toString() {
- return source.toString() + " seed=" + seed + " args=" + Arrays.toString(args);
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source32/ISAACRandomTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source32/ISAACRandomTest.java
deleted file mode 100644
index d7d63410d..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source32/ISAACRandomTest.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math4.rng.internal.source32;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public final class ISAACRandomTest {
- private static final int[] SEED_1 = {
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
- };
-
- private static final int[] SEED_2 = {
- 0x61b12894, 0x4a43da95, 0x03e4d8c5, 0xd92e174f, 0xe8998d71, 0x0ecaaa89, 0xaba8a61d, 0xcfd457fc,
- 0xbf25f0a7, 0xe05b20a9, 0xdc744513, 0x9a3eb193, 0x1b69542b, 0xedb0890d, 0xca6b233d, 0xfcabf357,
- 0x297e95f0, 0x1a6c456f, 0x0e3738b0, 0x1c0517f2, 0xcfd105bd, 0x3b7c39eb, 0x141804e9, 0x8a13a0d1,
- 0x3e57cf5c, 0x35471206, 0x00115ef6, 0x3424ec23, 0x2a6a63a7, 0x4cecb3e8, 0xecb4d341, 0x63d25ac1,
- 0x8b68eafd, 0x0eca65b4, 0xd8354668, 0xb37b1ff8, 0x82e80ce3, 0x4c212f9c, 0x58d82d5f, 0x47f36348,
- 0x5bd88987, 0xf77ac66e, 0x75ff93ee, 0xef763453, 0x9705f8b6, 0x64e44649, 0x84f03338, 0x902120e9,
- 0x5350212e, 0x34f466f8, 0x97f96d0e, 0x7f1db8f0, 0x15879833, 0xefee14b4, 0xda25520a, 0x81c0dd7c,
- 0xa20bb729, 0x2fd76844, 0x1b522548, 0xf394565d, 0xabff5f1b, 0x38eaf2e7, 0x364a6ccf, 0x8ed5e169,
- 0xe76aae18, 0x0e4c0b62, 0x68356792, 0x8bc4aa83, 0x31546e69, 0xa6d04441, 0x2abef1df, 0xa40a164e,
- 0x8a8d00ba, 0x32b38dba, 0x6f66a7c6, 0x493b0c84, 0xd86846f0, 0x50d50178, 0x26a7e67c, 0x97802153,
- 0xf35f4ad3, 0x4b54b54e, 0x35bcaef1, 0xc3ed09d6, 0xc127bc55, 0xb2e34ea4, 0x8d674133, 0xed82f03d,
- 0xa8443b28, 0x30bf4bd9, 0x6748419c, 0x155eb313, 0xb17c85da, 0xcd0d8014, 0xf1e95740, 0x5e769ed2,
- 0xf8fa5819, 0x3bd0d93a, 0xa46eaf3f, 0x90f5ae2c, 0x912aa83d, 0x66995d3d, 0x8359b2a9, 0x64534b93,
- 0x1fa38094, 0x89fde50c, 0xef925ef5, 0x4edf2287, 0xc6e82b2b, 0x99812c32, 0x53f6fe01, 0xf104263f,
- 0xbc5d8b8e, 0x6f23f102, 0xb6cc174d, 0xb47b2421, 0xdb083f26, 0xd67a1f25, 0x4f4b0c50, 0x86fca924,
- 0x442036ba, 0x0d7dba08, 0xf6d89c1e, 0x65c9e28e, 0xd689fafc, 0x47f7ae9b, 0x3cb86674, 0x798dc4ce,
- 0x62a2d235, 0x73912420, 0x276ef9b4, 0x50deb689, 0x40b6b744, 0x84d79856, 0x86e5f0c6, 0x835a552b,
- 0xeb73ff95, 0xe428e392, 0x1d60bf15, 0x9ad09e35, 0x783e60ae, 0xb42feb61, 0x028a0343, 0x90febcfc,
- 0xdffb01c8, 0x1087ab1e, 0x84d8a8f9, 0xe5433763, 0x897548cc, 0xb4075ece, 0xd0a5a727, 0x0a84da19,
- 0x0f33964b, 0x5634a097, 0xb7cbac77, 0xe50340eb, 0x93f0ce63, 0x0c743ed4, 0xf6f6f015, 0x30f74cca,
- 0xbb0306a7, 0x3d037943, 0x22f2979e, 0x3591b2c3, 0x9a772e24, 0x5c5812fa, 0x9e733c8a, 0xaae1c943,
- 0xd0b7d924, 0x56b9c463, 0xfaedb557, 0x139b7aa5, 0xe173f123, 0x2d0686a2, 0x03cd0bef, 0x4f47c01e,
- 0x4cf9fb83, 0xba9d433e, 0x95a620d5, 0x62b67429, 0xe836067d, 0x606bc5f7, 0x36af81e2, 0xae0b8b30,
- 0x38ffe5fa, 0xb548228b, 0xc2a25bcb, 0x4ba139ee, 0xab214ad7, 0x66ef4f50, 0x5f8787fa, 0xcb5982b1,
- 0xdbb48ff8, 0x14eaa914, 0xe0874168, 0x3e578246, 0x488c1c11, 0x982039a2, 0xde096b35, 0xa420fb41,
- 0x197a1b67, 0x16eabc59, 0x0e689585, 0x24db72b7, 0xf89878c3, 0x04a5e854, 0x3346da02, 0xb4bb6a04,
- 0x278a0dd4, 0x7bb6e224, 0x92e219c3, 0x595f8a33, 0xedd87ae6, 0xa313cc9f, 0x385c1d3a, 0x0a8b1db5,
- 0xb192379d, 0x3a0be0eb, 0xb8ba269b, 0x1f0c62a5, 0x56307342, 0x8fc9ac94, 0xec91a232, 0xa7b8d3db,
- 0xfbf43a60, 0xa773463e, 0x72d5a4d1, 0x8ddf1755, 0x27da39bb, 0xa8d4668a, 0xd2f3bbfc, 0xa188d6af,
- 0x82ed668e, 0xb45f0032, 0xcdfd4ca0, 0x14e5a80d, 0x456594bc, 0x68efcdd5, 0x7dbf1f9d, 0x74599699,
- 0xfc8639e8, 0x4139e791, 0x9c06921a, 0xc5121d36, 0xd15b9425, 0x0670dca7, 0xbc60c353, 0xaa49e487,
- 0xa7cb5854, 0xd06ddbdb, 0xcb4be0d2, 0x8391ab98, 0xc750d7bf, 0x365340b1, 0x264677c7, 0xb76075a4
- };
-
- /**
- * The output sequence generated by reference ISAAC algorithm in C language.
- * For initial seeding is used SEED_1 data array.
- * 1024 signed 32-bit integers in hexadecimal representation.
- */
- private static final int[] EXPECTED_SEQUENCE_1 = {
- 0x182600f3, 0x300b4a8d, 0x301b6622, 0xb08acd21, 0x296fd679, 0x995206e9, 0xb3ffa8b5, 0x0fc99c24,
- 0x5f071faf, 0x52251def, 0x894f41c2, 0xcc4c9afb, 0x96c33f74, 0x347cb71d, 0xc90f8fbd, 0xa658f57a,
- 0xc5c29e18, 0x6249fa29, 0xbae16ffa, 0x25c871bd, 0xf4c75e24, 0x5ab3eab9, 0xac450b8f, 0x1629cfa4,
- 0x0016e86f, 0xf27c4d0d, 0x67648b17, 0x05c04fce, 0x44d3ff79, 0xc6acd20f, 0x472fd994, 0x842131c4,
- 0xead4a900, 0xc01eda0d, 0x9e604c7b, 0xfb8a0e99, 0x02e17b6f, 0xe8b4f627, 0xc7041eae, 0x42d19cd7,
- 0xa358eb94, 0x19ca2158, 0x6be6ce81, 0x4b90a4de, 0x26f0774d, 0x4e83930a, 0x2492d476, 0xb97ffabe,
- 0x675cc8ae, 0x4cfdd254, 0x5d3c00ea, 0x7bba5ead, 0x6f461810, 0xbef63eea, 0x72eb767b, 0xed6e963b,
- 0xb026016d, 0x17cb7ebf, 0xa7dc6e56, 0xf460bdf1, 0x1ffe0e04, 0x902b347d, 0x02c0d8ab, 0x98cb3f8b,
- 0x6f359a39, 0x9521825f, 0x9026d97e, 0xde342516, 0x890a740c, 0x0f2969e4, 0x2e7ea9ed, 0x394b8a4f,
- 0x1bdf1fd0, 0x15d565b4, 0xbaf0406d, 0x4dac20db, 0x03359832, 0xe34802d5, 0xcc5fff02, 0x0935ad6e,
- 0x7c53c9b2, 0xb10b5d29, 0x4fbb94be, 0xd7e48546, 0xb7cfa23c, 0x7f081c9a, 0xe099baf1, 0x9c7dc323,
- 0xb831ad14, 0x5b563101, 0xfa55319b, 0x060ded54, 0xc5418124, 0x765f0dba, 0x1ad3d9d5, 0x3f07ec49,
- 0xdd5e06c6, 0xc230e2ac, 0xc6ba1971, 0x9cc17bcc, 0x10b22a22, 0x7dfc8c7f, 0xb3310333, 0x205530ee,
- 0xdbf38a8f, 0x003a02f5, 0x007e96a3, 0x36658201, 0x08dfd64f, 0x6275acf3, 0x3d29669b, 0x6b2f4538,
- 0xb0cc336b, 0x1d3043eb, 0x1ad1d764, 0x4c655b84, 0x7a725bb2, 0xb3fc5c66, 0x80b4b915, 0xb2cbd9e4,
- 0x2992dfc6, 0xdf8be548, 0xb310d06e, 0x436385c6, 0x44d6e893, 0x44c4d79d, 0xe3bb2064, 0xe41ea465,
- 0x3ff4cc70, 0x9d21ac42, 0x672c3725, 0xa43a1d02, 0xfd84b19b, 0x5b6fb132, 0x4af40896, 0xe15000a6,
- 0x7cab12f6, 0x8b8e753c, 0xfb253454, 0x359ac366, 0x67822b45, 0x290a1140, 0xade6e428, 0x6095efcb,
- 0x99d8d9e6, 0xa5b5981d, 0x332c95d6, 0xaf5cfcab, 0x161f5ca6, 0x1844cee2, 0xffb8ab5c, 0x82fccaeb,
- 0x49ecf97a, 0x7a60fabd, 0xf9585a3a, 0x4eb6bd32, 0x3b347002, 0xf4930dba, 0x5d21d51e, 0x64e8e3f4,
- 0x52801fa8, 0x71ce907c, 0x872783a4, 0x0761dc80, 0x5c509848, 0x41ba2adc, 0x7e2f5520, 0x85c5eec2,
- 0x368d3d00, 0x5fc7c5f3, 0xb849d785, 0xd95f25b3, 0x79801fd5, 0xbf2443d6, 0x360d41cd, 0x651b11c0,
- 0x801a89ca, 0x8b9e6b94, 0xfde283c4, 0xcc5e6974, 0x2b2f4c09, 0x8b2160a8, 0xdbf57f01, 0x76aa1c4e,
- 0x11f0831a, 0x54713d17, 0xc99a2639, 0x4c373e7a, 0x09e6e57f, 0x71f63b07, 0x7be3f02e, 0x2c907ade,
- 0xe5f489f6, 0x0b0cd6da, 0xb566e14c, 0x0f955969, 0xa0e5710b, 0x80d8c2de, 0x9971e496, 0xc7efbc2f,
- 0x97a48e53, 0x2d845c0d, 0xe1194b0e, 0xad2ba480, 0xd5253552, 0xca890b31, 0x60060afb, 0x89dae927,
- 0x565e2229, 0x43abc21c, 0x03dd14a5, 0xbbadd184, 0x9e979702, 0x2f659883, 0xf313adec, 0x621bd7ca,
- 0xb6470834, 0x4c3901c6, 0x32028bb8, 0x9ded8244, 0x66907654, 0x0a06b272, 0x4a8ec630, 0x4207d36f,
- 0x3e7a8b49, 0x13871be7, 0xbf7af48e, 0x3de0df39, 0x0e864542, 0x8c090a23, 0xaf90e49e, 0x97661c5e,
- 0x365aa66c, 0x0073e342, 0x9c8ac447, 0x6f57e7ce, 0xd5be7ffa, 0x89651d84, 0x53f78eaa, 0x8173dc04,
- 0xd70b1e10, 0x43c1a57b, 0x10c8a5ab, 0xed6abd62, 0x2f840e43, 0x4873d91e, 0x49f413fc, 0x5d89a1c1,
- 0xd3a388fc, 0x96c59cf4, 0x456f1edd, 0x3dd20023, 0xa264e933, 0xd32956e5, 0xd91aa738, 0xe76dd339,
- 0x7a68710f, 0x6554abda, 0x90c10757, 0x0b5e435f, 0xaf7d1fb8, 0x01913fd3, 0x6a158d10, 0xb8f6fd4a,
- 0xc2b9aa36, 0x96da2655, 0xfe1e42d5, 0x56e6cd21, 0xd5b2d750, 0x7229ea81, 0x5de87abb, 0xb6b9d766,
- 0x1e16614c, 0x3b708f99, 0x5cf824cd, 0xa4ca0cf1, 0x62d31911, 0x7cdd662f, 0xcb9e1563, 0x79ae4c10,
- 0x080c79ec, 0x18080c8e, 0x4a0a283c, 0x3dde9f39, 0x09c36f90, 0xad567643, 0x08294766, 0xb4415f7d,
- 0x5597ec0f, 0x78ffa568, 0x8bace62e, 0x4188bfcd, 0xc87c8006, 0xafa92a6d, 0x50fc8194, 0xcae8deba,
- 0x33f6d7b1, 0x53245b79, 0x61119a5a, 0x7e315aeb, 0xe75b41c9, 0xd2a93b51, 0xec46b0b6, 0x1ed3ff4e,
- 0x5d023e65, 0xadf6bc23, 0xf7f58f7b, 0xe4f3a26a, 0x0c571a7d, 0xed35e5ee, 0xeadebeac, 0x30bcc764,
- 0x66f1e0ab, 0x826dfa89, 0x0d9c7e7e, 0xe7e26581, 0xd5990dfb, 0x02c9b944, 0x4112d96c, 0x3ff1e524,
- 0xc35e4580, 0xfdfef62d, 0xb83f957a, 0xbfc7f7cc, 0xb510ce0e, 0xcd7411a7, 0x04db4e13, 0x76904b6d,
- 0x08607f04, 0x3718d597, 0x46c0a6f5, 0x8406b137, 0x309bfb78, 0xf7d3f39f, 0x8c2f0d55, 0xc613f157,
- 0x127dd430, 0x72c9137d, 0x68a39358, 0x07c28cd1, 0x848f520a, 0xdd2dc1d5, 0x9388b13b, 0x28e7cb78,
- 0x03fb88f4, 0xb0b84e7b, 0x14c8009b, 0x884d6825, 0x21c171ec, 0x0809e494, 0x6a107589, 0x12595a19,
- 0x0bb3263f, 0x4d8fae82, 0x2a98121a, 0xb00960ba, 0x6708a2bc, 0x35a124b5, 0xbccaaeed, 0x294d37e5,
- 0xd405ded8, 0x9f39e2d9, 0x21835c4d, 0xe89b1a3b, 0x7364944b, 0xbd2e5024, 0x6a123f57, 0x34105a8c,
- 0x5ad0d3b0, 0xcc033ce3, 0xd51f093d, 0x56a001e3, 0x01a9bd70, 0x8891b3db, 0x13add922, 0x3d77d9a2,
- 0x0e7e0e67, 0xd73f72d4, 0x917bdec2, 0xa37f63ff, 0x23d74f4e, 0x3a6ce389, 0x0606cf9f, 0xde11ed34,
- 0x70cc94ae, 0xcb0eee4a, 0x13edc0cb, 0xfe29661c, 0xdb6dbe96, 0xb388d96c, 0x33bc405d, 0xa6d12101,
- 0x2f36fa86, 0x7ded386f, 0xe6344451, 0xcd57c7f7, 0x1b0dcdc1, 0xcd49ebdb, 0x9e8a51da, 0x12a0594b,
- 0x60d4d5f8, 0x91c8d925, 0xe43d0fbb, 0x5d2a542f, 0x451e7ec8, 0x2b36505c, 0x37c0ed05, 0x2364a1aa,
- 0x814bc24c, 0xe3a662d9, 0xf2b5cc05, 0xb8b0ccfc, 0xb058bafb, 0x3aea3dec, 0x0d028684, 0x64af0fef,
- 0x210f3925, 0xb67ec13a, 0x97166d14, 0xf7e1cdd0, 0x5adb60e7, 0xd5295ebc, 0x28833522, 0x60eda8da,
- 0x7bc76811, 0xac9fe69d, 0x30ab93ec, 0x03696614, 0x15e3a5b9, 0xecc5dc91, 0x1d3b8e97, 0x7275e277,
- 0x538e1f4e, 0x6cb167db, 0xa7a2f402, 0x2db35dfe, 0xa8bcc22d, 0xd8c58a6a, 0x6a529b0b, 0x0fd43963,
- 0xafc17a97, 0x943c3c74, 0x95138769, 0x6f4e0772, 0xb143b688, 0x3b18e752, 0x69d2e4ae, 0x8107c9ff,
- 0xcdbc62e2, 0x5781414f, 0x8b87437e, 0xa70e1101, 0x91dabc65, 0x4e232cd0, 0x229749b5, 0xd7386806,
- 0xb3c3f24b, 0x60dc5207, 0x0bdb9c30, 0x1a70e7e9, 0xf37c71d5, 0x44b89b08, 0xb4d2f976, 0xb40e27bc,
- 0xffdf8a80, 0x9c411a2a, 0xd0f7b37d, 0xef53cec4, 0xeca4d58a, 0x0b923200, 0xcf22e064, 0x8ebfa303,
- 0xf7cf814c, 0x32ae2a2b, 0xb5e13dae, 0xc998f9ff, 0x349947b0, 0x29cf72ce, 0x17e38f85, 0xf3b26129,
- 0xd45d6d81, 0x09b3ce98, 0x860536b8, 0xe5792e1b, 0x12ad6419, 0xf5f71c69, 0xcbc8b7c2, 0x8f651659,
- 0xa0cc74f3, 0xd78cb99e, 0x51c08d83, 0x29f55449, 0x002ed713, 0x38a824f3, 0x57161df6, 0x7452e319,
- 0x25890e2e, 0xc7442433, 0x4a5f6355, 0x6a83e1e0, 0x823cedb6, 0xf1d444eb, 0x88381097, 0x5de3743e,
- 0x46ca4f9a, 0xd8370487, 0xedec154a, 0x433f1afb, 0xf5fad54f, 0x98db2fb4, 0xe448e96d, 0xf650e4c8,
- 0x4bb5af29, 0x9d855e89, 0xc54cd95b, 0x46d95ca5, 0xef73fbf0, 0xf943f672, 0x86ba527f, 0x9d8d1908,
- 0xf3310c92, 0x05340e15, 0x07cffad9, 0x21e2547e, 0x8c17eff0, 0xd32be060, 0x8aba3ffb, 0x94d40125,
- 0xc5a87748, 0x824c2009, 0x73c0e762, 0xcdfec2af, 0x0e6c51b3, 0xa86f875e, 0xbc6172c7, 0xf7f395f1,
- 0x3f7579b3, 0x7aa114ed, 0x165b1015, 0xd531161a, 0xe36ef5bb, 0xdc153e5f, 0x1d0cb81b, 0xceffc147,
- 0x6079e4ce, 0xc3142d8f, 0xa617a083, 0xb54fed6f, 0xc3c7be2c, 0x02614abf, 0x6fb5ce56, 0xd21e796c,
- 0x2d0985de, 0xe9f84163, 0xc1a71e3c, 0x2887d96f, 0x57c4c925, 0x05efe294, 0x88157153, 0x9a30c4e8,
- 0x8854a0a1, 0x02503f7d, 0x0cd6ef81, 0x1da4f25a, 0xe8fa3860, 0x32e39273, 0x4c8652d6, 0x9ab3a42f,
- 0x9ead7f70, 0x836d8003, 0x6cbe7935, 0x721502dd, 0x5a48755c, 0x07497cae, 0xde462f4d, 0x92f57ea7,
- 0x1fe26ce0, 0x27c82282, 0xd6ec2f2b, 0x80c6e402, 0xce86fdfc, 0x52649d6c, 0xc798f047, 0x45bae606,
- 0x891aec49, 0x66c97340, 0x9ca45e1c, 0x4286619c, 0xf5f9cc3b, 0x4e823ad3, 0xc0d5d42a, 0xaee19096,
- 0x3d469303, 0xfe4cb380, 0xc9cd808c, 0x37a97df6, 0x308f751f, 0x276df0b4, 0xe5fbb9c7, 0x97ca2070,
- 0x88412761, 0x2ce5d3d5, 0xd7b43abe, 0xa30519ad, 0x26414ff3, 0xc5bde908, 0x275ead3a, 0x26ceb003,
- 0xbf1bd691, 0x037464c0, 0xe24124c0, 0x81d4cc5f, 0x484525e4, 0x1c3a4524, 0x9e7e4f04, 0xe1279bff,
- 0x6dd1943a, 0x403dae08, 0x82846526, 0xd5683858, 0x29322d0d, 0xa949bea2, 0x74096ae7, 0x85a13f85,
- 0x68235b9d, 0x8ef4bce6, 0x142a6e85, 0xdad1b22a, 0xb7546681, 0x959e234e, 0xfd8650d8, 0x3e730fa8,
- 0x56f55a71, 0xd20adf03, 0x7cdc78a2, 0x19047c79, 0x253b1d7a, 0x4389a84a, 0x0aeb8165, 0x9c15db3b,
- 0xaafef5a7, 0xbe8b06b2, 0xb5fe87c0, 0xe2a4ef71, 0xd9d711f9, 0xecfcf20b, 0x80fac4c2, 0xbbb8abc4,
- 0x239e3b0a, 0x858129a6, 0xd97cd348, 0x8a30738a, 0xc5b71937, 0xd649a428, 0x18c1ef9a, 0x75c08a36,
- 0xc921f94e, 0xdf9afa29, 0x040f7074, 0x72f5972f, 0x84ef01da, 0x2cb7b77f, 0x867027d7, 0x9ce0199d,
- 0x71865c4c, 0x7a36af93, 0x6c48ddd8, 0x19b48fd0, 0x75f4e9e2, 0x0084cfe5, 0x63bfd4d8, 0x9783cdee,
- 0x64f2632c, 0xf1b20eaf, 0xcc8bfa2d, 0x39ddf25a, 0x740e0066, 0x9ddb477f, 0x12b2cfb6, 0xd067fce5,
- 0x1a4b6a53, 0x001cdb95, 0x12c06908, 0x531ac6bf, 0x513c1764, 0xf7476978, 0x1be79937, 0x8a8dfaa3,
- 0x70a1660e, 0xfb737b1a, 0x3f28ee63, 0xc1a51375, 0x84bd6dd6, 0xe4a51d21, 0xeafed133, 0x22ae0582,
- 0x4d678f26, 0xf854b522, 0x31907d62, 0x4b55dd99, 0x04d3658a, 0x19c1e69c, 0xc6112fdd, 0xc66699fd,
- 0xa0eabe6b, 0x3724d4dc, 0x0d28fe52, 0x46819e2e, 0x96f703ac, 0x21182ca3, 0x2e7b022f, 0x31860f13,
- 0x1956b1e5, 0xe1322228, 0x08063a85, 0x1d964589, 0x94d90481, 0x53c078f3, 0x5afb43ae, 0x1e3437f7,
- 0x877eb7b4, 0x5d67133c, 0xa385cb2c, 0xb82f2703, 0xef05ee06, 0x931dd7e2, 0x10d210aa, 0xe21339cc,
- 0x479c3a22, 0x613b67b2, 0x33c5321c, 0xa5f48ac4, 0xba5590c8, 0xeb244925, 0xd0ef3cc9, 0xd8c423fb,
- 0x15cfcc5c, 0x1feb2e4f, 0x36ec0ea3, 0xdbef7d9f, 0xd5ec6bf4, 0x3d3dff8a, 0x1e04a7f7, 0x8766bb54,
- 0x9a1d7745, 0xc79a1749, 0xb8d2486d, 0x582e3014, 0xa82427f5, 0x65dfa427, 0xbc5654c1, 0xbd086f26,
- 0x0451516d, 0xff4cfc35, 0x81f2864d, 0x31860f05, 0xd0638e1a, 0xb059261d, 0x3d1e9150, 0x21e2a51c,
- 0x82d53d12, 0x1010b275, 0x786b2908, 0x4d3cfbda, 0x94a302f4, 0x95c85eaa, 0xd7e1c7be, 0x82ac484f,
- 0xd24daa9a, 0x70055204, 0xbf27ef0d, 0x740ebb34, 0x47a1ff2f, 0x037e5e95, 0x3362d8d3, 0xb08c9e58,
- 0x7036b9a5, 0x3354197a, 0x326c9f12, 0xab99166e, 0x6c5d388b, 0xb222a768, 0x1bf121c5, 0x2ef76080,
- 0xb0658121, 0x8331bdd3, 0x64b5cd35, 0xc3c7fbe4, 0x576e7d5e, 0x1cbdc1b2, 0x5c54b675, 0xbffd76e3,
- 0x2ad7b53f, 0xe596de29, 0xc2d972db, 0xf1c92f34, 0x6af3ded6, 0xec317d66, 0x6a17bed5, 0x27750e9e,
- 0x8d950cb3, 0xb07688cc, 0x17a6ddd8, 0x5bf140e0, 0xed8713e0, 0x05890caa, 0xf66e4d73, 0x5ea0347f,
- 0xf535f2f5, 0x240c70f3, 0x5e922192, 0x8e59f944, 0x3185f7a7, 0x852dd342, 0x58c8e53b, 0x760071c5,
- 0xadb76f78, 0x185ab80c, 0x9d84df28, 0x4d2056da, 0x69bebccc, 0xa9fcb5f8, 0xb9d3ac81, 0xcc374aac,
- 0xc04e1ee9, 0x72634634, 0xb3bbf485, 0x1eb91de5, 0x5e8de602, 0x211cd561, 0xb03404e6, 0x051f3a53,
- 0xb263569c, 0x96cbc54f, 0x9eaf58e6, 0x32e9f0f2, 0x370f1cd9, 0x15bf840d, 0x1dbd5d06, 0xb04d214d,
- 0x6d1697ee, 0xc4b6fce1, 0x1b95f82d, 0x46979ca6, 0x0354cfc8, 0xd5950d3d, 0x10db605d, 0x18af3572,
- 0x990ec7a8, 0x2a0fe87f, 0x7937dbb8, 0xee376c86, 0xcc9f9070, 0xc953caa8, 0xd5c7c2ed, 0xee4f752e,
- 0x84f302f7, 0x1e08a48e, 0x44a5da35, 0x0fab83e2, 0xbb7cb9df, 0x2590afe1, 0xfef026aa, 0x83dbd643,
- 0xbe916d11, 0x27f7fba9, 0x82135d43, 0x6c5fa2a4, 0xe1e1370e, 0x51534581, 0x4cd9def3, 0xd94b4990,
- 0x74772379, 0x59264a1d, 0xc1dcdd8e, 0xed4ef1e9, 0xf29d901a, 0x68ecd0ad, 0x9ac31f92, 0x839a285e,
- 0x46447122, 0xc0e56c6e, 0xb09a4b83, 0xa9500b90, 0xda83c4e5, 0x4175b2f8, 0xeb4ddb4a, 0x236c6f2e,
- 0xeeb57a32, 0x2626e708, 0xa9d35265, 0x6ab3e9ab, 0xf12fcc1f, 0x1c317c43, 0x66c34fb3, 0xe17e58a0,
- 0x0295d4a1, 0x40cd40f9, 0x72700bb0, 0xd591e61e, 0x3e96b29b, 0xb50d5db3, 0xa3715dcc, 0x3405bcb4,
- 0x0e034d65, 0x210a4a2b, 0x7c302f2c, 0x24e8bef6, 0xa5135147, 0x0607ef80, 0x01f86c8f, 0x2c792c8a,
- 0x6ab73133, 0x6f436006, 0x09bf22a6, 0x1fde4622, 0x9841bd1c, 0xb23a7ad7, 0xdad579a4, 0x431229e9,
- 0xfa5dcb2d, 0x7da4f790, 0xa9b2c914, 0xcd191ced, 0x7a05e4aa, 0x73af1889, 0x192667b3, 0x538d4540,
- 0xacdbca81, 0x6b9d9e90, 0xc0462bba, 0xfcf5a7b9, 0x7b5c2904, 0x41a83c83, 0x7e69828f, 0x328a3bab,
- 0xdcd0f182, 0x1d113bcd, 0x1fb5c81c, 0x2d52afa0, 0x2d0c6111, 0x2a02ce14, 0x3fcd2c15, 0x54d574f9,
- 0xde57e605, 0x85dbb53d, 0xfc7cc003, 0x769c74d9, 0x6f834a4f, 0x79b3b87e, 0xe3d7c853, 0xa83e14b2,
- 0x3b1fc1ad, 0xb7dc2988, 0xb60ed652, 0xda3e3d1a, 0x5f2f680c, 0xb46e08da, 0x589b77da, 0xcef68535,
- 0x1c05d7a6, 0x24572da1, 0x939b02a5, 0xccd08d13, 0xdfa22970, 0xdff7581b, 0x2d5fade6, 0x5cfd3389,
- 0xce26cbb1, 0x376d7fd0, 0x02811e2e, 0xcc8030ab, 0xa7a4c9dc, 0x81db0ca7, 0x15a1bcef, 0x2045c6b5,
- 0x52c2f563, 0x6c829737, 0xb4f3384f, 0xb14d2f2b, 0xe102e00a, 0xba359973, 0x6045dd8b, 0xd0a5e531,
- 0xd679300f, 0xaabec63e, 0x526ad900, 0x95224f33, 0x723d6d44, 0x83584ad4, 0xa14ed869, 0x727bb03a,
- 0xdde37025, 0xb29d6587, 0xc3f3971d, 0x725933c2, 0x68f3eda4, 0xf73e9fdc, 0x944afd04, 0xa4c5e05f,
- 0x477f70ae, 0xffebfc90, 0xc21cff70, 0x84c68e32, 0xe82a3d6b, 0xba243867, 0x511c142f, 0x2062b8ac,
- 0x274a119f, 0x772afba2, 0x88a3974d, 0x205cf0de, 0xe45d5a2a, 0x1745056b, 0x2c8138f5, 0x982938a7,
- 0xfb265af9, 0x700c2cdf, 0x93e549b4, 0xb8abd353, 0xd74073e8, 0x289caf2a, 0x63e802e9, 0xc2f9adb7
- };
-
- /**
- * The output sequence generated by reference ISAAC algorithm in C language.
- * For initial seeding is used SEED_2 data array.
- * 1024 signed 32-bit integers in hexadecimal representation.
- */
- private static final int[] EXPECTED_SEQUENCE_2 = {
- 0x67ae8a37, 0xa78322ea, 0xb9394933, 0x61f6e3c5, 0xbea576f1, 0xbb958f18, 0x12ce6479, 0xc593d5de,
- 0xdef281a0, 0x8435bb62, 0xf20b44db, 0x8a98479a, 0xbf2b8b66, 0x1080265e, 0xf0f8f12f, 0x021fa7f3,
- 0x81d2ed59, 0xb224a5f8, 0x0c1ff346, 0x92007ea8, 0x8fd1ce43, 0xeced69f5, 0x651fe09a, 0x45cf2c3e,
- 0x449b2b1e, 0x4f136be5, 0x8240cc97, 0xca979afa, 0x33b6a857, 0x7300f4f3, 0x79755d71, 0xcf11dd62,
- 0x916b7e04, 0x02076c0e, 0x9b4e3e68, 0x04836ed5, 0xf1b492c6, 0x887ef90c, 0x091b68f6, 0xaf7f0d3b,
- 0x89d7e5c1, 0x2b28fff7, 0xe6280e4f, 0x6681a805, 0xcb270bbb, 0x8e037463, 0x31a125f7, 0x0ba3c135,
- 0x7c2e8b3e, 0x6e21e06e, 0xc8b336ba, 0x08d677c3, 0x469fd05c, 0x71528649, 0x2024c602, 0x000e4f99,
- 0xb03395b1, 0x0a12d960, 0x68b15274, 0x7c415c07, 0x047c739b, 0x46658905, 0x45512a3c, 0x7f4cd2ff,
- 0x3d4d4ef6, 0xd7016dad, 0x6074bbf0, 0xbeaa55eb, 0xc519d326, 0x3ad349fd, 0x2fec4649, 0x14fa40ae,
- 0x96b51341, 0x2bf08ef1, 0xd1d374e4, 0x44168b14, 0xb01bee9b, 0x0b3f4332, 0xc799b9da, 0x76fc7dbd,
- 0x8c368a57, 0xe4cd2cad, 0xeeb0318a, 0xc2152908, 0x2b707a0e, 0x73457464, 0xc08e92a0, 0xfcdfca5b,
- 0x1320ed43, 0x333b77b9, 0x2e70948a, 0xa77d94f7, 0xbc1fb9fa, 0xa8ad15a1, 0x3c47b0f4, 0x867c4a8f,
- 0xb85784e0, 0x8a854e80, 0x456c8700, 0xc28f3a01, 0x415da6aa, 0x1315c6d8, 0x70a4ca70, 0xfdea940e,
- 0x686fbdc9, 0xda649eba, 0x661196f7, 0x795b5d27, 0xe10c78fa, 0x2fd89cf3, 0x61e850da, 0x00c49764,
- 0xee51d841, 0x00c18025, 0xdea163b3, 0x8b1b2080, 0x6abdd683, 0xe560c731, 0xc661b3e0, 0x23a3ff08,
- 0xa7579919, 0xfa443cba, 0x480bd220, 0x0a11740b, 0xb4b327c7, 0x831a0840, 0xb7c50ff3, 0x4266dff1,
- 0x835d0665, 0x52593038, 0x3917fb8e, 0x88c3b400, 0x05fb8823, 0xc9eaa89f, 0x6957fd17, 0x8dbcb8fe,
- 0xdec10c3c, 0x918d5fd8, 0x6af8619a, 0x8f472255, 0xc2f757b7, 0x9d62e804, 0x45e0e276, 0x482597d3,
- 0x06190214, 0x172b8501, 0xe91d7b8c, 0x4ee985fc, 0x3ecbf47a, 0xbbae5d98, 0x1f0bbdeb, 0x0d38208e,
- 0x6d4cb3e3, 0xa70050c4, 0xf0db408e, 0xddb6f1a7, 0x4bc4bc61, 0x90e1c1db, 0x203770dc, 0x39959247,
- 0xe2e0376a, 0xf70a8521, 0x81c759b2, 0x24d9915b, 0x09cc2ec3, 0x0fd0bff9, 0x58875636, 0xee78837e,
- 0x025a7eee, 0x4226859f, 0x85e21806, 0x9c1328bd, 0x0522fda0, 0x585441aa, 0x366f9ea0, 0xeb70934f,
- 0x0e394c41, 0xfa801419, 0x2b6d4c3e, 0xb09775fe, 0x3f0184ae, 0x3ace3518, 0xf80bf893, 0x9754753b,
- 0x78c46b93, 0x281e1918, 0x0dfcc5ee, 0xc0401601, 0xf8b11ce9, 0x9f799306, 0xb65c4232, 0x12ee4f73,
- 0xade72a42, 0x0ce54d71, 0xa6780e69, 0xe73bd8f9, 0xc245228f, 0x5fa2ed1a, 0x11627d1d, 0x2617ea2f,
- 0xd7404db6, 0x228fb877, 0xc5379535, 0xfe00008d, 0xc5f1491e, 0x1a3bdb0e, 0x9a90cc98, 0xa0abe3f5,
- 0xac7a0d18, 0x87bb3538, 0xa224baf7, 0xf2496ca4, 0x6a5b9bd6, 0x9a7da8d8, 0x72419677, 0xa36aec4d,
- 0x2a08ac0d, 0xfc4d7b21, 0x25f2aad0, 0x4f7146d4, 0xb4a603bd, 0x194e9792, 0x8f60cf1c, 0xed8ae037,
- 0xa47f90b1, 0x5eec55a3, 0x326c33d4, 0x6f79168f, 0xbcfc27fa, 0xd9e76d04, 0x79430e33, 0xd0c3b727,
- 0xd4bb06af, 0x8805066b, 0xaaef1130, 0x04958fef, 0x2e3270f4, 0xf5a8ffe8, 0x2a089c72, 0xff411bfc,
- 0xd6ed9552, 0x6253f5ef, 0x0c836c2f, 0xb79471b0, 0x127d177c, 0xf901cefa, 0xff75dc46, 0xde79ec4f,
- 0xe9f1f182, 0x9d28d8cd, 0xfcc98a94, 0x227670c2, 0x46b7c48c, 0x8fd77dcb, 0x60bc6d66, 0xe775322d,
- 0x0def2251, 0xf3dd14cb, 0x6c3f3468, 0x87696244, 0x10cca0be, 0x1d7fa716, 0x955b963b, 0xe53b6074,
- 0x77af9ec4, 0xfc856100, 0x91a06dc7, 0x8d55e3f1, 0xf8c805a3, 0xf3a1cb7a, 0xbcd51c6d, 0x301fdcdf,
- 0xdbcbcc54, 0x8b85fe57, 0x946d707e, 0x388a2ed4, 0xc4b93a5b, 0xd48631d2, 0xae2b4f28, 0x5b731392,
- 0xdf6e621e, 0xc4590c30, 0xa3a23cd5, 0xbfce9899, 0x4620cff9, 0x966c8c3f, 0x7a302556, 0x3fe549fa,
- 0x67533e77, 0x80250302, 0xcd899fe7, 0x694e77ea, 0x0879525d, 0xab6675e4, 0x763f8b35, 0x7684e6a1,
- 0x8fa35070, 0xe9fccaf1, 0x2d7195b7, 0x85b45186, 0xab799317, 0x2c84bd2c, 0xf8354c09, 0x02d96875,
- 0x8fdcc390, 0xf6af5aec, 0x2a584739, 0x8a1ba7e9, 0xea46f9b2, 0x98acd24f, 0xfc8a3a24, 0xa496eff9,
- 0x625c30ea, 0xc6ea0535, 0x3ed3b5d6, 0xffcd675d, 0x0b1719f6, 0x1b1c4e7b, 0x3206a672, 0x62fc1851,
- 0xa6a4c781, 0x78bbdbbe, 0x06c1c8ce, 0x5747c340, 0xfff7ab9c, 0xebaf9370, 0xf7b185a8, 0xf8309f84,
- 0xfa1601de, 0xf9fc8780, 0x59c2f8bd, 0xe74fcd5b, 0xf115f57f, 0xddda3332, 0x2ee56568, 0xa2243659,
- 0x9d6d578f, 0xbb507574, 0x95d44e0e, 0xdbdf2bc3, 0x0dc1b750, 0xc6a24241, 0x207d7115, 0xc337d024,
- 0x3817ef9a, 0xe9f12ccf, 0x4d67fc7d, 0x3da57a2b, 0x000e09a5, 0xe739c5a2, 0x7b7e1613, 0x23d576fe,
- 0x6941a210, 0x57521190, 0xdc4359c0, 0xd8eed2f8, 0x7862904f, 0xfc179a41, 0xeee2716e, 0x362cf76a,
- 0x0a087072, 0x3e6e2fa9, 0xaf2a0efb, 0x221d513f, 0xf054d856, 0xc3297367, 0x1c0998c8, 0xa664172f,
- 0xe2637c8e, 0xc17ac7d4, 0x0e041f43, 0x0d9c0ae4, 0x9346dacf, 0x7fb2a015, 0xe92276c2, 0x21478bfe,
- 0x119e2d0c, 0x5f76aeaf, 0xbe21aaec, 0x63174d5f, 0x13b796c3, 0x0fa0eba1, 0xe2f7277a, 0x3f555b42,
- 0x0215c7e4, 0x96266efa, 0x2953a4d1, 0xadfc171a, 0x396234a7, 0x560c0279, 0xefa6d2c6, 0xf48d9b5a,
- 0x4131c7b1, 0x9e302f70, 0x637c9f23, 0x22637330, 0x09927e76, 0x0898d1d6, 0x1b797274, 0x9ad491a2,
- 0xa2df3627, 0x012c3ed0, 0xc19c09d7, 0xa2fdaf56, 0x5b91f8fd, 0x3b7c49c9, 0x25694d29, 0xd7b42e9c,
- 0xa7be0053, 0xa91f1761, 0xd89e8b2a, 0x67846097, 0x76bd4006, 0xb8eb0712, 0x859bf877, 0xca42d70c,
- 0x24e80a69, 0xd92bc598, 0x55498c1e, 0x86deba8b, 0xf7c340b7, 0xa36caa12, 0x0631ddec, 0xc0146fe8,
- 0x2f959ef3, 0xf8400f0c, 0x58f676a0, 0x4ae4fe13, 0x9c4af056, 0x9e6f19d6, 0x12a9eb69, 0x1aeed54e,
- 0x34c91114, 0x97128045, 0x920d1f59, 0xffe7fbaa, 0x2db4a671, 0x6e6ff7aa, 0xd40d46bd, 0x1578f939,
- 0x15c5cbc6, 0xff356fd0, 0xd5d1680c, 0x5b11d14d, 0xe75541c0, 0x0fe2e2ba, 0x3ad55308, 0x8f036a69,
- 0xa9bfc3cd, 0x87685338, 0x510092b4, 0x1f66622a, 0x996337b2, 0xc531891f, 0x98371a93, 0xd9630100,
- 0x513ff133, 0xcf8381da, 0xed12e8e9, 0xe3ce7c7b, 0x8f731ab5, 0x511ba7c2, 0x9d754e87, 0x244603ac,
- 0xfd9985e1, 0xc1581765, 0x84e50a12, 0xa0ab0034, 0x63ee60c2, 0xdf5ab248, 0x09b42202, 0xca87f896,
- 0xca6ae5f0, 0xa569d829, 0x977cf29b, 0xd56a2a2f, 0x85ad1532, 0xfa2a131a, 0x00784081, 0x81f0e466,
- 0xebd340d3, 0xc37ad0e4, 0xd0aa6d7a, 0x36d2551f, 0xd6ff8448, 0xc7b89445, 0xa43421ad, 0x3be75400,
- 0x557a61ef, 0x0f519b14, 0x56503579, 0x1c8d164d, 0x0dcef35b, 0x3d9f1f2a, 0x56d056f2, 0x5d8fd4ec,
- 0xa481a350, 0x7cadd9c0, 0x70375ce2, 0x83263d2a, 0x5826ea3b, 0xfa523ce7, 0x50c9438b, 0x74fca95d,
- 0x62967ef5, 0x11fd6429, 0xcbb8e28c, 0x67fb9e81, 0xdc9e1147, 0xa29672f7, 0x1cf310f7, 0xb1e1d8e6,
- 0x3f862ff3, 0x6ade0327, 0xa92f3686, 0xed79f165, 0x359e1620, 0x36c68936, 0xe46fe521, 0x0c5e36b0,
- 0x6d9d9cdb, 0xc095eecd, 0x566dd305, 0x6d96cd36, 0x5d115a80, 0x2a9489a8, 0xdd067488, 0x73acf831,
- 0x7392c0f0, 0x30707838, 0x92826042, 0x67c54548, 0xf830434d, 0xebe67854, 0xaefc9a41, 0xcabf703f,
- 0x5242c77f, 0x1f3867a9, 0x48174739, 0x8657c39e, 0xa11247e2, 0xb4e6624d, 0xc7ffe78a, 0x1e11a841,
- 0x6690244b, 0x8dcc9292, 0x5ce4dcc4, 0xebcba02d, 0x2ef6503d, 0x4fb880bc, 0xb949a759, 0x7bb18a1e,
- 0x5973d2e8, 0x577ad8a6, 0xa9d4992e, 0x1a248a0c, 0xcc4450ed, 0x7e0178d3, 0xe98a8f3f, 0x209fb330,
- 0xf7bf40fc, 0x632231b3, 0x7055fdaf, 0x7719e655, 0xf8d49413, 0xc200aa04, 0x8a41183a, 0xdfa217c1,
- 0xcd0c165d, 0x08fec61c, 0xef608048, 0xe19fae2c, 0xedc6f3ea, 0x859a69f9, 0x5f96c76d, 0x571aec69,
- 0x9cfe7fa4, 0x692baf70, 0xbb143cb4, 0xe8968678, 0xfcb77411, 0x02d3268d, 0xcdc3daa3, 0x514e78e9,
- 0xa231a480, 0x8ac10400, 0xe19a2ca1, 0xfa790fe1, 0x808fec9c, 0xe4760960, 0x62e9d051, 0x5c4b006b,
- 0x22eb9703, 0x426b5907, 0xfa1cd338, 0xa3b4811a, 0xad6185c1, 0x349efbc0, 0xeee28d42, 0x02531fc5,
- 0xd11b2c4d, 0x5b3bf865, 0xf4823687, 0x4f92b6b7, 0xfb641c60, 0x0c526fa9, 0x42438de8, 0xd5cbf7a0,
- 0x54ad0d1f, 0xb4e63f09, 0x666285eb, 0xe7ec0275, 0x57e7225a, 0xafe6b0e3, 0x17431cd7, 0x33bc9204,
- 0x8a9cbdde, 0x94d8fe7d, 0xc943f36c, 0x1348c3c6, 0x43cf9b8c, 0x5a84ae20, 0x6d372dea, 0xdb0b3c92,
- 0xf0f2a72d, 0x473a1fe7, 0x062416df, 0x0a12c61c, 0x3680c102, 0x8d0189db, 0x0824325f, 0xffb97ead,
- 0x0d8d353f, 0x4a4e6ec2, 0x76243bb7, 0xdabfbeee, 0xcd8410d7, 0xa30f17c3, 0x2b59ceef, 0xda27f7c0,
- 0x791d813b, 0xc0516741, 0xb363e4ff, 0x31ddbfb7, 0x49db1590, 0xd843513c, 0x8d317a75, 0xb24387df,
- 0x63fd4066, 0xa0fce498, 0x7b42de97, 0x30eddc0c, 0x071ad222, 0x3a9054c4, 0x5ce35298, 0x375be64b,
- 0x10af32c8, 0xa999ade1, 0xfa9f4d31, 0xfbe24a2a, 0x4c92714b, 0xcce3056a, 0xa81d616a, 0x3bb49213,
- 0x72fd2b0e, 0x1b46d17e, 0x92159bc7, 0x7462e172, 0x4fdc3e05, 0xf309c063, 0x9133532c, 0xe62d9341,
- 0x681a4871, 0xb1598525, 0x498ca388, 0x96a7ea81, 0x791c8a85, 0x2a33a1e2, 0x1e6abc87, 0xb21a4878,
- 0x65fac53b, 0x59162ae1, 0x22858a30, 0x40f4e569, 0xe5cb0023, 0x626cd2a0, 0xfe6d8fc8, 0xbb7ed7c3,
- 0x9a557393, 0xd0ff5e60, 0x2a20ed9b, 0x4eaafb5a, 0xbe9425bd, 0x63620ce1, 0x31ea24ed, 0x082e426a,
- 0x7ff35a73, 0xa67fbaa9, 0xd2e3c5b9, 0x1a90e96a, 0x71f19184, 0xb836b88b, 0xe51fa187, 0x42576438,
- 0x58d28776, 0x47bd92a3, 0x09816862, 0x295138ef, 0x23ab2bb1, 0xd7c584e0, 0x1793062f, 0xcc47e852,
- 0xc2eb9703, 0xe6812d93, 0xa4aa4d2e, 0x7f635b79, 0xa7407b29, 0x9724c087, 0x406e08ce, 0x6bf1d8b7,
- 0x9ef5b815, 0xf2c6f094, 0x86269ca2, 0x17fdaa4f, 0x9b645b61, 0x701bbbeb, 0x8de7bcb7, 0xd468266a,
- 0x48df44ae, 0x570b08ca, 0x7a5ba43b, 0xfc927312, 0x3461a3dd, 0x0ffe5943, 0x87060375, 0x8d8afed7,
- 0x83d20387, 0x77eabb51, 0xf86d045b, 0x71a47537, 0xa4485ea8, 0xfd2b6ac3, 0xb4ba1fcf, 0x31dcee82,
- 0x8b41cdf6, 0xeacde42b, 0x02de5fbb, 0xb6311aa8, 0x1596ee5d, 0x355cc39d, 0xbe1a87c1, 0x01e1df07,
- 0xfe413d46, 0x5e5e13ab, 0x30233fd6, 0x99449292, 0x34955dcc, 0x1f37d394, 0xd43639bd, 0x65c98eee,
- 0x67b85593, 0x1660b2a1, 0xfd86e9a0, 0x33bb6e5a, 0xdd5892fb, 0xa6832091, 0xd077d216, 0x353bfe9a,
- 0xb4a10726, 0xca1a536e, 0xed8af6c1, 0x41d167d1, 0x5f554941, 0x93f4032a, 0x83d83ae5, 0xc8866a05,
- 0xc36d1e1f, 0x95a082c5, 0xd85e6cad, 0x302bc384, 0x41fb8717, 0x61221cc8, 0xce9a44cd, 0x2884ec21,
- 0x9712152d, 0x419e4939, 0x32367b47, 0x238ee432, 0xd27f0b8e, 0xa3eaed24, 0x1eefd0a9, 0xf38a2400,
- 0x72c0d4b2, 0x8bdbdec1, 0x563a2b59, 0x0d50177b, 0xb01576ef, 0x7dd9f33e, 0x7905c120, 0x461712d6,
- 0x78265e93, 0x54a91f0b, 0xb88eb9c0, 0x9d8997af, 0xcb1d1296, 0xfa0a3a77, 0x5bb26dd9, 0xf6da78df,
- 0x53b8e80c, 0xc55cdaf6, 0x871a3971, 0x0bd8d322, 0xfa9e0a9c, 0x95949e0e, 0xe94f0edb, 0x15e06b25,
- 0x8b3e34cc, 0x980261a9, 0x3a8fe440, 0xc72330aa, 0xbff5c8b6, 0x486a08e6, 0x6b3f0668, 0x53c90761,
- 0x1dc2374b, 0xba623bb6, 0x720d9fff, 0x8454fada, 0x29f09563, 0x6512330e, 0x84370042, 0xda55c14b,
- 0xe6397b27, 0xdb03bcc7, 0xd6e27986, 0x483ad4f2, 0xe0e2c39a, 0x459e6792, 0x03c120ec, 0x13df7847,
- 0xc3ee77e1, 0xbcee7cd4, 0xdb3734ec, 0x0e19ebb2, 0x1501517a, 0x815190f7, 0xea30ba2c, 0xed58523c,
- 0x9dc64c08, 0x58d8753f, 0x1fa771c5, 0x7721fb09, 0xc64d1f60, 0xf407dc18, 0x6fdb1e33, 0x89abccb8,
- 0x2fab8715, 0xd8ee352e, 0x41bfa764, 0xda0267ee, 0x65794080, 0xe3095d65, 0x08e2148b, 0x173103b5,
- 0x55673978, 0x8d76b213, 0x6ed42e4b, 0xbe589395, 0xcf4c4d8a, 0xd331b237, 0x0af2f4cb, 0x202be7fa,
- 0x2e87bc27, 0x140a95df, 0xa0d1ef7e, 0x1031da30, 0x630f3ea6, 0x0e3b0991, 0xba7c0462, 0xca8a192c,
- 0x668417e2, 0x2c6e8ec5, 0x3f2e4372, 0x310927e9, 0xa87b5f4e, 0x21e3f285, 0x66aab4be, 0x96804f73,
- 0x097c363b, 0x76445811, 0xaf92fb77, 0x660010b7, 0x3ff5abbb, 0xdaa505d0, 0x17dc3488, 0x45dac66a,
- 0xa834d6eb, 0xacf0641f, 0x05576174, 0x28bf1858, 0x08829e92, 0xd3c5d530, 0x6acd00b2, 0xf36c0645,
- 0x4385cae7, 0x93b11f88, 0x3dfe1da7, 0x2d5df9d8, 0xd51d498f, 0x1d122b84, 0x2ca7619f, 0x670fba3a,
- 0xa59f3019, 0xd25ade01, 0x43ef2f88, 0x05cf6af4, 0x6fc3b5e0, 0x305a309e, 0xb7bce57b, 0x49c55693,
- 0xd59bd6d0, 0xdf13274c, 0xa5640917, 0xb8e88520, 0xf81fb865, 0x245967cf, 0x64420112, 0x97720fd0,
- 0x0ef913f8, 0x9fcf14f4, 0x99a86a60, 0x150ae075, 0x1b4be51e, 0x12fe7368, 0x23781feb, 0x3657b0c3,
- 0x90f84f92, 0x082f626d, 0xf057cef1, 0xf04fc2c1, 0x8767f311, 0x240ab838, 0x160564c0, 0x96f4460d,
- 0x2c7e5c83, 0xb44e6da1, 0x43f86ae1, 0xe3afdf03, 0x34173462, 0x197d8030, 0xb02d6ae7, 0x0cec076c,
- 0x0fb9d05e, 0x1fa74d99, 0x03f9636e, 0x03afa44d, 0x79ceb46c, 0x8b9e3158, 0xad87d846, 0xaf794612,
- 0xdd00ae31, 0xde8d63de, 0x229c5e66, 0x2df46e14, 0x3cbb35d1, 0x9832a55b, 0xaff3c01c, 0xaf4cc2be,
- 0x05095c2b, 0xee6be44f, 0x7b9bd378, 0x09a5f11f, 0xfddc340a, 0x010da0fa, 0x60874e63, 0x9f03a38b,
- 0xddfe1c05, 0x8dadcc16, 0x6df97114, 0xe0779adc, 0x8de82987, 0x83cca69c, 0x38b19e7c, 0xebc30d07,
- 0xb36f46cc, 0xee4d1453, 0x7522c310, 0x3a43d376, 0xab400f15, 0x4fedfa99, 0x02e7323e, 0x4c57f680,
- 0xe4190ae5, 0x6a5bba49, 0xd3c223d8, 0x1b87ab96, 0xaef4795f, 0xf457cd2d, 0x2bae8689, 0xa229c48f,
- 0x41bd5e74, 0x25cb3da8, 0xfd47e4d0, 0x0a241ffc, 0x16c0dba7, 0x6f1469fd, 0x810c16da, 0x66a7b33c,
- 0xe6c9e001, 0x9ccefde6, 0xd24f7adc, 0x1bcc8980, 0x37084252, 0xb779d5cd, 0x52e456d0, 0x313ba4de,
- 0xffb09943, 0x0e9d4e1f, 0x5a3c51ac, 0x6f055f04, 0xb2ac9a26, 0xb7fac64f, 0x27cc0c8d, 0x342bbac3
- };
-
- @Test
- public void testReference1() {
- final ISAACRandom isaacRandom = new ISAACRandom(SEED_1);
-
- final int[] actualSequence = getActualSequence(isaacRandom);
- Assert.assertArrayEquals(EXPECTED_SEQUENCE_1, actualSequence);
- }
-
- @Test
- public void testReference2() {
- final ISAACRandom isaacRandom = new ISAACRandom(SEED_2);
-
- final int[] actualSequence = getActualSequence(isaacRandom);
- Assert.assertArrayEquals(EXPECTED_SEQUENCE_2, actualSequence);
- }
-
- private int[] getActualSequence(ISAACRandom isaacRandom) {
- final int[] actualSequence = new int[1024];
- for (int i = 0; i < actualSequence.length; i++) {
- actualSequence[i] = isaacRandom.nextInt();
- }
- return actualSequence;
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source32/JDKRandomTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source32/JDKRandomTest.java
deleted file mode 100644
index 655056357..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source32/JDKRandomTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import java.util.Random;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class JDKRandomTest {
- @Test
- public void testReferenceCode() {
- final long refSeed = -1357111213L;
- final JDKRandom rng = new JDKRandom(refSeed);
- final Random jdk = new Random(refSeed);
-
- // This is a trivial test since "JDKRandom" delegates to "Random".
-
- final int numRepeats = 1000;
- for (int r = 0; r < numRepeats; r++) {
- Assert.assertEquals(r + " nextInt", jdk.nextInt(), rng.nextInt());
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source32/MersenneTwisterTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source32/MersenneTwisterTest.java
deleted file mode 100644
index e806fc709..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source32/MersenneTwisterTest.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class MersenneTwisterTest {
- @Test
- public void testMakotoNishimura() {
- final MersenneTwister rng = new MersenneTwister(new int[] { 0x123, 0x234, 0x345, 0x456 });
-
- /*
- * Data from
- * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.out
- * converted to hexadecimal.
- */
- final int[] refInt = {
- 0x3fa23623, 0x38fa935f, 0x1c72dc38, 0xf4cf2f5f, 0xfc110f5c,
- 0xc75677aa, 0xc802152f, 0xd9155da, 0x304aacd1, 0x9a73f337,
- 0x989a7a43, 0xc1483a50, 0x268c922d, 0x582fa6ba, 0xfd0cc411,
- 0x44267b5e, 0xe64aeede, 0xbffce512, 0x69b7263d, 0x43df2416,
- 0x54c06fe4, 0x4bb1636f, 0xaa772159, 0x692b9302, 0xe6f6290f,
- 0xec59faf1, 0x453050b, 0x8e18c8c2, 0x9afc3045, 0xc0f8369c,
- 0xa6784b64, 0x2b3baca5, 0x241c69b2, 0x102b153e, 0x2aa0204a,
- 0xc4937ab0, 0x4edada28, 0xfc1a4165, 0x5327669e, 0xdeaa3938,
- 0x7d45d251, 0xde57ac80, 0xafdc0e1a, 0x630eea2f, 0xac9709be,
- 0x8d4b2277, 0x3bd93aca, 0x85eff969, 0x7dd7008b, 0xc0f5f7ef,
- 0xf354dbb7, 0xd19a749, 0x9245ad51, 0xdd1bbe7b, 0x31ce56ca,
- 0x8fc36f3b, 0xa307eaa6, 0x2d16123c, 0x81a710e8, 0x6fb0ece0,
- 0xa4a8ed5d, 0xf81025ee, 0xc7bdb7cc, 0xacbd297, 0xc2e69738,
- 0x2e414667, 0x8436773b, 0xb2eb0184, 0x6f458090, 0x7f2c9350,
- 0x213f68e, 0x470b7a6d, 0xb8e983ba, 0xadd68783, 0x3c580a4a,
- 0x8239e155, 0xfdc2c299, 0xacd2d0b2, 0xe39381d6, 0xb4a5ad7e,
- 0x4c6c3bdd, 0x1908bf3a, 0x8aaa5fe5, 0xa3674b65, 0x4c2d0c3f,
- 0xdf2ba5a5, 0x1032fcf8, 0x9c8a9da2, 0x989f1b17, 0xb62684e4,
- 0xfc56810e, 0x4937dc5d, 0xd6502fba, 0x403fad7e, 0x8ecf04fa,
- 0x6e622af6, 0xb3a12932, 0x7735265b, 0xb3397c02, 0x3e92651e,
- 0x58bca8af, 0xd02046e6, 0x6394b11, 0x91ed9821, 0xb75225a3,
- 0xe6cf1b38, 0x35297ffe, 0xeaa2f3af, 0x8740f423, 0x9cf755ec,
- 0x3e71ab47, 0x9b3f3b19, 0xa17cb981, 0x745c768b, 0xc5fa06c,
- 0xa9ddfe32, 0x27fb2a2d, 0x83c11cc4, 0x1be0b4bd, 0xfadc6d9,
- 0xd4c4cf4b, 0x3e2019a7, 0xe6489797, 0x5746fcb5, 0xa468a4c8,
- 0xe1f303c8, 0x892aba04, 0xb92617d6, 0x79af91, 0xa6719544,
- 0x2123c124, 0x250f6867, 0x4ed30865, 0x32e1592c, 0x28f2364b,
- 0x56bb6094, 0x39162749, 0x6b68d894, 0x3ce35fee, 0xcfc8dc4f,
- 0x71602f12, 0xdc9ae288, 0xf8ef2ed7, 0x6b06d07a, 0x216e06f0,
- 0xdec994b2, 0xbb3a7736, 0x5c9957e9, 0xc8bca92a, 0x2a6955f6,
- 0x93876aff, 0xfac9a03, 0xefc4f05, 0xb1a05dc2, 0x6bae0207,
- 0x39c9d223, 0xd25d4245, 0xa3194800, 0xb20d013e, 0x6249fe2f,
- 0x837f9243, 0xb5af74d1, 0xda4d5e81, 0xbb17131c, 0x9e8e92bc,
- 0x631fa28c, 0x6c4862df, 0x188d56e3, 0xe7b5f3c2, 0x8be50cef,
- 0x3c846d8b, 0x47bd5cf0, 0x816608b6, 0x99263fac, 0x3082b3dd,
- 0x41e2e09e, 0x554d804b, 0xd25a3b7, 0xfcf0b24b, 0xf91f82af,
- 0x9b6ad24b, 0xb83703f9, 0x10d431ab, 0x675e6dc2, 0x52f58561,
- 0x3badef9a, 0x31592d6b, 0x70748fc3, 0xea8cd203, 0x9cdde8aa,
- 0xe8c41002, 0x696ec53, 0x91e8d6be, 0xdd90041f, 0xc4fb23f3,
- 0xdee5fd0f, 0xb65694ac, 0x38dba6c3, 0x9a6226c2, 0x4380bf2d,
- 0xe23c29cf, 0xa62df7dd, 0x3a8a7f47, 0xcef7d974, 0x3341ae98,
- 0x9fcced1f, 0x89117a75, 0x2697345b, 0xdec75a6, 0x243febfb,
- 0xdbe6ab5d, 0x6e41602c, 0x5fded1ce, 0xec854a95, 0xa0839470,
- 0xa9fc1f3c, 0xeb51cb9, 0xd58d7944, 0xc6767655, 0xf096123e,
- 0x3c60b5b2, 0x38abc388, 0xec0546a8, 0x974f331d, 0xb68e0fe,
- 0x9e7008a7, 0xc3496c73, 0xae81ba8c, 0x499065db, 0x727d51f3,
- 0xd2c437c1, 0x5b879655, 0x822f5cf7, 0xc3525dae, 0x198a3598,
- 0x8dc3afd0, 0xf1fb2ace, 0xe9470165, 0xa2d922ee, 0x3d634c3,
- 0xdfdafa3a, 0x323cb60d, 0xa8142cc2, 0x8fedaffd, 0x3c344d7e,
- 0x6da7d412, 0x8faa6de0, 0x91b26b9, 0xcfb90648, 0xf4811a08,
- 0xaa091e50, 0x3472e158, 0x6a650e2e, 0xa3cf7e2f, 0x50c01ec0,
- 0xc2c67020, 0x87402425, 0xb2e34cb9, 0xbd87d91b, 0x3563a6d3,
- 0x339cf74e, 0xffcc2cf9, 0x5537400, 0x57ae171b, 0xf5396a89,
- 0xbed9b927, 0xaaea3a07, 0x92add60c, 0xd6cec30b, 0x85729ab0,
- 0xc5326ca8, 0x7b83f953, 0xa43ff0cf, 0xe0eea920, 0x65de4954,
- 0xff454bcb, 0xa3af3b3a, 0xa8d5900a, 0x19d5c121, 0xbd4a89ac,
- 0x19084ae, 0x98130311, 0xaeba10a, 0xe80fa57c, 0x72ed83fd,
- 0x4fb367f3, 0xcc63dc6a, 0xc3372454, 0x6a37e254, 0xfe2da32c,
- 0x6fda8ee3, 0xffaf02b4, 0xc027d10e, 0x6709f3e9, 0xf27c7cfe,
- 0xaaefc51f, 0x446a04a8, 0x120d944c, 0x6723ed43, 0x72ab3b17,
- 0x465e7e94, 0x5d910b0f, 0xbd96427, 0x216d0655, 0x7d9b8ad4,
- 0xa14a22ac, 0xcd90160a, 0xdb3f890b, 0x2d37dcc3, 0x34b8c67f,
- 0x1cfd3624, 0x69ca4cc3, 0xe756cff2, 0x9d122b27, 0x46667c33,
- 0x59ee9c5c, 0xbd7b82d1, 0x5f0576e1, 0x499ef4c9, 0x1370277c,
- 0x8954bac1, 0x37da5236, 0xa02eb689, 0xbe47fedc, 0x776ea717,
- 0x6cb476ac, 0xa47b4a6a, 0x999efe, 0x5b639436, 0xf650de88,
- 0x4e8fd98, 0x191216d2, 0xceaed09b, 0x204794eb, 0xd2c25028,
- 0x87bd221d, 0xc68852c5, 0xbfaafd1e, 0xf534182b, 0xfaa3297f,
- 0x80e14a8d, 0xc204c912, 0x84449c0d, 0xb184ee7d, 0xf3f7b53,
- 0xaa6e3294, 0xb89cbf37, 0x992ad523, 0x6efb1e90, 0xad46858f,
- 0xa217c69e, 0x3b8123f6, 0x9651ad17, 0x8f4c0a9a, 0xf76fc20,
- 0x7c62f8c3, 0x6da9dc30, 0x70dd3d5d, 0x96ae2e55, 0x58c655e4,
- 0xaa853035, 0x48e81ea, 0x87002693, 0x2c667e97, 0x9a2f4d5b,
- 0x52933a95, 0x3f72a82, 0x6c6d501a, 0x713505ec, 0x7d0f9784,
- 0x6aebb0b6, 0x107a7e37, 0x15773151, 0xf90a74da, 0x2377363c,
- 0xa8de6de, 0xa6e5d5a2, 0x5dca95f2, 0x5c53d917, 0x168ec0cf,
- 0x570dfc18, 0x4288fe6b, 0xb9833a27, 0xdd1e7904, 0x315a4474,
- 0xd5631e5f, 0x7213cfd6, 0x249938a9, 0xff052817, 0x718eb33c,
- 0x2b4dec3, 0xc4964842, 0x469f5baa, 0xd941297a, 0xe9dded03,
- 0x60fac145, 0xdb37f217, 0x39cd8ee4, 0x452c33d1, 0x5abe9be8,
- 0x1af69e0d, 0x5b0bd6d7, 0x319ecd5f, 0x3bcd235c, 0x3fdbfa77,
- 0xac550eb4, 0x3a0a346c, 0xf39919d4, 0x6e1f71ee, 0xe832ed0e,
- 0x84c9d733, 0x60a2537d, 0xabbdd4b3, 0xd598dffd, 0xd13c8592,
- 0x32a03cc7, 0x336e5faf, 0x2f8e590a, 0xaaeec5d4, 0xa8295b34,
- 0xc30ce8ca, 0xee4c5501, 0xc77d054, 0x6b982f24, 0x678195,
- 0xa849138f, 0x2f3dd18e, 0xfe23a88a, 0x2e47871d, 0xe263d69f,
- 0xaa1419fe, 0xa2b0fa92, 0x3fe37d3d, 0x4f37161e, 0x4cd9b682,
- 0xc65860f6, 0x77e4edc3, 0x4c71a18, 0x36fb25b8, 0x451411f4,
- 0x635fecf1, 0x92b03a64, 0x9b7fd167, 0x171906d3, 0xc76604e6,
- 0x59257d37, 0xf444dead, 0xbc26a68d, 0xd225e427, 0xf675b085,
- 0x1aa04db0, 0x7f683b77, 0xd79d3278, 0x308425a0, 0x4504d28a,
- 0xde9ae465, 0x64275e5a, 0xbd910789, 0xd13421f7, 0x84ce54b4,
- 0x3c166b93, 0x1d040e83, 0x337c6ae7, 0xbe1630aa, 0x3e9a6e14,
- 0xe125a856, 0xffce8ca5, 0x324f5b19, 0x5050a29f, 0xa878afad,
- 0x2c6ee4b4, 0x7a891b36, 0xfdeda343, 0x8e420be9, 0xb1a90f55,
- 0x1aa82dfc, 0x7bd87288, 0x497d36dd, 0xefca266c, 0x536338b5,
- 0xbb314af9, 0x99c64a66, 0xe230edff, 0x35b07a32, 0xac172bc3,
- 0x66890dcd, 0xc8b7e513, 0x9f14818d, 0x38f45e55, 0xe39d2420,
- 0x41e7b802, 0xe7d097d7, 0x87bde5db, 0xa3b40719, 0x6903a4f1,
- 0x8fe17270, 0xa00bc9ad, 0xfcbd3397, 0x458ad6f3, 0xfb3f1663,
- 0xb7b4fe23, 0xec0fda7a, 0x6324016b, 0x7c6c5059, 0xf81c1522,
- 0x957286ba, 0x5e27c862, 0x2dbb10a2, 0x39db5731, 0x1d567daa,
- 0x55ee48f2, 0x4e5e0742, 0xc27142ca, 0xcbacae9e, 0x5d1a105a,
- 0xb37e6bbc, 0x4457de32, 0xc2731190, 0x51f2e26b, 0x616f5ec8,
- 0x4c524088, 0x84eb772e, 0x18fe5f9c, 0xc27be658, 0x25f0b8e,
- 0x61d91e60, 0x65599112, 0x839a9784, 0x9942f04b, 0x907c8596,
- 0x2e824b62, 0xa1d696d8, 0xca1de87f, 0x9b97e72, 0x89a8b34e,
- 0x6edda0f8, 0x21202673, 0x10b55868, 0x5fa7c76b, 0xa1b56faf,
- 0x670e4131, 0xd8f5502e, 0x25233991, 0xe43445a3, 0xfed6a20a,
- 0xd19733f7, 0x8bb5db5b, 0x90e132fc, 0x25e17e90, 0xe697ac65,
- 0x302fda43, 0xb7064f65, 0xff3caaf3, 0x7cc369c7, 0x789d0230,
- 0x5d7fe246, 0xcbfd430c, 0xf66fcdee, 0xb3d37457, 0xc24547aa,
- 0xac23da09, 0xbddb1df4, 0xfdd7d1fb, 0x4b8987b3, 0x3cf260e1,
- 0x30a24d85, 0x375fb86c, 0xb287e74a, 0xc8f1b360, 0xd70e2779,
- 0x784fa37b, 0x7477485, 0xa787685e, 0x541fbaf2, 0x49d05a21,
- 0x46bcecac, 0xbc1c4443, 0x85b0917e, 0x693c3ac2, 0x10a30d08,
- 0xff192733, 0x61d88012, 0xe2474eaf, 0xcbb899, 0x62b8b3a,
- 0x5ff1fcdb, 0x20dde01f, 0x94a3ef59, 0x4e75b597, 0xea677d68,
- 0xf9b9c06b, 0x1b9ee46c, 0xaf1a479a, 0x6e9a7611, 0x9c9284f6,
- 0x348a296, 0xe3e3b5ab, 0x2ce8b80a, 0xf11a7efc, 0x4bf1a59c,
- 0x4301a8f0, 0x57c6a80, 0x7ebd7550, 0x1963d609, 0x17064918,
- 0x9a5e486f, 0x767ada6e, 0xf379835d, 0x817d0eed, 0xc8a9fc9f,
- 0xd6c0e87d, 0x8dc9a94f, 0xacf56951, 0xdd8bd5ee, 0xdd248898,
- 0x9e286bc3, 0xced01226, 0xb88ffe3c, 0xea662cad, 0x9ab07c59,
- 0x13032ac1, 0xbb873d74, 0x32e0776e, 0x89b5f90, 0xe09d5b09,
- 0x2ea60da1, 0x80cfe80b, 0x21fa1ce2, 0x706dc2f1, 0xd96e10,
- 0x84f75f04, 0x5fa97783, 0xea2b6877, 0xe9c417ed, 0x807f00ac,
- 0x802442e, 0x19a90570, 0x72ae16ca, 0x107e4fa1, 0xbb6135e,
- 0xd775a370, 0x5ff6f941, 0x6a707d8a, 0x32be82f8, 0xe02e92e3,
- 0xadf9e5ba, 0xc88902f1, 0xb38bd032, 0xdeae3543, 0x9d8b53e4,
- 0xe138fc67, 0x4565a728, 0xc45115d, 0xab6dfd67, 0xd0d19d8a,
- 0xb77c9c49, 0xcef31821, 0x683e0485, 0xa35e3a23, 0x12d6a276,
- 0x62f81a9c, 0xa10fe92, 0x38fb7c97, 0xed7c6de5, 0x21c46edb,
- 0x3babb813, 0x488587af, 0xaff84a55, 0xe48cce39, 0xe5098cad,
- 0x9310cf58, 0xece52930, 0xc21bcc91, 0x540108c4, 0x4f44bcdb,
- 0x898a9365, 0xba470a57, 0xd7f15ff8, 0xe473ab14, 0xe76833ff,
- 0x89997b1b, 0x9e7f7c54, 0x5673fcd9, 0xd289f943, 0xbdeb72e2,
- 0x490d3961, 0x4302a415, 0xa7aa0c1, 0xb35bde2f, 0xa6b2690f,
- 0xd9acf25b, 0x9950b7e, 0x71621b83, 0x653f519c, 0x43a66e3d,
- 0x1da1d26a, 0xc4db0a37, 0xf1d8513e, 0xd6c9840b, 0xf39e866b,
- 0x197fe72c, 0x11196229, 0x311007b0, 0x61028494, 0xdf40c6a7,
- 0x9a54746c, 0xfa75ce2e, 0x3bf7309, 0xc33d7966, 0xeda6af60,
- 0xa6672387, 0x72411b87, 0x9a211f11, 0x51f56dc7, 0x53a684e0,
- 0x397541a, 0xe33486f2, 0xb4186699, 0x9bbf1cb2, 0x1f86e0f1,
- 0xa459fea9, 0xc729c354, 0x9c466f44, 0x10479afe, 0xef53e2d2,
- 0xb8769c4a, 0x60a7fa28, 0x8b551da9, 0x6b17bf70, 0x4b0a4a73,
- 0xfcd67534, 0x7f77d788, 0xb422f68f, 0xf8ccf23c, 0x1ad3e613,
- 0xc33054e4, 0x24c8f64a, 0xa135d8b9, 0x5799da51, 0x4ff771cb,
- 0x15430a3f, 0x46db7ec8, 0x87d4c88f, 0x694bb4c8, 0xa6a5ff3b,
- 0x37255c0, 0xac77403c, 0x49a7a6d5, 0x61326bcb, 0xea1febca,
- 0x19905ce4, 0x6c208616, 0x88601b2b, 0xf5ecddc0, 0xec8475d1,
- 0xd3853b52, 0x3d21610b, 0x53b3a29c, 0x77575565, 0x5825b57,
- 0x89ebfb88, 0x8f3c2f00, 0xb32ead1a, 0xd44f8744, 0x63a692b2,
- 0x69697bae, 0x6b7fe1c9, 0x325b5bf1, 0xb32e0e11, 0x54187523,
- 0x4501dc49, 0x7eb3aed1, 0x6ab0eb88, 0x6b3e94bf, 0x2c2d293b,
- 0x8f668ba5, 0x2db81bb2, 0x9e43c4ae, 0xda5b5b13, 0x81763a88,
- 0x95b90733, 0x642b0bca, 0xdd1dd3a, 0x44d79c88, 0x95e327f,
- 0x56abfd80, 0xd0f75ce3, 0x730607c6, 0x89a6fd0e, 0x7fc09cd8,
- 0xb078f466, 0x184ba518, 0xaf1ff8e1, 0x99e25f5f, 0x201e00a3,
- 0x8ba1ae03, 0x19a9942b, 0x2c1e6198, 0x737f2878, 0xc59a2b1c,
- 0x7c4f8850, 0xf0409a77, 0x2da9101d, 0xd1aaf46f, 0x291c51af,
- 0x4d234c8a, 0x68810c4a, 0xfa7e9b84, 0x75b5dcb8, 0x1fe8b9f,
- 0xd4acb1ef, 0xbb6ff83b, 0x64805089, 0xf6763925, 0xb327edc3,
- 0xd688dbca, 0x196cf19e, 0x2cf2b856, 0xda34c994, 0x7518948f,
- 0x3170a8d1, 0x30f86e08, 0x681c6bac, 0x3bfddb0c, 0x5f168b17,
- 0x4ae631b1, 0x3d105d00, 0x7116b018, 0xad06c9a1, 0x293be0e9,
- 0x3dd73c5b, 0xbd5a98e8, 0x75536a9f, 0x818d1508, 0x40e9aa2e,
- 0x68367be3, 0xaf51e5f2, 0x39b8ccc2, 0x6c67fb45, 0xb13771e2,
- 0xe706549e, 0x42b7fc98, 0xedbd44eb, 0x622d9985, 0x85107f0a,
- 0xcfc9061b, 0xd9e6d66b, 0xe011bb5e, 0x327eb11e, 0x407ecdd9,
- 0x3afad29e, 0xab283ffb, 0xbe83d61e, 0xea3e7a46, 0x273b2541,
- 0xda729e01, 0x81a62472, 0x8359eedb, 0xa4457261, 0x926ad13f,
- 0xe7e0c4fe, 0x4d1da2d8, 0xa8b3aed0, 0xb658ec23, 0xf7e24a58,
- 0x5d154e58, 0x9a2bf0ba, 0x2eb455b0, 0x50cb61f3, 0x1e095a2,
- 0xe1de399f, 0xc71cbd35, 0x7cb90a7e, 0x356e4628, 0x280991f0,
- 0xd26e64a1, 0xd6c9df5a, 0x3ef127a4, 0xcd2d747b, 0x595f8ee8,
- 0xba946959, 0xd8ee7838, 0x10f24d0, 0x86b0eaec, 0x1d078587,
- 0xfbf516ea, 0xdc2a79f8, 0x7015e404, 0xe9efdc2c, 0x16bca751,
- 0xef7b9df7, 0x9227157f, 0xa31e6f81, 0x83b7e291, 0x7ee5c10b,
- 0x1a196d7c, 0x23829142, 0x263fe2c2, 0x618461ac, 0xe8681ba5,
- 0x258b3130, 0xd60cf96a, 0x14fadac6, 0x9d48a438, 0x8bfa6a79,
- 0x8b920d34, 0x7e98a7fc, 0x88cc57d, 0x5af407f0, 0x15bc4713,
- 0x23b64b00, 0x37f96d03, 0x5ac72f49, 0x65a9a89, 0x16724cac,
- 0x503ea2fc, 0x4d548e23, 0x2d92d724, 0xdefe753f, 0x37a36c6a,
- 0x70708d68, 0xbfe7aba8, 0x1f510c48, 0xb3a995e3, 0x1342df6d,
- 0x7986ddb9, 0xf4630113, 0xa9f9b81d, 0xb1dca7ae, 0x70915ce7,
- 0x780e2c35, 0xd1859a18, 0xf92e7d5a, 0xce573f6b, 0x9d79a6e9,
- 0xbd7f3425, 0xacfd81c7, 0x8429a008, 0xf0da82bb, 0x6a5fb409,
- 0xc567b073, 0x5371eda, 0xa417042a, 0x9d162579, 0xa8c0eb06,
- 0xdb7a6342, 0xae0c5575, 0xe0e256a8, 0xa7de78a0, 0x12797538,
- 0x8e154606, 0x93b23bf, 0x16f4562d, 0x47067058, 0x6db6dc93,
- 0x33fc94d2, 0xae60549d, 0x4e1b4fcb, 0x7d4aff37, 0x59b050d1,
- 0xd50b787e, 0x4700ba54, 0xc6848ba2, 0xbd8f6801, 0xd2f62909,
- 0x289cde1e, 0xc5003778, 0xd973a07d, 0x38a099d8, 0xf8bedbdd,
- 0x68e9601d, 0x1e86cf6d, 0x2899e89c, 0x229ab04a, 0x45b7a393,
- 0xef508cd2, 0xa03448ed, 0x29b47253, 0x9f5a48ac, 0x43c89eec,
- 0x75dfc10, 0x1c2c3184, 0x3ecca1e3, 0x3c5cc91e, 0xcf7cd58b,
- 0xe014d295, 0xed503a24, 0xe452210e, 0x6fe3ac6f, 0xd99dca00,
- 0x3ae4ac67, 0xd189afe0, 0xf3ba5df0, 0x84a10e38, 0x4a7b85e4,
- 0x9d8b4bf7, 0xe83b5b67, 0x90106e3d, 0x534fbf99, 0xce3bcd2e,
- };
-
- for (int i = 0; i < refInt.length; ++i) {
- final int r = rng.nextInt();
- Assert.assertEquals(refInt[i], r);
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well1024aTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source32/Well1024aTest.java
deleted file mode 100644
index 68a191f41..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well1024aTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class Well1024aTest {
- @Test
- public void testReferenceCode() {
- final Well1024a rng = new Well1024a(new int[] {
- 740849862, 1202665156, -199039369, -259008301, -291878969, -1164428990, -1565918811, 491009864,
- -1883086670, 1383450241, 1244617256, 689006653, -1576746370, -1307940314, 1421489086, 1742094000,
- -595495729, 1047766204, 1875773301, -1637793284, 1379017098, 262792705, 191880010, -251000180,
- -1753047622, -972355720, 90626881, 1644693418, 1503365577, 439653419, 1806361562, 1268823869
- });
-
- final int[] refInt = {
- -1478749726, -1645579484, -2075363835, -2063444174, -1834148336, -1769045872, -40711346, 1717441026,
- 2130656771, 783441285, 570433609, 1560023451, 653233971, 1368672434, -72036215, 1071111800,
- 933776492, 26114960, 49888778, 1808107515, 1092989296, 754848337, 1336994364, -1987450448,
- -691190146, -1803870839, 1110716866, 1173269113, -391000050, 2014216908, 180756301, -382891013,
- -1908154585, 1580737629, 1080267957, -125532248, 2094530239, 2132964485, -438596348, -760299445,
- 1058181869, 2050816800, -1534429037, -62552782, 824524142, -818590371, -1857695907, -684762866,
- -156556543, -902759995, -880795194, -1387351132, -1263017515, 448006597, 201038266, 1929826313,
- -455367306, 672963027, 2000073013, -1546842042, 446341090, 1001696686, -779919012, -347722602,
- -1342821677, 1639571150, -835315755, 1505585376, 367004975, -2035864404, -1786623553, 1249724913,
- 182435312, 1444514513, 1815333708, 1333772382, 299664001, -284691169, 2034403374, 1423310887,
- -1319051884, 1557286441, -445198266, -251809030, 1602786123, 944036382, -1020529634, 258344235,
- 685254367, 1838964943, -156674528, -979736602, -538312836, 234643178, 211152102, -635498640,
- -1036733933, -1347589147, -565609042, -1358714165, 508618483, -786364693, 2071450261, 1206956772,
- -678931458, 167690617, 144698821, 1719720781, 1575869280, -1343221123, -1766469944, 284991647,
- -717305514, 892653651, -1368347075, -615701972, -730369849, 1360396003, -1869287623, 1778269052,
- -586061545, -699517114, 61530249, -1860611767, -519660852, 1841085925, 1555610093, -399979337,
- -790345742, 422355947, 2007965433, 2044952550, -1712164595, -102915702, -693865324, -1894042487,
- -1285020072, -215883074, 95833252, 1625818040, -1055951680, 513067085, 1825246558, -553461652,
- -1923361799, -1869480206, 567232636, -1751727150, -1832301399, -108136455, -1312244126, 14006795,
- 850221366, -382389732, -1741556188, -1317464467, 1948314870, 753994471, 1028235947, 342494132,
- -1862256693, 723808794, -234257642, 1609928369, -802733456, 1315831915, 1436072885, 1224767136,
- 2144557791, -1839965886, 224821018, -1461697757, -1080386760, 1638573498, -1188173812, -325181523,
- -1750676219, -1780415850, 698793362, -908352052, 299746482, -161660934, 1938166833, 800297005,
- 56640033, -1214932666, -1248124842, 1822796868, 1777615881, -718517774, 1908159957, 1733053281,
- 1851844331, 1283519375, -1771494956, 2060179999, 1666129209, 1919453531, -498145770, 697567008,
- 1855487148, -1587163491, 565216434, -1477877933, -925662919, -806492585, -1201439047, -1424534232,
- 1788616523, 69414717, 655893636, -1175978556, 24787512, -861550001, 439525754, -190433174,
- -383811606, -508589783, 1441608687, 608181366, 1539467064, 925903122, 697209654, 1878283393,
- -1967567432, -1659677763, -249658183, 847096354, 397741956, -125334541, -1286840731, 1016461908,
- -997968592, 1795331475, 1856856501, -1716726445, -582181331, -887091847, 426964855, -609219941,
- -1456232632, -483467616, 1069260754, 972242064, -1406786247, 1954194029, 52627891, 1212755081,
- 2117436668, 281073392, 741537353, -483063506, 1850906286, -244876135, -270818140, 1817568823
- };
-
- for (int i = 0; i < refInt.length; ++i) {
- Assert.assertEquals(refInt[i], rng.nextInt());
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well19937aTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source32/Well19937aTest.java
deleted file mode 100644
index c86af888e..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well19937aTest.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class Well19937aTest {
- @Test
- public void testReferenceCode() {
- final int[] base = {
- 740849862, 1202665156, -199039369, -259008301, -291878969, -1164428990, -1565918811, 491009864,
- -1883086670, 1383450241, 1244617256, 689006653, -1576746370, -1307940314, 1421489086, 1742094000,
- -595495729, 1047766204, 1875773301, -1637793284, 1379017098, 262792705, 191880010, -251000180,
- -1753047622, -972355720, 90626881, 1644693418, 1503365577, 439653419, 1806361562, 1268823869
- };
- final int[] init = new int[624];
- for (int i = 0; i < init.length; ++i) {
- init[i] = base[i % base.length] + i;
- }
-
- final Well19937a rng = new Well19937a(init);
-
- final int[] refInt = {
- -612874471, -354976292, -1838197125, -1781560577, 278390997, 1214938280, -1752615390, -760835246, -1712883765, -241205782, -145390202, 495649160, -514388259, -1271015916, -1640000013, 849273623,
- -549729394, -1206917255, -545909692, 811925434, -1665729633, -1525292882, 1416246482, -153220826, 1148868872, -326143196, 1724979062, 1790931148, -1648679618, -439051683, 112482777, -1484051520,
- -1881272572, -1270447031, -1216102401, 1579107248, -1224395621, 2144411988, -416216641, -1529222361, 1628987080, 164445245, 1506928916, 928145916, 1436000427, 862025970, 560077705, -1887251027,
- -514360858, 1735094506, 475624879, 1755802355, 295448361, -155399225, 3972415, 1368201076, -465126094, -1622687259, -246099304, 1798631152, -1937269102, -1700560396, -293352622, -896632303,
- -2088933220, -194382452, -480218162, -1618517785, -1925031481, -150217434, 1678937261, 2130832364, -485546678, -1499224981, 1430390884, -1895417302, 210514746, 1781140999, -1940853105, -1238099647,
- 485922557, -103223212, 633481679, -632946979, 695235541, -1661735272, 277603567, -958341538, 256982285, 1850270018, -327388076, -219053874, 1380560653, -1221689980, 1335863752, -545032383,
- -575291735, -1295623907, -140058298, 1063302709, -1290702617, -790401546, -170630961, -1203114473, 1458063108, -1212753301, 1546428514, 2112636413, -1463028928, -1812598032, -883529486, 1131084094,
- 62042165, 2135819802, -1192342739, 98361522, -1341042205, -475283063, -1632033747, 1745196892, 168608689, -914987039, 274428907, -881357258, 167940012, -1975737532, -903960486, -1370984244,
- -589352935, 1783633514, -570111010, 71495377, 194463285, -1243905021, -1398490898, 221691209, -55728834, -638916786, -770622372, -1911651810, -295233027, 301467998, 2058638784, 681490183,
- -1547865078, -1668135684, 1299261826, 1649468635, 287995017, -2076844852, 1193468826, -853948258, 120082777, 1051829542, -1288514343, -159456430, 275748820, -480127107, -604943233, -2138088332,
- 1202614819, 1427201263, -1906344469, -1230779533, 1690367192, 733159097, 794410312, -1114452505, -1601554413, 976747949, 1517787154, 2091780205, 1052078906, 1919282771, -191013374, 1805397142,
- 736939268, -1056272823, -727464316, -659459005, 797803875, -1104633884, 1042342081, -24514837, 1919469940, 1903722546, -814157872, 1605407665, -262351256, -288949635, 729204844, -1132605534,
- 745453338, 387915035, 1094173337, 2100279147, 156863702, -257377544, -719587984, -1496015613, 1908993744, 2016957554, 918749666, -135963651, -1356808639, -1711185741, 1472589240, -398100149,
- 628791415, -1381837652, -1820702771, -593586943, -1456631279, -1837975351, -1394249972, -556916726, 833231177, 43449750, 1029237092, -2086437337, -459463076, -533031784, -1739648287, -1374722961,
- 2024908394, 1389678488, 2018558, -1391707864, -795935743, 904816957, 836583280, 1766194531, -1374431014, -904437876, 2030248636, -265724199, 2056758426, -810499837, 887193593, -77811488,
- 1496312336, -1874348275, -456193866, -2137130942, 868120387, 29025455, -1999867716, 2001322335, -579152815, -390892056, 1592011837, -306394879, 93636886, -190879994, 1923358153, 269052141,
- -396050253, -987531729, 480350991, 1276744541, -1445571957, -957571005, -2046270221, -1715395752, 1113585628, -1782113514, -697560146, 835320000, 1014320959, -2119834109, 460056841, -1464772991,
- -1282790418, -2120806165, 86176097, -731086307, 832497517, -1876684928, 541008240, 551124479, -450919132, 647860281, -2115397586, 979247589, 1095559204, 1927958688, 169497703, 1999579054,
- 2019745038, 1656022059, -1109662138, 375237154, 1450814436, 919988416, 849761266, 1457057327, 1771166577, -1639880487, -852488298, 1767063646, 657295386, -585561879, 740792583, 1664558308,
- -654749506, 1109275990, 182597559, 1106789745, -1806628480, 25948116, 1748374299, 196057325, -164213209, 1687024594, 782029276, 1879737947, -1528219611, 412585737, 1190325629, 1985821911,
- -1272945202, -1238637137, 465818730, -1537670961, 1131953615, 905623579, 609183424, 1138422991, 1522974699, 589719061, -1310894604, 890952933, -885204790, -393535694, 1238408670, 1780660354,
- 677803525, -1121509064, 1553148616, 1109165936, -1450120385, 1525252521, -1354897489, -595402189, -1274551767, -869281409, 1788815975, 2020262116, 1124100185, -400839020, 310574108, 1354413045,
- -1310514485, 1895732085, 626639054, 1667355357, 2065637178, -1889009143, -440157749, 1762849463, -1693853642, -56602956, -930874188, -398470740, 778356402, -2113156881, 42854964, 1844399604,
- -2098310302, -1812029757, 1441188713, 899579267, 1266994172, 1841370863, -660740252, -43254718, 1124500192, 1884907320, 879997211, 1775139845, -1360112721, 1630490057, 362567879, 1113475029,
- 290319279, -1209506867, 398146039, -957742350, 1185761854, 1519676447, -912689915, -1117128973, -305563462, -1928033363, -1766324543, 1702753492, 1696951912, -1895072395, 932663591, -566548128,
- 991675996, 56529814, 980735023, 718166662, -650028466, -886842051, 1857048587, -569023569, -1820572202, -851452711, -958700452, -621825633, -65649888, -510143183, 761267599, -1692108035,
- 1729071710, 1623630864, -53498654, 267235687, 659201413, 1152882627, -824194574, 356636960, -502391121, -538453360, 66115376, -1633290370, -1522088932, 268949070, 684499443, -859474501,
- 1586764345, -1515639709, 319695602, -307025150, 69076508, 1050726785, -1340930110, 552191600, -207852941, -273572993, -539580440, 710343120, 1957076127, -1107172811, -561518280, -1775022699,
- 1978792904, 1935531451, -2084046304, -419742902, -737652926, 614022023, 1676952428, 769892939, -1092786807, -1117113223, -266029995, -350150999, 207738542, 1964896575, 48805284, 1736500159,
- 551289617, -1847923501, 1856609505, 2007480480, -681860219, -1198106493, 1483591043, -523895316, -1814473078, -1521087404, -1348859926, 1298056897, 1813789478, 946683654, 79196400, 1766250931,
- 472737685, 1764634332, -1844726079, -130619045, -508713868, -1762537125, 1010108863, 170107098, 1705386380, -1139681802, 183739097, 1662699401, 1842694501, 1714633805, 46208876, 616720693,
- -252553427, 1986302230, -103130254, 1943225981, 110746655, 553260552, 1588938073, -1934623163, -2144781332, -2086217416, 1941265852, -781953226, 1216234254, 605543697, -710872598, 2048636577,
- -1986927728, -1007017623, 1243051501, -614249563, -2128221291, 581579813, 1173464240, -1906830937, 261329601, -1805974103, 769823490, 1858731164, -561762071, 516417430, -1221329437, -825500715,
- 1091364656, -993658663, -1475434188, -1070804384, -1876492082, 899494424, 683486936, 878807455, 56642807, -1268202879, 1379172046, -1386869373, -1158233876, 1759190552, 1597629789, 1411151497,
- -1254268471, 1075936979, -918778269, -2132675184, 953140888, 1906982077, 1154200766, -365384600, -1142488826, 708535121, -2134869964, -1531201665, -2100526761, 1268256467, 2071480803, 193135243,
- 1374158182, 989505347, -933612202, -2134839213, -1302795271, -2092029041, 1812014826, 2090855917, 2005348528, 606434393, -60141386, 11156360, 539516285, -122485034, -893237911, -978127424,
- 1509901816, -451029719, 428544700, -1622965963, -1993611605, -1989324583, 1104111587, -795138585, -899552401, -2110167769, -234502445, 1586963605, -503778455, 529261062, 325327284, -106186403,
- 65369563, -1475700698, -228624261, 715975009, 1099352363, -1796883396, 1376542700, -308942420, -344940451, -395389249, -1562737166, 1869802677, 1273494710, 2075587668, -789570273, 1563347596,
- 1142901755, 1676422422, -1729157809, -1399423717, -1814262429, -1809707284, 1393992342, -570246212, 1065528749, -781643849, 1218667301, -1097949471, 1305629790, 901301039, -704762030, 360582612,
- 1411910672, 1848068741, -614500891, -146889637, -913903597, 723527277, -147033328, -199273155, 734997691, -2072735286, 2129258691, -1385074104, 931616624, 1065477319, -1543474555, -531410292,
- -2123119121, -1538464113, -1153585193, 1559931968, -654877011, 879865200, 1489681397, 1998864644, -1964160144, 163671782, -858364148, -323324233, 801208648, 705864113, 436184243, 643773864,
- 2087594507, 134637265, -749956494, -1657343972, -1828172168, -27357303, -1145161336, -1192513644, 216148260, 611393153, -13752671, -358631090, -1211920749, 593572064, 657629904, -1445961088,
- -250704995, 1797542707, -2122311891, -316774825, -296303057, -868002056, -86697533, 2020588145, 1203427903, -1371839056, 669531557, -2031033836, 1323994690, 13703036, 785437772, -1465821554,
- -694756014, -2131068154, -1745448876, -1095891733, 936594025, -1119068454, 855423970, 1705079340, -905640608, 162297141, 1336619311, -344353769, -92608588, -1080573824, 2002293105, -2088030765,
- -1684198727, -129054718, -949437132, -127983221, -216664110, 1700146143, -711174649, 1500113839, 1212236226, -2017364219, -1263597675, 511929344, -323998524, -2021313185, 1803000924, 927670608,
- 336267187, 1244256964, -1665390108, 991395134, -251232188, 1267445783, 1547951569, 740269916, 1776431169, 1687220659, 228229817, 271386089, -682906779, -438090344, 1190436796, -744272540,
- 1879221151, 1145200306, -1730983338, -1119209309, 90826726, 1567861540, 1638852830, -1645384932, 1566909531, 1088584561, 1030555565, -1872052014, 720320695, -885053674, -321216789, 739907579,
- 368580703, -443635520, 1232705619, -1355949988, -1047211249, -1571429448, 599299852, 1036970439, 1513838571, -51797291, -26647565, -1262878942, -916262582, 1579082269, -292007383, 1289013866,
- -1612184284, 1451738668, 448608569, 476432992, -1229609565, 786372409, 929928149, -150100614, 448155944, -1322320576, -856549627, 1057443268, -1536809554, 577508258, 584906122, 275295163,
- -604262071, -236043234, -1866434954, -2072447013, 646132876, 847562546, -310005953, -1104162658, 393261203, -730102354, 440824482, 1654535035, -1296359745, 1487359328, -977776604, -775827779,
- -1298695106, 519080622, 1697162240, 227873031, -371123123, 1273702312, -1710063656, -2138342344, 1139555478, 1531578907, -1498880699, 1183507362, 1875307493, -1649740413, 2135386504, -962458407,
- 424161768, 504272962, 202204247, 1783466420, 2015579232, -676642965, 2067456450, 914480415, -620398841, 1880405399, 1406637142, 1951104977, 633496157, 224861869, -58659291, 994942775,
- -479000645, 1421449115, 100168104, 249754169, -1219011494, 1736303638, 364013694, -1750035055, -479217141, 1652913106, -2109452331, 1633842910, -1547663337, 936627493, -1152799743, 896955899,
- -1407742850, -523769014, 357161414, 872293304, 744895980, 720829676, -240843156, -111779524, 1292836315, -1792141538, 1946959925, 1181751089, -1120674052, 1185192575, -1387002557, 1973209255,
- -120887476, -766577735, -443913073, 786620227, 428564781, -101232106, -425959852, 198082021, 1173272226, -1744840378, -1621135606, -1539498583, -1101274572, 43399711, -1256764602, 1201920787,
- 2049426139, 846545551, -2121520873, -1202939675, -470425740, 321987390, 1862019060, -951540342, -894238318, -430407175, -1662746491, 656574776, 1580373777, -431290218, 1645824323, -1953526979,
- -374682356, 474291752, 1071558425, 511038981, -760598678, -567797285, -1176476266, -268409005, -2130644484, -67970563, 1756046948, 1429860462, -1130984739, -124916495, -1544436836, -1863524031,
- 1024916487, -1388636482, -1573205065, 892628956, 1831270021, 1176430590, 1158914682, -2006787098, -1228130033, 1516111488, -1499151347, 470546266, 1642603981, 1425140838, -1823071475, -1775267236,
- -1009380612, 164746986, 1129677098, 1842642579, -482342932, -507480364, 1656012309, 1981601761, -881042120, -511987083, 342447017, 381192578, 983008095, 741012865, -1877136350, -199211983,
- -452784912, 1929572576, -1678291139, -864375281, -1610561247, -1936356726, -749553767, -865893512, -567081879, -1303973729, -939636958, -622974563, 428284937, 1049237414, 852280765, 86648946,
- -1353851401, -1045422335, 898035731, -1636093996, -1083174191, 245046915, -359768226, -1028491655, 1051575118, 1774289451, 1839389415, -1594053468, 736707953, 1873556950, 401186168, -583669552,
- -88375334, 2002752071, 264506453, -1304812107, -759203942, -114958524, -1878903503, 841613720, 1910863820, -1738114003, 701455920, 1791058048, -1850960547, 1672292671, 1172188809, 604848896,
- -1607489375, 305370478, -948153885, -1971080100, -1848966954, -584538365, 39416319, -1689119162, 944942598, 1777111075, 1534005553, 2022718432, -25820385, 3077695, -315950520, 1859184648,
- -1397829266, -1666371809, 858913807, -610818620, 1554973298, 580023809, -1662988256, -408630026, 1316681876, 738204271, 942829881, -758486983, 780345857, 667165037, -2086803585, 789741324
- };
-
- for (int i = 0; i < refInt.length; ++i) {
- Assert.assertEquals(refInt[i], rng.nextInt());
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well19937cTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source32/Well19937cTest.java
deleted file mode 100644
index ebbf61737..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well19937cTest.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class Well19937cTest {
- @Test
- public void testReferenceCode() {
- final int[] base = {
- 740849862, 1202665156, -199039369, -259008301, -291878969, -1164428990, -1565918811, 491009864,
- -1883086670, 1383450241, 1244617256, 689006653, -1576746370, -1307940314, 1421489086, 1742094000,
- -595495729, 1047766204, 1875773301, -1637793284, 1379017098, 262792705, 191880010, -251000180,
- -1753047622, -972355720, 90626881, 1644693418, 1503365577, 439653419, 1806361562, 1268823869
- };
- final int[] init = new int[624];
- for (int i = 0; i < init.length; ++i) {
- init[i] = base[i % base.length] + i;
- }
-
- final Well19937c rng = new Well19937c(init);
-
- final int[] refInt = {
- 2128528153, 327121884, 935445371, -83026433, -1041143083, 2084595880, -1073535198, -1678863790, -523636021, -1514837782, -736786810, 1527711112, -1051227939, 978703380, 410322163, 1727815703,
- -648426354, 636056441, 1954420292, 17754810, -958628705, -1091307602, 1793078738, -1680336346, 1792171272, 941973796, -2066152330, -1248758068, -1061211586, 262020189, 1276960217, -233886784,
- 1767509252, -1811939255, -406116097, -742435920, -1349799525, 240329556, -332161345, 1488943143, -332244280, 2093328957, 674753300, -1930135556, 257111467, 63793650, -1964335223, 1315849133,
- -797349146, 1372022250, -1451892049, -1325138957, -870401239, -1294317369, 91490879, 386205044, -704074702, -1230679067, 1513674392, -262996240, 1196007314, 1398903796, 803719762, -1750926831,
- -1268814180, 1233515404, 1498313934, -970591257, 611113671, -261632474, 1834097325, 1709440492, -150396854, 2120561003, -62645660, 479080234, 1535125050, 1823378695, -1129289329, -1095198399,
- 2092564733, 78836308, -692015409, 1647147229, -1847922219, 1838279320, -848333841, -1375151778, 920238861, 1512628290, -749439404, 288851918, -427218675, 679640964, 425700808, -2077624511,
- -1929434455, -647176419, 650437190, -1926749131, -1564744729, 734494454, 108193743, 246246679, 810042628, 1952337771, 1089253730, -1874275331, 1428419392, -492969232, 1945270770, -201265602,
- -755490251, -624426214, -699605715, -113446478, 809091299, -1521531511, 1136505389, -523660964, 132928433, 1926559713, -1485314325, -508322506, 46307756, -1627479740, -589386406, -1855555892,
- 584299545, 1272841066, -597242658, 925134545, 1102566453, -753335037, -9523218, -1778632375, 568963646, 764338254, 1259944540, -2000124642, 1307414525, -151384482, 807294400, 1993749511,
- -15503094, -709471492, 2104830082, 1387684315, -1929056119, 224254668, -733550950, -889466978, -1987783335, -437144026, 995905753, -1021386158, -1096313388, -1014152835, -1303258241, 1201884788,
- -1845042397, 1421462511, 980805867, 2143771251, 481226968, 1790544569, 328448328, 1995857639, -66668269, -1411421267, -222586606, 866950765, -308713926, -1048350893, 993222402, -1139265642,
- -871837948, 1145571913, 381928580, 35386691, 1640961123, -1192981020, 775971009, 594246635, 1603197812, -575106766, 2023682000, -1636301903, -718093720, -1666421635, -2146115988, 320593570,
- 287355418, 454400027, 1112753817, 1751196267, 782077910, -1478447368, -1007557264, -862315517, -2035355952, 2123515250, -557641502, -1789932035, 879640129, 44167603, 791148984, 1382939723,
- -2135684233, 1825489580, 937345485, -1839983359, -1536880111, -1472578359, 1548052748, -1471535862, -14508727, 1509621398, -2134967452, -787485401, 815341660, -327905128, 1028096737, 866906991,
- -1585990806, 859229080, 234806270, 998518056, -1897890815, -900923587, 1179856752, 1529572451, 620486106, 1119836556, 1661285564, 2097404633, -1437490790, 265306115, -984880135, 1326751968,
- 1280043536, 680210701, 155786166, 1550973250, -325781949, -597789777, -1939780, 1345275487, 1930450001, 941449704, 669301309, 693651713, -990721514, 582968326, 976132553, -1892942099,
- -1065070157, -711990993, -688974833, -1026091683, 1115346827, -1305730749, -1733626381, -364566696, -21761572, -37152746, -262011730, 1302722752, -1806313409, -767072509, 764112137, 1671157377,
- 1837645038, -1021606421, -1781898911, -232127459, -310742675, -1818095744, -1128320656, -705565953, -354445532, -523172807, -433877202, 131904485, -64292316, 381829280, 229820263, 1797992622,
- 1359665678, 978481451, -885267130, -1415988446, -356533788, -961419072, 1938703090, 708344111, 679299953, 744615129, 1328811158, 1257588574, 569216282, -753296151, -1519838713, 2016884452,
- 1062684606, 1561736790, 2028643511, -1353001615, 886376832, 1466953172, 1664783899, 1290079981, -57483993, -1176112430, 1634916316, 1976304475, 1374136869, -648738039, 1058175869, -909000745,
- -1526439218, 726626991, 2066596202, 64980943, -26166577, -885900005, -1821546816, -1103727665, 730606315, -1324948459, -696956940, -1300869403, 1171578314, 797249074, -1600611618, 1928247682,
- 307164165, -1482476232, -1886179640, 1306433392, 1945271359, -1272113751, -1285984081, -2057145549, 795047465, 1262569087, -1239828121, 1426641636, -786371495, 2120199316, 1273690652, 74457589,
- -1033394229, 338952565, 46122958, 1225741533, 2115308090, 678200841, -1618264885, -101162569, -1628976330, -1232839500, 468709044, 1876019116, 92723122, 233398255, -554960844, 38494196,
- -406437278, 2083528643, -1106878615, -340722557, -2123964932, 223183343, 108918116, -1014629054, -901344544, -838896840, -1908460517, -1763508731, -926890833, 1703791049, -667755577, 1694418389,
- 791641263, 1095689677, 1119202039, -1419111438, -2012259010, 188017439, -1775110395, -1971099661, -1688113734, 131472813, -776304959, 1511388884, 2080864872, -1733824651, 1992147495, 1119828320,
- 1065336924, -1357606762, 462963503, 1180719494, -202678962, -892646595, 605869323, 1144255663, 878462678, -1051371303, 872374876, 631322271, -172600544, -1552071375, -1939570033, 151973117,
- 1640861022, 310682640, 34192866, 2057773671, -2004476027, -1879238973, 582736114, 900581664, -427390545, -1232348528, -535115984, 1321853054, 69386780, -1729375922, 1418473715, 1022091451,
- 496799289, -80757405, -1903543310, -1128846846, 1703964, 1984450945, 856753858, -812919184, 775486323, -1376056193, 638628840, 314243536, 1030626207, 644050997, 73923896, 362270613,
- 236584904, 1463240891, -223614432, 435371594, -751940030, -124274553, -1991092884, 1579624267, 1249632649, 157589625, -345229739, -366245207, -1399995986, 1651729983, 1965074340, -1108970305,
- 1163690769, 1732013523, -1461252895, 669755552, -476503675, -264578685, -32813949, 288222188, -25734262, 106040916, 1654395626, -365148479, 2014455846, -2040447994, 1351639280, -919975757,
- -1970412139, -47306532, 222377665, -363434917, -1091717516, 2090685531, -1221091649, -1729649190, -1239406708, 1064945398, -105437479, -419675255, 74701669, -12862899, -498269844, 1566898997,
- -1872838355, 1596887574, 485902962, 469225597, -881763553, 1307841032, -1642872487, 1388543045, 379792876, 1095683384, 840780732, 1934378038, 1851278350, -1359389423, 130868458, -313448799,
- -663624816, 1031714153, -608443411, -205137499, -1849464427, 1973593637, 1068741808, -1420655961, 1188762305, 954044841, -995454462, -1818101092, -1937201943, -324541290, -1520603933, 572873173,
- -554764496, 1051557081, -1245136076, -985349536, 329320398, 1787901464, -37803304, -1759310177, -1463492617, -1861729663, 1251768782, 256937091, -779036948, -2049893864, 1256022877, 1228075657,
- -1550195255, -611319853, 1190797155, 2047604112, -576077160, -1532843331, -1324899394, -159729560, -622525946, -1080302767, -236033484, 1895243903, -410123689, -1944154157, -681781021, 1208453003,
- 579595878, 1303914051, -145607082, -131567277, -1917288455, 894217359, -175688726, -1585480723, 663691440, -1140068263, -641711178, 1596080008, 629197693, 976422358, -1570451095, 525923776,
- 895046136, -504151767, 1602553020, -1233054923, -1798474837, -1488857895, 1055782627, 261863143, 1879276655, 488240679, 1910982611, -1919441259, 370435945, 1265230086, -1293284428, -1503576227,
- 2076963035, -1379628250, 1157098875, 1984461153, -1947837397, 1705880124, 1453607404, -1233649748, 1479943773, -863878721, -862415630, -736723275, 940306358, -1596000684, -1174889953, -615723892,
- -885006597, -1796723178, 1844159055, -188942309, 2107251811, -1675486996, -1009475178, -859263556, -431866963, -9593673, -1878920923, -104853791, -1535224994, -69315537, 586690130, -1292234796,
- 1378749456, -301873019, -319297563, 1677205851, 292450579, -1289441171, 1788113680, 1907606333, 1464711611, -1372023606, -1978832445, -1772259768, 1949124464, 1818322887, -1138036603, 1249727628,
- -1474866449, -1868013169, -1384567593, 717007936, 954189997, -1900561040, 738470389, -158973180, 1732860784, 1936031206, -1133354740, -1173166665, 1432976712, 852636081, 1732064691, -1831788120,
- 1273933579, 455403217, 1988395890, 106493468, 506092152, -610530423, 1698053512, 1311747476, 1969503012, -1887461759, 1613543073, 903200334, -737865837, 325656800, -1234001200, 1492148864,
- 2009861533, -368262605, 1091338541, 2076108119, -961392337, 1835877112, 316250307, -853333391, -2125443777, 815363504, -798707803, -158146540, 690786114, -530775684, 1203556940, 1611485582,
- -1661412270, -53184506, 2126287444, -232222229, 1559486057, 283532250, 1202760418, 932144172, 1082594656, -570104011, 413509167, -995027177, -996477516, -540544, -745537167, -712135469,
- -996294983, -592787198, 1889840948, 1314628747, -394266926, -682316577, 456447239, 1728806063, -396279614, -43387643, 1915717013, -861574144, -1078710588, -561401249, 1111464540, 63643984,
- -1693870413, -968369980, -1053148188, 708799038, 1883537988, 373371671, -156410415, -1596483236, -1846890431, 888692915, -1025632583, -1666477591, -343066267, -2059058792, 641501628, -1744347292,
- 1648632991, 1743540146, 2020952406, 164014499, 990508262, 1706408228, -1236471842, -347116260, 1843634523, 827255665, 300519853, -1265974830, -547247177, -583064554, -1995437077, 689210107,
- -93151393, 835365056, 1706367315, -1605902756, 200954895, 431093688, -277573364, -928486713, -552221973, 145432789, 1128919795, 1675095586, 1930359882, 1215849501, -1447770583, 657776490,
- 1885869860, -1629237204, -868897479, -1258169760, 1828140195, -883850439, 463933909, -347361158, 1478116648, 801176896, -1501915899, 1017335748, -1654508882, 123994786, 1588785290, 791166651,
- -1523108535, 340411166, -496474762, -1189711141, -7392628, 2045171250, -1245366209, 834787230, -1346883181, 2034209454, 737043362, 898803323, 1983089087, -1845404320, 9585188, -1180608323,
- 1665100606, 1949474222, -211115008, 1151308295, -2132174259, 913126312, -2085061672, 1419864120, -1134542954, -53833957, -246913211, 468382370, -1759479323, 1136686211, 1307012488, -2036299559,
- -1346099736, 314743106, -1683101865, -947151948, -234529696, -2103334293, -279256894, -1484257, -1053953017, 1801205399, 941594454, -874119215, -672865187, 762284205, -1494975451, 486607927,
- -898264389, -1711861093, -212572760, 2106484281, -1610786470, 1352525590, -837779586, 1568282001, -593019125, -1146260782, -1595879979, -640781858, 1107692311, 1547132709, -1928385535, -2057772805,
- 634887038, 329772618, 942136006, -864405576, 501883884, 1537141484, -1180626836, 1123055420, 1090885851, 421662750, 2033111605, 1710917425, -1118058244, 74321279, 257328195, -1199940697,
- 208625996, -442341447, 808119183, 1166827075, 1177417517, -1856155370, -1464837036, -60624923, -1306220638, -91104698, -1434621430, 548899241, 37351476, 1478278431, -1255061434, 248470035,
- -104642597, -1865169521, 1418373655, -1660810523, -2129015436, 154612798, 276575732, 1930338442, 179503250, -929294855, -39452027, -1377657544, 1442322193, 1137511318, -432158653, -984801987,
- 743099148, -1118893528, -904123623, -1273146363, -1884800406, -803169061, 1254123158, -484252077, 317646844, 404246525, -1230293916, 1121445742, -19657507, 652967153, -1055406692, -468950719,
- -1493532921, -1447624258, -1369679689, -1517000228, -145853307, 1518006526, 1591195514, -1475557146, -909722097, 2103182976, -406830579, -2124025254, -1804819507, -1357512858, 567321869, 409048156,
- 567805180, 1749009386, 1762759722, -1770324077, 1271140844, 468219092, 955792405, 1911965665, 1876314424, -718200715, -1278883927, 1392281730, -120519585, 851473793, 245054754, -33369039,
- -284877584, -479534880, -212346563, -122017521, -1461429983, 1331007370, 1788621721, 1739036536, 1446350953, -1985448033, 685528610, -1386434659, 1368233993, 2021786790, 1596478397, -1716635278,
- -2011083017, 171876097, -311529197, 687812052, 377000657, -1055547517, -1499047842, -1818434951, -120863666, 33888043, -1387509273, -541540700, 1162597745, -1331415338, 1931708792, -850270000,
- 663845594, 1536495943, -322924971, -1380272203, 261190298, -204874428, -2104974031, 883819928, 155808204, -1454446035, 1323388464, -1696505728, 1549800285, 1018150463, -1327715703, -1582480640,
- 1013659809, -1820360082, 1666498787, 1406120540, -196541482, 1248470531, -1250433281, 836375878, 177646854, -1927020253, 2145878321, 689712096, -596605921, 348283199, 1916993096, 481356808,
- -339687826, 1219340319, 718895887, -2007521340, -1859185806, 2042164737, -58146784, 742449142, 1930754708, 780832111, 715056441, -1393886151, -8150527, -599607443, -537300865, -1212516084
- };
-
- for (int i = 0; i < refInt.length; ++i) {
- Assert.assertEquals(refInt[i], rng.nextInt());
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well44497aTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source32/Well44497aTest.java
deleted file mode 100644
index fa86f0bea..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well44497aTest.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class Well44497aTest {
- @Test
- public void testReferenceCode() {
- final int[] base = {
- 740849862, 1202665156, -199039369, -259008301, -291878969, -1164428990, -1565918811, 491009864,
- -1883086670, 1383450241, 1244617256, 689006653, -1576746370, -1307940314, 1421489086, 1742094000,
- -595495729, 1047766204, 1875773301, -1637793284, 1379017098, 262792705, 191880010, -251000180,
- -1753047622, -972355720, 90626881, 1644693418, 1503365577, 439653419, 1806361562, 1268823869
- };
- final int[] init = new int[1391];
- for (int i = 0; i < init.length; ++i) {
- init[i] = base[i % base.length] + i;
- }
-
- final Well44497a rng = new Well44497a(init);
-
- final int[] refInt = {
- -1464956854, -1524360321, 986845646, -182050548, -818943186, -1744848370, 1392434650, -182648505, -2026593838, 1254866610, -410459761, -1392048371, -968730026, 1485793687, -728749746, -112685463,
- 275126404, -1101838984, 1193096287, 443511615, -510869213, 549869992, 1974458428, -1217587840, -335835016, -2048974745, 1066947099, -611611187, 1978925459, 688164478, -463344808, 56995910,
- 699288809, 606392470, 117418673, 1948706703, -485598135, 385841705, 1725261146, -919553921, 70643668, 2128611684, 1720197347, 738706713, 1162026860, -611442152, 1469145601, 2051653750,
- 609067755, -1971782890, -971114565, 776260144, 1619791127, -1547233838, 1502505722, 913168193, 1761269649, 81782996, 62251540, 1519079156, 1239007000, 489633356, -800433470, -2107278046,
- 495320431, 269446836, -2013306553, 1074614697, 1645125348, 584369930, -405429577, 1211134012, -2060113546, -2047824, -443978800, 271218497, -1002185964, 1519315874, -695096464, -79101601,
- -1521653608, 192426133, 1159511202, -1354494985, -477280535, 583522228, -661741458, -1251175621, -369487281, -2015449518, -2102058930, -645264919, -925270025, -1674575999, 1363844609, -831732660,
- -1668989157, -1861246633, 83763283, -1056074975, -519054258, -1546386261, 1691674654, -885968657, -1189571815, 2095154843, 1686743191, -1859471265, -261593938, 1721982136, -491120252, -949699153,
- 642525852, -2005306625, -1004765905, 742736856, 1653443876, 788423835, 1536155740, 879514143, -1510757104, 115238646, 28600662, 1485490803, 1272460710, 523153480, -766782926, 1332478031,
- 528775440, 302965264, -2046891123, 1108139271, 1611601128, 550846467, -439082190, 1244786747, 941120547, -35568474, 1756370964, 304870369, 1902684028, -408710726, 1673189520, 1180987663,
- -1488131864, 158973303, 154514890, -1387953397, 1453732833, -1342263302, -628153633, 4710424, 619931109, 721411332, -2135645486, 1688696681, -891749588, -1641122924, 1397432310, -865254619,
- -1635468227, -1827787970, -1311416657, -1022618057, 1411688086, -1579840139, -637954674, 2115653281, -1155985079, -1043532593, -374286955, -1825883832, -227940643, 1688394137, -524577925, -983222470,
- -1955769926, 626525757, -2009760930, -1855453635, -676923169, 754966926, -291202391, -2126042921, -1477304277, -1409345382, -1264640578, -441993991, -17611930, -1576809974, 2137694350, 1299022733,
- -762509116, -1087399293, 819303572, -14571174, -719035481, -1644675278, 1492736905, -15038081, 974773023, 1087127339, 1790024863, -1493135734, 1936273291, -442361741, 1639666948, 1147532756,
- 174955156, -1537685747, 187972574, 275303083, 1420277149, -1375787574, 1873043153, 38164241, 653451946, 687758113, 899667071, 1722219976, 2146668333, 587401069, -26582672, 2034645447,
- 1401801794, 1043291001, -1277898614, 2116116828, 1445274301, 150534325, 469242183, -937704471, 171074779, -204638071, 1269913689, -771734064, -12280461, -1182158859, 1704390140, -263303749,
- -848503723, -1822849148, -634064465, 1130988864, -1515750310, -908815400, 1487214333, 994482967, 853103628, 1711185413, 1520342001, 1067859186, 1693632130, -603831333, 292236742, -800655385,
- -1467184928, 221125007, -1697377800, 1293953144, 1730537111, 1073329737, 519625212, 689636032, 1127394154, -1496469136, -1214585810, 822152197, -1572579275, -527866383, -996792678, -2058452887,
- -1133767559, 576275042, 1579109209, -295089371, 1502267384, -724281876, -911879875, 1131096177, 333026744, 1238706603, 1067340063, -745697708, -973992204, 1560446744, -664017057, -616056490,
- 1099714049, 674159948, 383625825, 1411443110, 1862818263, -1896254899, 1322476914, -719144734, -1540101945, 988154902, 781856577, 2013381051, -2059071359, -142073207, 60252832, 2052050421,
- -666391497, 376633738, 1663011481, -1706886481, -1870003191, 1003819645, 898131216, 778824906, -656875645, -1730811011, -1751653787, 2056079904, 231977636, 1831419220, -465545074, -1505266471,
- 1034419975, -133864043, 1876779821, 1879792902, -100100435, -959264741, -472668436, 203584096, -46980157, -1478047098, -979669209, 809008494, 1279644171, 2055793632, 1385672419, -1756428826,
- -1790481031, -2089665073, -1608595011, 457322987, 1267418945, -19541848, -796352273, -1049973752, 30940894, -539710199, -1097391703, -779353550, -1328320498, -735447662, -918513196, 1516945649,
- 1218919237, -251287485, 1826366637, 353082340, 889839220, 399638904, -1462573609, -618450466, 1429903706, 2095548034, 1486594475, -1053248922, 74346322, -357998703, 1790710495, -146359619,
- 1581657509, -797737661, -920778913, 608399665, 646679359, 1861775150, -1014371223, 476735306, -1577737028, 383018939, 1234592859, 344770283, -472763155, 187217985, 1245828866, 1936329359,
- 61243025, -1979390025, 903671173, 302699505, -1677126111, -1194113496, 835857595, 706998946, 70931462, 1374113464, -1464459699, -231081598, 1366205112, 396990527, -1615015619, -968458597,
- 457632575, 24361353, -1120685182, 2101590608, 1654666456, -1208442054, 579414359, 1078056578, 217408674, -1560683025, 815178420, 1219326466, 450032327, 774403237, 54597342, -664057229,
- 447132403, 50603973, 435640301, -1224073863, -1339908037, 1775470944, -1378119263, -1375189988, -1287971162, 29816317, -1313418882, -1824967031, 443540716, 11064217, -1463969487, 1967601549,
- 124474667, 1230898256, -1741455555, 561643750, 933295231, -923145874, 245538199, 289478386, 200552280, -268887021, -1598221376, 1236123270, 318325803, 773964550, 191670680, 158043961,
- -762639146, -416703928, -721969492, 1664330785, -584949010, 1509045840, -2066001147, 1728613092, -1103375821, -1262079070, -2034789427, -418216342, -546365126, 1235751589, 1639799329, 2085089663,
- -697590049, -2007054256, -147701903, 209371702, -1868450893, 1241065116, 1537364837, -1035970557, 318040217, 150492098, 1841159805, -491979749, -1275490577, -1759443566, -697538216, -1589624976,
- -678703557, -189067001, 1539472677, -1396089831, 271512148, 180483983, 483714313, 703861378, 2122114992, -600097045, 522009268, 160429181, -744428886, 1541223403, -1211039718, -1167643980,
- 1551471162, -816207368, -1429258613, 1350901561, 1934120609, -961643277, -214772286, -2128270227, -1561239720, 1493926966, 1376671007, 94966082, 221846150, -164351411, -51309876, 497148497,
- 1233668542, 266257753, -773473851, 953946385, 420815294, -1390653175, 1834391782, 4704447, -891751440, -744104272, -1082756642, 1431640408, -1912055536, -159789461, -704946016, 1956368139,
- 642279822, -374415338, 1562655802, -272964020, 1071498305, 667364168, -1546405154, 341389690, 1360662999, 377696332, -437020076, -1668574556, 1242655350, -756555890, 645954261, 1914624235,
- 2134904445, -247737098, 143667521, -17668806, 1804148531, 414247300, 1030053929, -1595215075, 887532426, 553113691, 1173830167, -303724353, -280418143, -1143962122, -1898518451, 36464746,
- 1189572700, -1549967582, 1093341440, -452303819, -731023001, 1111173883, 1678013973, -836458212, -842956392, 212774049, -845621791, 966282353, -823130040, 700410571, 619075141, -304785045,
- -1816233676, -1789653997, -166914694, 690663021, -669570330, 1098624444, -987380984, 452844935, -1089825546, 1221160503, 1217375341, 512281644, -1106887134, 1665404458, -1462594714, -207498587,
- -789271490, -723469709, 512055365, 1445951882, 1692473633, -996873493, 1445046730, 993087194, -1666188562, -897427329, 1008869698, 1236029718, 1499207233, 1704947182, -1815799281, 686399988,
- -475436580, 1588892458, 884859588, -471913926, -487416631, 1323960741, -1257612174, -468909314, -1866654496, -1417895838, 1707647971, 997140465, -1358794225, 1929422460, -605622778, -1587468566,
- 469149623, 1121515927, 748484204, 1201983830, -1906623591, 76398473, 261109068, -796025669, -1964466661, 1739898262, -756850622, 1581369453, 1484675811, 484136467, -705983890, -1357931714,
- 548520423, 741992908, 1017931838, -2078503520, 2097871343, 569233897, -91903627, 1864053450, -876129714, 336670307, -1950420274, -872316480, -662220291, 275724295, 703565412, 1334248646,
- -217559198, 1044090753, 743502488, -1518545318, 20614180, -768582053, 976522354, -25129962, -983639284, 71722595, -119236393, 368844119, -795808244, 696073964, 1379765302, 235083623,
- 666280330, -1313689346, -643870520, 534522699, -250414377, -1239276164, 159264592, -1119503518, 1168161619, -1366518946, -1335653301, 248092140, 1390152547, 2051602724, -1023547981, -1479782621,
- -1785785862, 1609789158, -919124123, 1703200068, -852553456, 1573706142, -376011685, 305068766, -1231775451, -1536883494, -125122369, -896696968, 852651567, -458154391, 747781704, 1173040469,
- -1569200836, 312506093, -1680530410, 117086271, 794587661, -1231003908, -1048955503, 2119305423, 1636729108, -522378372, 1627421730, 545077470, -1683264872, 1486496559, -1793064672, 1908368749,
- -1226052295, 1399248776, -588193954, -1289386125, 534647065, 2126245059, -238362987, -1244573058, -1571832269, -2052693379, 1494767731, -528668449, -980826491, -151282847, -1468523556, 1876349941,
- -301654558, 1467960576, -741720848, -612158589, 92376910, 987915105, 1037689578, 793773489, -1387669541, 349490139, 564784004, -1161242130, 619703053, 2063233129, 190888106, 81845991,
- -1482466066, 283234313, 114355492, -1879406787, -1283370924, -1378903370, -730141747, 1570738286, -281348873, 2131743196, 795654462, -497365688, 437612465, 1928618254, 1433118279, -1801292119,
- -2059248836, -221673230, 163637697, -411319468, 244353317, 786753178, 489172932, 464627154, 1258915212, -229028334, -994675463, 1931657329, 1784181437, -97111947, 1728952452, -1329133577,
- -1606156362, 1341196121, 1679632329, -796545286, -1021125869, 1427825468, -214986389, 250791528, 1029777000, 90661677, 602529506, 2068040879, 1483801763, 2332097, -457467017, 672399614,
- 1542769193, 1781253216, -1967165705, -2052227925, -1248173215, -1676554121, 292413596, 209649573, 1750689340, 1946874730, -832845570, 1774178655, -450175610, -431901779, 613330756, 1969434259,
- 1251099237, -1320908513, -50659188, 273178515, -296290724, 1195998469, 1329813722, 759419114, 1003396150, -274557619, -548886303, -2055397788, -766678640, -464045978, -1835907569, -169406709,
- 820751456, 1778613303, -1582073956, -1728391771, -2075389498, -1606584632, -1702107251, -15724560, 45610235, -1967510298, -671487775, -1841110041, -913365944, 869680052, -798103472, -1564096927,
- -918899909, -810066882, 428829752, -1413487973, -844240890, 1343914280, -689285374, 1827745702, -799686631, 1696465705, -726159000, -1381157526, 1649221296, 1791106481, -1872852642, -485685063,
- 1534949133, -1611901907, -581776031, 242740701, -382394666, 668419384, 388297992, 748818886, 713804061, -1783774172, -1823401590, -1009098384, 2071462929, 1154475522, 1309810666, -1734475040,
- 1212095416, 988288210, -1457428115, 1699730041, -1804729443, -1922824494, 1000076038, -226555981, 131425181, -1071582828, 357680377, 1574190179, 996651958, 965704429, -47651768, 243931978,
- 808955117, -652323633, 544967309, -1199510217, 702795379, 997685748, 1593927308, 2119371055, 1451401230, -41992913, 2033816081, -1030495962, 1764010175, 457470691, -2001190141, -373358035,
- -1950331268, -1291674220, 642934467, -1825725718, -1555687487, 1664472129, -24722338, 1899539596, 78519318, 1662555805, 1744711308, -2142888582, -1597853572, 118030659, 1596713428, 404304267,
- -1350880388, 648702031, 1185458591, 1798138033, 819516445, -1466759682, -751277607, -879817426, -1931050435, 1465603177, -1402344216, 768491239, -1404853657, -1915685264, -1845859847, 313163207,
- 1239598382, 1988767047, -555152530, -1925665864, -182399255, -1392390808, 64861291, -511875035, 1879964459, 918905020, -840773616, 459610189, -1522352470, -1821396360, 977274705, -60616465,
- -1846727880, 1208592937, -515359427, 1127607806, -395032287, 491869604, 2053794084, 568321750, 1597027438, 1355613070, -2069482724, 1899252555, 844726247, -625112193, 1146099491, -1037855139,
- 1203928737, 1875686061, 994108281, 1471873396, 2026801570, 4941446, -1066074241, -983738686, 2037429697, -836521112, -633388883, 1221918725, 2137035208, -369891832, 372509548, -110916409,
- 80517712, -658056946, 727893428, -1353651002, -475459562, -291323023, 1059377566, 591801919, 1018232602, -348255729, 1863827426, 246032476, -1026132864, -1356383176, -1224690998, 262442981,
- 1257773681, -1738604660, 77131430, -1320261233, -2342727, -1817187590, -1883997191, 1367221809, -1863623746, -1132606249, 149024763, -1228275128, -578030399, 356914163, 2109691820, -880313621
- };
-
- for (int i = 0; i < refInt.length; ++i) {
- Assert.assertEquals(refInt[i], rng.nextInt());
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well44497bTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source32/Well44497bTest.java
deleted file mode 100644
index b850be56e..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well44497bTest.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class Well44497bTest {
- @Test
- public void testReferenceCode() {
- final int[] base = {
- 740849862, 1202665156, -199039369, -259008301, -291878969, -1164428990, -1565918811, 491009864,
- -1883086670, 1383450241, 1244617256, 689006653, -1576746370, -1307940314, 1421489086, 1742094000,
- -595495729, 1047766204, 1875773301, -1637793284, 1379017098, 262792705, 191880010, -251000180,
- -1753047622, -972355720, 90626881, 1644693418, 1503365577, 439653419, 1806361562, 1268823869
- };
- final int[] init = new int[1391];
- for (int i = 0; i < init.length; ++i) {
- init[i] = base[i % base.length] + i;
- }
-
- final Well44497b rng = new Well44497b(init);
-
- final int[] refInt = {
- -102003638, -1254584449, 836441550, 1949705484, 653000494, 1579400718, 699652570, -140738233, 1164288466, 419933874, 366568847, 780567309, 1867405910, -350557801, -964350642, -1323492759,
- 191502468, 398676344, 1568976991, 1005053759, 199053603, 31083944, 74697788, -1343941248, -1205631880, -1637961625, 361813531, -1706096179, -403340909, 1666226814, -2034962600, 1237102662,
- -1833248535, 1584255126, 1295661745, -1753848945, 1208145993, 930278953, -733716134, 192752767, 1692463060, 1727273316, 2122952931, -809025255, -992081044, -895539688, -419372543, -1835478922,
- 2089629419, 1646590742, -1261083717, -1005462992, 1619627287, -1437723182, 1619689210, 1319393089, -1816963183, -150214444, -513482220, 1897815796, -1861960936, -1766444468, 2034653890, 585657634,
- 1867016559, 696942260, -1536237241, -527055447, -1554805020, -1063992566, 1024799415, 1782080572, -1884276362, 129028272, 1427925968, -1154222271, -1383146732, -1580532830, -1907049616, -104299169,
- -1780913000, -2090815339, -1789809502, -1521443849, 1226625769, 1126090676, -2117094290, -449575109, -218982833, -695554478, 35923022, 1386126825, -95031305, -168657023, 436674049, -1137917876,
- -2045134053, -1025629865, 133144659, 64226081, -1966942130, 700813483, 344058910, -910646033, -212789479, 740360859, -1269028713, 1517763679, -664178514, -683718472, -71951996, 86583727,
- -1235669348, -1426987265, -166598353, 214190040, -1436967644, 233824411, 710927452, -1939548641, -433607408, -1075939594, -1549702826, -1310827917, -640604762, -696863672, -1282162126, -546470833,
- -1516734192, -513809904, -458526835, 708926727, -476643096, -2108375037, -2870478, -1460116421, 436587555, -948939610, 1891375124, 1944216545, 959034236, -1267038790, -1695098736, 1853748495,
- 1594424552, 1270099319, 1139585482, 1837434635, -709909535, -457524230, -887118113, -241703912, -1888225819, -751575804, 1122280146, 1194255209, 949350188, 892826516, -791212042, -151203035,
- -859297731, -1979039938, 323603119, -1022065097, -1804294506, -385802891, -2127523442, -720380255, -1315859127, 999649487, 335041941, -1732821688, -1833409827, 535715225, -1285355653, 1206723386,
- -1141619270, 759796285, -1599504546, -1988521411, 1056668895, -852564594, 1056509609, -1831687977, 754168875, -1301144422, 922880446, -1502666503, -949791898, -1043870198, -1136941938, -1649670259,
- 1342769348, 1692605059, -132279148, -1108038310, -14355545, -1611387086, 1651826569, 877600127, 1356160799, -759125205, -1300490081, -414938486, -201479285, 1958709363, 1513313540, -1396836908,
- 1352702612, 1142506253, 52969438, -365142357, -1619054179, -1368514102, 1470750417, -1420830959, -843909462, -1679570143, 1447444607, 234551752, -1507452115, -1433234579, -680890000, -497305145,
- 860408898, 263376761, 1537070218, -592353956, 1587852989, 1756653749, -2081320633, -1547020311, 723771611, -883819383, 1899879513, -268417584, 1058606451, 1665941493, -1630340612, -614737477,
- 891313237, 1368950660, -1166187089, 296322368, -1908770726, -2120378408, 1245479677, 1879710487, -1705947124, 1018371589, -1715010575, -1096078094, -1749891454, 2130888667, 318647750, 554592231,
- -489121568, -1809605233, -1697905160, -953926536, -2013960553, -148884919, 1822739964, -1466301760, 141999978, 1946526064, 1323036718, 864390149, -2141665227, 1510602225, 1468408474, 1277039721,
- -1368096647, 180965986, 2140852057, -688071899, 819713016, -154385940, -1182972611, 1257224305, 1392607672, 1364245931, -1768434401, 323522132, -555278604, 474186520, -1178901665, -2137343658,
- 1636421121, 1398987084, 1276656225, 1013316006, -955917865, -1537149363, -179145358, 342862050, 1172728007, 736300054, -1114656959, -1831840325, -1882353535, -442915191, -1206488416, -1818534411,
- 25312311, 2100297098, -1562767719, 1762553519, -1853194231, -1152612739, -2020055792, -809572150, 848584579, -535789699, 1817604709, 1343773216, -602234204, 1739930964, -833790834, 501215449,
- -730104057, 1217783189, -681773267, -611951354, 978387629, -1516811237, 974303980, -1389665696, 2091099075, -727528826, 2116026151, 271935854, 613242379, -2100429856, 190004963, -1629612570,
- -1362888327, 175094223, -917873219, -2008308245, -401946815, 504218792, -1966525201, 4106248, 164895454, 226502921, 655865257, -610528718, 189428750, 1055978898, 17603028, 591024369,
- 1127922501, -1546639293, 1994174637, -724136988, -673919372, -1665002120, -612145705, -793102882, -1904763558, 757565058, -2091240021, -2123324826, -1518702766, -802889839, -223045921, -1509216579,
- 1195556261, 2079259971, -903969953, -1781800655, 1834950463, -956531922, -1152550807, -1116052662, -348802884, -1395330117, -91758501, -19115285, 1926930669, -1015793599, 545904386, 1617858191,
- 716963473, 1917089719, -980914811, -212646927, -1634695647, -1857924568, -1462257477, 1273750178, 1060328454, -361604424, 867932749, 451213698, 405780152, 1165233215, 1877230909, 2103114395,
- 1644330815, 1252998537, 1961603970, -1533101488, 1790456024, -38226118, -1306744489, 713676418, -1535871838, 1378109935, -338185548, 1647669762, -477465913, 203482277, -1949756706, -503326093,
- -638704909, 320186309, -1435581459, 907446649, -77384645, 537368928, -335347295, -1912061924, 547819174, -225549827, 1089455486, 463516297, -240127764, -85895271, 2053179697, -287394931,
- 921878827, -933362608, -1178670275, -1200942874, -672571265, 574422382, 1441734039, -1814493454, 165751640, -176907245, -1170992192, -2123252090, -1435971541, 1591853830, -885477992, -792847559,
- 1359875286, 1038392904, -2027255124, 687291425, -165513490, 1391146576, -1387080955, 794663652, -807189965, 667820962, -545384499, -1371368854, -689031878, 1504805541, -752825823, -1920047745,
- -1884874017, -350566320, -197152911, -181743050, -798415949, -915922276, 1790690149, -363997181, 1923116185, -1326427198, -1621079427, -1997440997, 1798118127, -2053110382, -159879848, -1286787216,
- 1046436411, 1832030471, -389092059, 71686169, -76025260, 1914270607, 1854169353, 872157826, -1774323792, -575165717, -1919931724, 2051498109, -1176174934, -883578901, -1253047270, -1310573900,
- 245466682, -1784824328, -1319912821, 1377340217, 1364313761, -408687373, 142333378, -1952335763, -1703126184, 316314678, 2030555423, 488640834, -1783293306, 2116925005, -428337460, -42966447,
- -476226114, -325172903, -1690748475, 852791569, 26490302, 85251337, -1374975770, -376283969, 982639600, 595119792, 376403422, 1574509912, -1509664496, -1901241749, -59019104, 358566667,
- 341667214, 184541206, -550950854, -1897143732, 1595753537, -1236127928, 2014297822, -2033179270, -669806121, -1927596980, 1010735700, -581795164, 1922398838, -1456743538, -1633813803, 323177707,
- 2002098813, -2099067658, 277393729, -671911622, -384463053, 2028267908, 367391785, 1270052637, -172839030, -650486693, -831800809, -1255138113, -137512799, 1904317942, -8229811, 707361898,
- -276859812, 50417442, 1487081728, 1577776181, 1994451303, 1237303035, -602016235, -1905218276, -1895725672, 1172978849, 801129953, -1819485071, -587985848, -2010386741, -1645226427, -850866837,
- 816998708, 357665811, 1955856762, 1617902189, -1013761306, 146782652, 904185608, -500146809, 2085848310, 1917713975, -1823786899, 1994184748, 789196322, 1766857258, 1770685286, 58213029,
- -1699628994, 346827379, -1274423227, -5079670, -193099487, 1020296939, -1795904054, -1951053094, -43782418, -375403393, 1026761026, -207269610, 1364563521, 1578793454, 457809423, -534138380,
- -1052938788, -1897101526, 1449976516, 2052800058, -1145169719, 1476303269, 370625650, -325249282, 2165984, 1631432802, 1032336355, -1292978191, -1810172401, 725725820, -1162678778, 702624490,
- 1387673527, 981825943, -556408212, -1108487850, -1782136935, 1582316425, -1752682164, 307235003, 1386486299, -1343636074, 1936875586, -1265279891, -345847069, 928241171, 239050350, 1859358526,
- -664776217, -823267892, 346651710, -867656288, -1907921425, 1362445801, 541145461, -192727350, 1649366606, 244694627, -488180018, 214008256, 2032125437, -1678591993, -264593820, 1309017286,
- -652451998, 1845366657, -703990120, -550186406, -630285276, 1782372955, 1650564210, -1127904234, -1407983860, -1119422877, -1565976361, -1913545385, 549841420, -1410323732, -1964467146, 228296551,
- -421026422, 1929094398, -266906424, 264810315, -2008122665, -1088278148, 141242192, 1871293282, 234634067, 1724159838, 1638271051, -837713428, -657941661, 168093988, 708605363, -1881612509,
- -1810496006, -193495322, 1889982309, -2050702012, -693694192, -1249780322, 718733403, -76349730, -188217051, 920912090, -1814078273, 2013358456, -1948845521, -198407575, -1248904632, 1182772565,
- 1236791612, -1297489171, -1958468586, 1437011007, 390460941, 113068796, 1247982993, 2102889679, -1563524844, -128174212, -754095070, -1461699362, 943615640, -1013270737, 221253920, 1514140013,
- 1596946745, 674222984, 616356702, 1811224435, -1764322023, -1653707581, -1702404459, 390678142, -209506765, -1398278531, -117061517, 1625861343, 659048069, -1490678943, 846536668, 210715637,
- 1855458786, 1727745280, 1086729456, 1109111683, -985298098, -1813777567, -954599702, -1522494031, 1166103515, -191868965, -1048777852, -661271058, 1161457421, 1509090409, -919753558, -155431193,
- -1774302994, -366390263, 2090138916, -693431491, -1693888428, 1846774454, 925855693, 474383470, 208889079, 382195164, -283005634, -2095134392, 579927985, 1390765326, -1766119865, 900457129,
- -1503703236, 974952690, -107714111, 381338452, 1187256613, -860560742, 524103620, 1499506130, 197755276, -790802926, -406920967, -1972219791, -665721155, -113336203, 1037154436, -1185441801,
- -745541706, -546274471, 1988928457, -1975403782, -1167172845, 777779004, -1560935061, -140258712, -1243598232, -1394149587, -785002782, 311842991, -1025469277, -605350463, -1251538057, 537203966,
- 597777961, -1845767072, -1556349193, -1491015509, -1935936671, 2093498487, 1908270236, -315396187, 1356362300, -2025658518, 630119678, 276190559, 510123398, -1266145363, -170152124, -151540077,
- -477900187, 1895894303, 1870333068, -1169891437, 353366620, 2111175941, 1691245786, 1318765802, -90993610, 921309517, 118241505, 367005284, 1624861072, 2010785894, 865255951, 1717799691,
- -80757664, -644944841, 136999836, -341686875, -1908076090, -1968934200, -346397811, -184213520, -511811333, -2118173466, -1086490399, 1795322855, -635494328, 415716276, 851044432, -904636831,
- -1972230341, -64337858, 571177016, 1248814747, -1351030778, 457872680, 1843549954, 1718960038, 815088665, 1812961065, 360686952, -1356586646, 1657802416, 1776192945, -786723490, -342254407,
- -236653811, 771014701, 906386785, -308057635, 1907957462, 206000440, -42143480, 900403654, -917549795, -310520796, -1713627766, 2061136240, -377977839, 891282946, -821163030, 328143584,
- 1503793080, 551621842, -2086273683, -2070526343, 91195293, -1654389038, -1035734266, -336619597, -1220221027, -1468468844, 2105626873, -841372573, -122707018, -2013073683, 494461000, -2054807734,
- -67946259, 1914163407, 1941835405, -1027244745, -768123277, 419129844, -275750260, -171533009, 97756174, -17651409, -1578102255, 995291430, -1587462977, 692904675, 951632643, 1882101293,
- -1546298756, 2018418068, -1790777661, 1542305514, -1437624383, 469587009, -1647853474, -1318279028, 497228822, 726733469, 1693133452, -2091185798, -209017732, 126386499, 1056958932, -2105494133,
- 754067324, 96463951, 83701151, 1101658289, 1485852701, 553783806, 1898769881, -1072031442, 1438062141, 1992540265, 1152252136, 1019391719, -175951257, -6691216, 989789689, 968359367,
- -1330392786, 1704963399, -998432914, -948060232, -1921688855, -975840920, 1360273515, -872810459, 12676907, -1908050756, 883609616, 65641549, -200365398, 1386653304, -1203665071, 1878689007,
- 426262328, 315375145, 1900325181, 703658494, -765404895, 1070155172, 1399748900, -804264234, -1619419026, 1347225486, 230635292, 1093717835, 14020583, -2107039873, -968325341, -1679158691,
- 1959784097, 1065690797, 1090615161, 1311445364, 865835426, 870016646, 574122879, 1842697922, -1289210431, -1914001560, 1672467629, -900366331, -1524066872, 136503816, -1910431892, -1431958329,
- -830367152, -1316233970, -801974860, 1560669382, -81784810, 401822577, -949103202, 943897151, -722666726, -96825841, -1092898846, 230567004, -70355840, -1398069192, -312953142, 1475420133,
- -622491023, 1661205388, -19071322, 6024591, 1473041593, 2053897978, -1346768903, 1484764721, -1552461890, 1287146711, 1613069307, 902497864, -1504480063, 375292915, -836353108, 2047602411
- };
-
- for (int i = 0; i < refInt.length; ++i) {
- Assert.assertEquals(refInt[i], rng.nextInt());
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well512aTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source32/Well512aTest.java
deleted file mode 100644
index a1eb7cacc..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source32/Well512aTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source32;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class Well512aTest {
- @Test
- public void testReferenceCode() {
- final Well512a rng = new Well512a(new int[] {
- 740849862, 1202665156, -199039369, -259008301, -291878969, -1164428990, -1565918811, 491009864,
- -1883086670, 1383450241, 1244617256, 689006653, -1576746370, -1307940314, 1421489086, 1742094000
- });
-
- final int[] refInt = {
- 1634813289, 1876773016, -973836208, -2130023652, -1045460084, -1834384857, 1691032973, 609714289,
- 2033920362, 555915483, 6680992, 1958127415, 1866469645, -1471336965, 2049178762, -192324811,
- -2056050066, 810879705, 1405046309, -781317118, 1012782311, -1045081032, 728377508, 1473511660,
- 290489070, 326666761, 2018299979, -1876688058, 1239968501, 1464625040, 2025151042, -101397407,
- 1387902041, 210959839, 1366359326, -476473433, 153180037, -1607631523, -506743495, 17888738,
- 313865008, -340504498, 586684079, 1243699375, 753162229, -646761694, -739189655, -210120185,
- -1856358726, -628255542, -1812798197, 1416288088, 1077967722, -846846208, 1379850409, -580183344,
- -1858959, 210859778, 295841424, 1492774865, -1415543680, -344870570, -1942779197, 1549510646,
- -389544849, 314254218, 11784988, -1311757368, 1719514841, -764610517, 1296788970, -994707050,
- 783854563, 422654144, 387639079, 1219688425, 2144352572, -834212874, -1036550358, 935909479,
- -568610842, 1327498837, -588933178, 1910065754, -40851599, -182063170, 1302731458, 541311559,
- -1647345522, 805224371, -1721196679, 1518507830, -952689880, -433276260, 509675254, -777259954,
- 1277810106, 284054896, 936042202, 2036836351, 1956412426, -1186403024, 287795400, 2135311211,
- 720485927, 1500695024, -281656583, -1277937322, -1628968482, 1242814831, -2030700974, 1473867890,
- 440813549, -1357033971, 28384076, 1602731216, -641465746, -609054347, 635938444, 1472898176,
- 1476894555, -747974186, -1590337055, -884242108, -389736197, -2066984505, 1087103272, -1236446290,
- 31657463, 1835715432, -468439078, -2132633204, -434609235, 258308151, 1851926761, -1630139159,
- -1344617241, 1969204215, 619463174, -174392624, 207475487, -1619828078, 1327980298, -83968178,
- 445951782, -1786230541, 6279288, -580982231, 1550645552, 2006533941, 275746007, 455676647,
- 2019637349, 1115547704, -1313120106, -516213449, 73752461, -1382448112, 398589620, 1319888048,
- -1595572334, 1566934536, -1735685764, -1509545339, 1458173912, -549395819, -618827040, 1516624531,
- 1900757187, -1454200688, 965524719, 488355065, -1869294316, -810641680, -2059428251, 1454656431,
- 1329120541, -232185900, -994996943, 1855980910, -452077812, 1565630611, 759842266, 1241435187,
- -1390456063, 1946400597, -2032319771, 683667881, 905911106, 1983310786, 120010546, 526018017,
- -1946881912, 205004987, -1307250612, 2130980818, 2052864161, 189839787, 1789478047, 406168885,
- -1145186347, 8507675, 1277188815, 1492619042, 2009819675, -1627411598, -851016743, -1828234956,
- 1962622506, 2140398255, 236935165, -337237772, 1263419111, 516775236, -335741025, 1391328225,
- 455979249, -1457534664, -657606241, 485648133, 1762116343, 1194889600, 817834937, 321150162,
- 131159182, 290277758, -1876924740, -1770401129, 1291602973, -1003642974, -1580211929, 1520422021,
- -399171579, -24315308, 453805396, -659197747, -205656847, 466526550, 1444397201, 1178091401,
- -1157268826, -602394028, -1370668795, 1614896435, 1699071659, 1864753793, 1888518358, -1721244514,
- 1812776767, 668822227, -297283057, 2130183333, -1169618692, 912860240, -2028253096, 1244694278
- };
-
- for (int i = 0; i < refInt.length; ++i) {
- Assert.assertEquals(refInt[i], rng.nextInt());
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source64/MersenneTwister64Test.java b/src/test/java/org/apache/commons/math4/rng/internal/source64/MersenneTwister64Test.java
deleted file mode 100644
index dd3ffca1f..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source64/MersenneTwister64Test.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source64;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class MersenneTwister64Test {
- @Test
- public void testMakotoNishimura() {
- final MersenneTwister64 rng = new MersenneTwister64(new long[] { 0x12345L, 0x23456L, 0x34567L, 0x45678L });
-
- /*
- * Data from
- * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/mt19937-64.out.txt
- * converted to hexadecimal.
- */
- final long[] refLong = {
- 0x64d79b552a559d7fL, 0x44a572665a6ee240L, 0xeb2bf6dc3d72135cL, 0xe3836981f9f82ea0L, 0x43a38212350ee392L,
- 0xce77502bffcacf8bL, 0x5d8a82d90126f0e7L, 0xc0510c6f402c1e3cL, 0x48d895bf8b69f77bL, 0x8d9fbb371f1de07fL,
- 0x1126b97be8c91ce2L, 0xf05e1c9dc2674be2L, 0xe4d5327a12874c1eL, 0x7c1951ea43a7500dL, 0xbba2bbfbecbc239aL,
- 0xc5704350b17f0215L, 0x823a67c5f88337e7L, 0xd9bf140bfeb4c1a9L, 0x9fbe3cfcd1f08059L, 0xdc29309412e352b9L,
- 0x5a0ff7908b1b3c57L, 0x46f39cb43b126c55L, 0x9648168491f3b126L, 0xdd3e72538fd39a1cL, 0xd65a3663fc9b0898L,
- 0x421ee7823c2af2ebL, 0xcba3a4b69b6ed152L, 0x348399b7d2b8428L, 0xbdb750bf00c34a38L, 0xcf36d95eae514f52L,
- 0x7b9231d5308d7534L, 0xb225e28cfc5aa663L, 0xa833f6d5c72448a4L, 0xdaa565f5815de899L, 0x4b051d1e4cc78eb8L,
- 0x97fcd1b4d342e575L, 0xef6a48be001729c7L, 0x3982f1fa31afeab8L, 0xfdc570ba2fe979fbL, 0xb57697121dfdfe93L,
- 0x96524e209b767c29L, 0x55aad0ebca994043L, 0xb22687b88856b63eL, 0xb313b667a4d999d6L, 0x7c7fa1bd6fd7deaL,
- 0xee9f4c15c57e92aL, 0xc5fb71b8f4bf5f56L, 0xa251f93a4b335492L, 0xb9bad7f9e5b07befL, 0x62fc9ac35ccde7aaL,
- 0x933792382b0218a3L, 0x7d497d2f7a15eaf8L, 0xb2f0624214f522a2L, 0xd9895bbb810ec3d6L, 0x22d91b683f251121L,
- 0xc8fe9a347247affdL, 0x3462898a2ae7b001L, 0x468bc3a10a34890cL, 0x84ff6ce56552b185L, 0xed95ff232c511188L,
- 0x4869be47a8137c83L, 0x934606951e6fcd81L, 0x1ab5e8e453bde710L, 0x6386b61b30fa1157L, 0x97f3a778e242d0cfL,
- 0xd870d281b293af3dL, 0xc3a5f903a836fafdL, 0x88bd6a24d49cd77L, 0x4e38ddc2719162a5L, 0xf48286b4f22cad94L,
- 0x80f6f650c337557L, 0x5e6daf6aae1ad59L, 0x7450f7229f336762L, 0xb75b43fb4c81784aL, 0xebd37a514f153148L,
- 0xd4b3a39e0bc52c7L, 0x562f36fae610a2e1L, 0xe0e413e555bd736L, 0xd452549efe08402dL, 0xf2e2ff7be2c75e21L,
- 0xf2385606c18aaf0dL, 0xdb609b507d8c6b8bL, 0x74ac5663c6c4f45bL, 0xd84c9a356858060L, 0x19d5b3643bc029b6L,
- 0xdd8131e97ffc842L, 0xfa7303606bfffc05L, 0xf98c6d63ff48a16eL, 0x34df46aa2d610767L, 0x83490ef054537f7eL,
- 0xe071f833e55ebfe6L, 0xd4b94537ed4a6aaL, 0x3cf85e4e333966fdL, 0xba15364649384016L, 0xc0e6bd623ca72405L,
- 0xdae6e879b8eab74aL, 0xe4a41f17e70d3e0aL, 0x56e10c00dd580f70L, 0xa9a66bb41781d872L, 0x58e42dbdffe21573L,
- 0x69450e1ce9674e6aL, 0x47fe345a350aa605L, 0xac958aa80455a5a4L, 0xbc1abca3fbeeb2f3L, 0x8f760d9228900a4L,
- 0x9e1eb8a2dfec4387L, 0xe91bd1321f5fdc89L, 0xda11a24c514b9dc7L, 0xb1f63d976e0e639bL, 0x41c11098f6123861L,
- 0x3d7736979f978f68L, 0x820685b38c926beL, 0xe8c3dcab075b112L, 0x5e37299d89089ba4L, 0xa1f735eb8235b32fL,
- 0x2289d719e7b146eeL, 0x1c9c9d0284d96719L, 0x5f8b358546775be8L, 0x317e34c009a07a39L, 0xb16b073eb0ee0a19L,
- 0x423b36fd459f2a66L, 0x5f45053666f3f84fL, 0x63e7074f03c73d92L, 0x22080cf23288e895L, 0xba4e71bf61dac16fL,
- 0x9643b3707db2cfb5L, 0x98e2db6c665e7178L, 0xcbc57de0ef3eabb6L, 0x6239a2197582a8a8L, 0xf2ae968e55fda13dL,
- 0x36e7ac11d1f3a617L, 0x508f0acb609bd756L, 0x6f42d435193a1ac2L, 0x2df2cab9d65e0b00L, 0x4584c1fde5f1ad55L,
- 0x602c500bdc8317c2L, 0xc80d5b04f6337337L, 0x98abcf971892a773L, 0x5d33cf557e6c4475L, 0x5b5a78be74ccd40L,
- 0x3ec2cce5290785f4L, 0x2eef1e9c4b36828bL, 0xdd274241a0ce8c55L, 0x3c4cb919b35c221cL, 0xc1fd68d779db9923L,
- 0x7ff345b4eb7f3639L, 0x804d5881b2eefef3L, 0xa15f9c2826cb34dbL, 0x64822b68adefa772L, 0x761e92f8d279850dL,
- 0xa5d049ab1061dba3L, 0x5f46fb02d10d2219L, 0xc1cdaa5f9ca79b19L, 0xdd713a74701ebe60L, 0x6b626ec963951798L,
- 0x1d3ec8d78b96d16dL, 0xdb885d52960e7f34L, 0xe39849cf3ea178f8L, 0xc1e37acdf807130bL, 0x3645880ebf333913L,
- 0x3af81a7bec346c22L, 0x871c563e94324804L, 0xac55fb5e2817db4cL, 0x35b04c42565ebe2L, 0x5094cafab11cbc3aL,
- 0x94d40a57481346b5L, 0xf91a8492df723e3L, 0x126a70b84f779accL, 0x4409e9a5d5c3f133L, 0xb1655339864151efL,
- 0x6564e506d11e9de1L, 0xd9a06f7b8860b488L, 0xd493e410b68b6c6L, 0x4e6fbf4b3b985a07L, 0x71c1b0ba9e52a2deL,
- 0x5775784ad3cb99d9L, 0xbab84cec312107a6L, 0xd9066f5ccd59cf9eL, 0x8c656651dbb3ed84L, 0xa7448d0059484568L,
- 0x2819237e5e8cb03aL, 0xd57eaf5239931b4bL, 0x6cd436fd5f7c1e73L, 0xf03b845f2a584931L, 0x8847b9f1f2d55b7aL,
- 0xd49a38f8e59db8faL, 0xd5052cc47685dbfaL, 0x91e060fb399ecf2cL, 0x5748fbea12dd2869L, 0xd0cee85adb889226L,
- 0xa35e9dfa5a64f56aL, 0x3118398bd0e3cbf0L, 0x5e650b9a3cb34308L, 0xf575ccbebf49b91cL, 0xb3f8dd73257c80e2L,
- 0x13d7954e8294819bL, 0x90b57ccd00f1591dL, 0xa8b13ef52ca7e284L, 0xe482d24e5b239833L, 0xb0648475f2b4d63fL,
- 0x847e8fc889e2389bL, 0xa8b501ee1fc59ba6L, 0x29702f6acba4379eL, 0xfaba9600f3d2cd0fL, 0x52ed7d9f45c6b578L,
- 0xa02b167546d6e2d0L, 0x9a41cb166618a390L, 0x83d464d7349d9f3aL, 0x805485c9d2c70c6cL, 0x332f7ce3e077ecceL,
- 0x1ead372c068ebb04L, 0xd6866c5b3b5eb82cL, 0x5b057c64bda94a33L, 0x11e1388f59653c66L, 0xffd2aca771c0abb8L,
- 0x2fabdd0e8e8ba606L, 0xe974ffd57219e5e6L, 0x2b4e5c1e5f98e506L, 0xe7819b2cb44db4c0L, 0x6cbd78c408376520L,
- 0x244285f39307f083L, 0xd152927f3a3af853L, 0x5b799885a8ba66e3L, 0x9300da64ea1a0644L, 0x67399bf8688a0cabL,
- 0x47c301af4a94bb2L, 0x6750ecdf35c8471bL, 0x7598ae5c876d4080L, 0x269e0cf307467534L, 0x2ef4d8dcaedbc549L,
- 0x2c6983c911c958afL, 0xb2fd7c07ae0bfa60L, 0x3220a56d67450e80L, 0x7385883420eb9f69L, 0xdb1fd2951f15b047L,
- 0xf08b35df55977bcL, 0x42939b9f2e58127eL, 0x4d1d77e72414aa9aL, 0xfd8137f8b59bd084L, 0x167cc7f46a511504L,
- 0x263de0c6b50290dL, 0x2a1c2feb488ffab8L, 0x1194815038360d85L, 0x36374630d0ecb4e8L, 0x609d38e22c59a974L,
- 0xee23867f7c9b5f54L, 0x40e53a7804b0ef15L, 0x8f287f1a3be6e458L, 0xba7334b0f0af9e75L, 0x9f003e8e0e9c6c0L,
- 0xc02dd0d35c42bc56L, 0x63dca83acd6be04aL, 0x9617b58a79fdd826L, 0x563d25e6f891bb33L, 0xe3c3d3f3f6d58588L,
- 0x359977baa315b1b4L, 0xdf431301d9e6bc5L, 0x4074bb10d0003ca5L, 0xf440159140f2b453L, 0x3a6cc6e14820f5e2L,
- 0x4b352bdacf3a37c4L, 0x9ef3b8df89ea4c29L, 0x8a1b2495a1414892L, 0x670b7f423f78b7c9L, 0x7513c7ccf6ee3c3aL,
- 0x9ba96cb53c24408bL, 0x3316c3dc4ec859f0L, 0x501337e1a7f1e218L, 0x9a1544a6029c1eb5L, 0x9b43b15859c3e96fL,
- 0x58011e22698bd4bL, 0x589b8eaea60d54a4L, 0x68ccb8c6cd7ec24dL, 0xe55beb5896455705L, 0xba6069cf90a8f1e2L,
- 0x896a18c3eb90a6d6L, 0x870d3d80ae0b9323L, 0x48688d8b457f501bL, 0x8f1a8c1b84b3ba62L, 0xd1b7b64dc136f6b3L,
- 0x3c6a7025428547e9L, 0x199bcc50a190fb6fL, 0xa5de0eed4bda0979L, 0x31041667821cddb5L, 0xe9df34e2678fb4e3L,
- 0xdd7222eaee54e524L, 0xaae6488b26c7af56L, 0xe8a560dbbd2eb6b3L, 0xe37c99a7f5defceaL, 0x1572be8d78f3afacL,
- 0xf69ffb64131633aeL, 0xa837ae34963616fbL, 0xaf0a9f03d137c170L, 0xd3e02b464018a48L, 0x11753aea03bb0ecdL,
- 0x32d9cca610dceb34L, 0x2622bb6a6e7a11e3L, 0xdc99a44c515ec8b3L, 0xd7d720ad0a770b28L, 0xe322f742d6d051c2L,
- 0x745f2b6e3ea9cd2bL, 0x951f21478e6b9662L, 0x227f21d8c0713385L, 0xcb729235e6876eeL, 0xd323b857d9721a53L,
- 0xb2f5f599eb743346L, 0xefb30babe65a283L, 0x94c1190da321d470L, 0x117c63209fba9efeL, 0x738cf92baa4bc2cdL,
- 0xc3bdd29b33277165L, 0xd78a2fab38f6dc46L, 0x35c44aafdefb91e2L, 0x321e26bf321fb60bL, 0x12db436288b37172L,
- 0x158a2d49e51c261aL, 0xc9202ac8ba71c873L, 0xd02fa93dc97cc7b7L, 0x1f8bd11b747e901eL, 0xf7a17b2f74aa321cL,
- 0x284d02d7552a3e90L, 0xeb86a8251533c574L, 0xb3fd774eaf4e77f8L, 0x31df2951c3ff37b1L, 0x86e38546195a69e7L,
- 0x6737aaf165a1389aL, 0x2e2e925079feee0fL, 0xf7bd5a988596c1bbL, 0xccf835db6a10d2dfL, 0x6f42700f37c94701L,
- 0xa6e86f7ba2779a5cL, 0xa43a4f7036d1ec2L, 0xd798bd6d52ad26daL, 0x218f6912af38b818L, 0xd48684f266f2e186L,
- 0x8f675048b7b012e5L, 0xe5e469aac68eaf1dL, 0xe2740035697de79eL, 0xc22d6bd6d08baf1dL, 0x341774636bdc8f41L,
- 0x7dfc6b73f7ba322bL, 0x7566343607bb525bL, 0xae94d116ccf1e74bL, 0x6ca1b59934cc2697L, 0x4c2fb1c45b749cedL,
- 0x989999bbdd2ec893L, 0xcc4e27afa81bc8a8L, 0x6ddadf15ebf85830L, 0x38fa9cb2ce72bc16L, 0xacdaffe39db4bbdaL,
- 0xbcc4682ebd095d93L, 0x483f539d354559adL, 0x45de92e997e2915cL, 0x7ec5c881c5344a55L, 0x9d1844fffa091545L,
- 0xcd9b08d4dcda27baL, 0x1f7495a5f36c34ceL, 0x4f0fc9647d99afd7L, 0x5ac375ec59321cf2L, 0x5c07ce6df7e1d9a2L,
- 0x49f211880d688b4cL, 0xf85fdd8ccad0867aL, 0x7d510164d8f197a8L, 0xc64108c5732cfa0eL, 0xb262d660d3a2c648L,
- 0xd5d5614571dd2efaL, 0xec1a6d0dd5d5391L, 0xbf07d939d2535f02L, 0x35bce3021e51045L, 0x423ae115ec99d154L,
- 0x22ea1d3abd893838L, 0x517fc1107eaa6a83L, 0xc5967cdf353aeac6L, 0x96ae2c3dff65ce6L, 0xab1b908b97dc911bL,
- 0xf3d84c286f22611cL, 0x256823815030d8a2L, 0x3bd9b119887342e4L, 0x59926f3401f437d4L, 0x74edf41038d3986fL,
- 0xe2b35bf615038253L, 0x4d09740a6b44db89L, 0xa37edaf089c0eeabL, 0x8263ba2c23e2d62dL, 0x8784aff57d390c3cL,
- 0xfb49ab0635d66c3aL, 0xdeba73c2562bff1cL, 0xe2e6bf8cb6e29717L, 0xe70431c63d86e46L, 0x20d717e16aae6010L,
- 0x31af57cdcf2cd36L, 0xd55fbeef1c5357feL, 0xd361d871f4e393feL, 0xb3416e718d32d214L, 0x7b351f93f909fc00L,
- 0x16916de7b96a26bdL, 0x4fec1248b5dedb65L, 0xfae1aa9a62bfa096L, 0x92e7910a6b0084a9L, 0xd12bba8672e8aaa9L,
- 0x316558d69efc8f6bL, 0xb0dde29eb96fee87L, 0x2125a2be5bf67eb3L, 0x5905903f46531fe4L, 0x2a9927e8175ff60fL,
- 0x794376f2bb5d6d96L, 0xfa9f65d2b4848b12L, 0x2b92665a263a5091L, 0xabcaccfab8464c65L, 0x5b2fb2a46d1a0bdL,
- 0xa879920d28c0d54cL, 0x50394088a8ea4953L, 0x61b0c87f0084129dL, 0x29ebcd1078d6e2b0L, 0x2440c652f6bacf89L,
- 0xbd74d596cf4c8eb1L, 0xe4b009e5c334766bL, 0x7db26843cf72cb8L, 0x4171d5edd5468876L, 0x608d5c2c348c143cL,
- 0xa19e0a2b81da6eb5L, 0xb65a7be9354c1390L, 0xf4f4c437cb9bb324L, 0xfc24806650c823bdL, 0x4c2331521e7f2966L,
- 0x54f66e42eb73bafeL, 0xf06c11f3d2fe29aeL, 0x8ba8d0f28cbb0fcbL, 0xf3617850d1ae7976L, 0x96463b47cd9a7286L,
- 0x8edc2133b35c3779L, 0xae43f70f181d9371L, 0xe7628d75c9a3c2e7L, 0x978499ba4193b333L, 0x99bb4bf79b0a46c1L,
- 0x4c52676d7e4d0a58L, 0x2064ee3910693deeL, 0xfc43514d16633997L, 0x1bc1741ce05c4cceL, 0x6e9588d40f3396f6L,
- 0x146fe816bb3a3708L, 0x2b3db8ee05eefa87L, 0x6ec21a91189ec0c0L, 0xa8a907b34108faf1L, 0x708b80912235684fL,
- 0x2bc8ba70edfe680cL, 0x4d118826481266efL, 0x8f93a3a5de887175L, 0x3308e9133a950fe3L, 0x939ed8b0d7e91f87L,
- 0x666beee64002b6b0L, 0xc8f129ec69ce7811L, 0xd57593c68ce93ea0L, 0x2d6a3e66edcc862L, 0xbe1d00d16a2271a6L,
- 0x34fbeaf95e0c673fL, 0x9845ab59483a0e86L, 0x257d47d5abf88962L, 0x28af39f39319545bL, 0xe3fce03abd8171eeL,
- 0xa4c5f606dccc96f1L, 0x4d414846267c4962L, 0x6ccf77f81d9dbf70L, 0x947bf43c729a71ecL, 0xfd656c39c4fa824cL,
- 0x8f652cf2d1e04fd6L, 0x8cb11929a65b6aeeL, 0x94948f16a8064daL, 0x7434e703a4d03d5fL, 0x9361d3f63af4aa35L,
- 0xa998c1eeec3fb422L, 0x51eb94754b5992a2L, 0x6e109c0347ef6979L, 0xe3c9738d67c582e2L, 0x9c735e3857ec57bfL,
- 0xbe6415659e12c64bL, 0x73924584e31b9099L, 0x8f676821e60b0945L, 0x5614e3a695d5289dL, 0x7ecd448787517ebaL,
- 0xc96db02038dbaf5bL, 0x69299ed774fa6c8L, 0xb4ace5a8ea16ac8L, 0xbf2f4f23a6c92295L, 0x90bdc4f1e931656cL,
- 0x7cd5b0b95ac34d3aL, 0x2032bc59d3dc1710L, 0x702c1a0cd5609379L, 0x609d33abc01ff3feL, 0x8ae5d8f283b2748bL,
- 0x2cf3778fa7eaae1dL, 0xe8a0d7b1919df9e3L, 0xe487894f6d602a0bL, 0x929858549609626aL, 0x46e540cd86bf46e7L,
- 0xd1daf4382128d9eaL, 0xc47239c06b22ef75L, 0x8b7aad8ffea1b991L, 0xd6c1d2e315273fa0L, 0x2fda11cd74177e6bL,
- 0x333cb0a145919fd7L, 0x5970b31a49f37b16L, 0x7890bc68793bb959L, 0x2a060f45a1719347L, 0xeb298f0264bf379dL,
- 0xd7c4fd7921707400L, 0x374635e7713ed165L, 0xc60c008df0296d05L, 0xbf13739a8d3c7dbbL, 0xbfb945ef1cf94d1dL,
- 0x75fe953c3a3a8315L, 0x9f83064f4150c02L, 0x6784a3b452055343L, 0x73ed26d185738f51L, 0x6c59094e8c998390L,
- 0xeade93e19d60d4b5L, 0x8cf7cc8e62bc869dL, 0x22f85626f7f69298L, 0x6679c449ac22edc0L, 0x7017d0003e897435L,
- 0x308fc450a6c62bf8L, 0x2578b45bc6f34cabL, 0xcbb936c9d253db39L, 0xc4e70e5bbc5e002cL, 0x29db6985be6c9459L,
- 0x96afe876f5f6250cL, 0x829f766f138f95e6L, 0x4369632017c8fa0dL, 0xda90c817ca890a2L, 0x38d160dd675e2376L,
- 0x20df15ad986408eaL, 0xd192623c3d9b3f41L, 0xd846f79123baf4aaL, 0x6cb058a0edfbf056L, 0x1b192f0be8dc77a7L,
- 0x3a11b3dfcc81a441L, 0xe914410093ad7767L, 0x3126257e578bdf60L, 0xd5d5e470410cb6eaL, 0x4e1bf5d4209248aeL,
- 0xe1e4c2924f35192eL, 0xac9944825cb7ef5eL, 0x8d2cbe6996eb3475L, 0x1bc05d2a079592d7L, 0x564a9f06755e71f3L,
- 0x9bb767d68e9f2537L, 0xe4b045acf13978a2L, 0x4b7519cb9028ac83L, 0x9df655284198b85cL, 0xdc32ab4d421a2b61L,
- 0x4c5d7f5323c1960cL, 0xe4273ff318f5c7b3L, 0xd73ef5ea88a3e99eL, 0xda2ffb6a863c850bL, 0x9555a4144e05ad82L,
- 0x950104dc15092ebfL, 0x39d121a61f19dbfeL, 0xc6804e29d60d7814L, 0x7e98bec5ba17d58bL, 0x8b2c6b0e6c3b749aL,
- 0x301a07c84aaccdbL, 0x93dee719932225a3L, 0x381611a50bac0ae1L, 0x572a8816f6e407b4L, 0x420efe85aa75232L,
- 0xc1f53f78b9ffcf4dL, 0xbeda53bc95b96ec3L, 0x9f357114059c8eabL, 0xe38239260b584150L, 0xccbca17f4eed2ad0L,
- 0x1528080b61f54198L, 0x5b8cdc4c40d49f30L, 0x1617db48eb6640d0L, 0x6fed27f88a516c99L, 0x37056e05b4724179L,
- 0xec7bc122da9538d8L, 0x9fbfe01ca2c0fd57L, 0x2fc96b31dccafd9fL, 0xe26a72009daa1249L, 0xe9fb2e3998d16a25L,
- 0x4a87dc39d24133aeL, 0xd5340e98fde806deL, 0x272b62b5dd0d7fe3L, 0xca4625581bf9dbe1L, 0x8677af77de374a90L,
- 0x27dbec9e28f857edL, 0xb4aefc44d036612aL, 0xcf2e8ebdb0f6bb11L, 0x76023506c94e0532L, 0x864e72d4488c7a7aL,
- 0xb81058fdac18fd3L, 0xdf93ee5b6674a0f4L, 0xdb30565511789d77L, 0xcf5fe22dc0375f30L, 0xa6e62e6e4edb4043L,
- 0xbce383957a728669L, 0xfe4dd4e9633db2c6L, 0x24e68818b2a6d6cdL, 0x48a89c5424b4cdbL, 0x7fc7bc75bbbe5768L,
- 0x79596343191e0ff2L, 0x5510b9cd8306839fL, 0xff2668b4eae7bb53L, 0xb4c03e6363c9e244L, 0xc9e3c0c1c015eb6fL,
- 0x52531f5f898a744fL, 0x484005b2a805083L, 0x31673b70c6f23c53L, 0x5bffe158f323a7c2L, 0xc742bc0d0c55f125L,
- 0xd95c32fe7e18379dL, 0xc1f2f613ee3c2e21L, 0x3217a43ff0daaa0eL, 0x3a9fa27258257e53L, 0x80b42af5a393bcf2L,
- 0xb6967fd6a302f65eL, 0xfdc07bc592dbb125L, 0xcb83b8b9f64c3c3bL, 0x9cb572b041015355L, 0xc12dc512aedc530cL,
- 0xc8db824276c083ceL, 0x86923b0e2903627fL, 0x1385cf2be22827cdL, 0x21b7616ced869ef1L, 0xc74d497d079901e6L,
- 0x9e03c843bb13f658L, 0x915b89077a81ec7fL, 0x288a10b00768d244L, 0xd88eb6745a557569L, 0xb3c98071a3d13b20L,
- 0x8f23aff44d352f03L, 0x2bf39ca10e45bdbbL, 0xf1bea47e2c68a4cL, 0xf8d5ab01c1ad6b55L, 0x679e0601953d1e31L,
- 0xd793f3aacb3c520fL, 0x96fc350ccdb76eabL, 0x9fa0178362df447bL, 0xc11c63febf83598aL, 0x3aa88df3a1a71323L,
- 0xab2f8338a09ca82aL, 0x32a2133050a71357L, 0xffecf97ca3ff65e1L, 0xfb6fd13318f5cb79L, 0x3acf76875acad366L,
- 0xc577ffff529f74cfL, 0x368a90182031dd12L, 0xafbf2311ad656d52L, 0x80cd4f9f23fcafddL, 0x451717a061972d1fL,
- 0xbbcbdae779cfbf3L, 0x133ca541293fd40dL, 0x6f241a21fc40b108L, 0x9adecbcf0c28110bL, 0xfab528d93bac6d3aL,
- 0xf4ea3d459b0654aaL, 0x7e2e9ef35a5aafbaL, 0x28730469eded0fc7L, 0x3cbae97a12632fbeL, 0xded6960c0be007a8L,
- 0x2a11758a7c52c43eL, 0x289de4875bda262dL, 0x6e13eea58caf3fa7L, 0x20c8ed0d5d673c1L, 0xdb4b3e7719d523b6L,
- 0x49143c819d111fc3L, 0xe07479f9ddf45d8eL, 0x68f4654bcc07435bL, 0x513bd537af510064L, 0xcf956c3a3933ba38L,
- 0x97e1eaa33f88eeccL, 0x18be860a2504a1c5L, 0x84408412fc0bf397L, 0xb6bdba7e154bdf7L, 0x1d8f8b446b544be6L,
- 0x6f06b3dcdef17a03L, 0x30c6e14df59f8cefL, 0x1c97ba9910219cfL, 0x33ddcc087d1aeb5cL, 0xe31b94300cfbcbcfL,
- 0xadeb8a98786bb28L, 0x3f69d5b0e3ec8f17L, 0x99f5a15f635296a6L, 0xce9fac7526862e86L, 0x3a88964201bd7524L,
- 0xec94d643ea71be51L, 0xc4257084d97ab1c5L, 0xf369b10a73b4d382L, 0xac02bb473dbc5fd1L, 0x4fe73a86d95d7222L,
- 0x858806616fe3d553L, 0x10680debcb0693e4L, 0xcaa9aac77c954093L, 0xf29c7530415d71e5L, 0xc32b319e09de9e48L,
- 0x1c67107ed497ebc4L, 0x731da71593324021L, 0x49774770588c055aL, 0xf978dfdc28084220L, 0x58b3f2780b5a7ecL,
- 0xe4ebf2ca21410715L, 0xd3841ed97708421fL, 0xdbc9401dc51eb4eL, 0xf47a96de499aa2e1L, 0x224da94d8542ba0cL,
- 0xa3426a80b4dd0a4aL, 0x857caef48ef7e5b6L, 0x11356ad6ede44bf5L, 0x1a32471bd26acd7aL, 0x199396e31de7b358L,
- 0xb7ca7950dbbb4a92L, 0x6ab23720409790a7L, 0x2abfdb93a3159d10L, 0x23913b403946c4a7L, 0xac7c9f339a822344L,
- 0x12cffe9625cbe744L, 0x89558b98548b1946L, 0x77be65945c191139L, 0x3ba8d1fc701f4347L, 0xb143664560327f20L,
- 0x48baccc3ef2081ffL, 0x450c379d24beb8e9L, 0x1990b609485db827L, 0x6c6a565d7129ccb4L, 0xf9724a82872bd619L,
- 0xcfe629aa56717e20L, 0xfde48d87e844ec93L, 0xb32f79e5dc9ce4c1L, 0x7c9d88364238519fL, 0xe943aceba65150f9L,
- 0x5301e8550cbdd076L, 0xabb8392364453b3cL, 0xdfb4b4a3cf84aa2dL, 0x269e45f7a6b48a42L, 0xd6783043ab383fcfL,
- 0xe4ec475d296a69e5L, 0xe2e273ef65555361L, 0x6bd3084210a75af7L, 0xf2ebc493b909d8c7L, 0x4d20f3d435e9bc94L,
- 0xa465e41c3c36d433L, 0xc1b259456f4341c0L, 0x260093703d6cf2ebL, 0xda68d9dea0aa9bdaL, 0x5662a12a210b2a47L,
- 0x54675bd1a1b4b467L, 0x9dbd416302ec2468L, 0x3c7130a5032d823aL, 0xabfdef2d9a4fd92fL, 0xd4034e276021451fL,
- 0x13834d3d0e43ab73L, 0xdc181442b438b2d6L, 0x1736ffb392c25e23L, 0x289b94003a946252L, 0x99705629b221ca37L,
- 0xa7b22a5bb26775d6L, 0x2dc12f9f04435661L, 0xaadd48b556bc9e7cL, 0xf6992e8e94b68a49L, 0xd50420466c9456e3L,
- 0xea8305ecdfb1266L, 0xfe0b1d7e4f0ef297L, 0x563de834c4e56a46L, 0xc62b8099b5b264c6L, 0xf6e76aeaf533c784L,
- 0xd4680470b790968L, 0x288a50754707431eL, 0x8ad167ed38df547eL, 0x9052fed81a8ca4faL, 0x5975ac56f0548ef1L,
- 0x588bf7d0130111aeL, 0x9ec02036a6688a24L, 0x8c9a454af9e09984L, 0x333ee6727bd12dcbL, 0x9847468f925dc38cL,
- 0x446ed5203696abacL, 0x71fddf9ef5b5def6L, 0xd4d61614cc333541L, 0xd08a0694cd7f72a7L, 0x686cfe3ea1889281L,
- 0xf039404e0dd3333fL, 0x52c620eb18b4246L, 0x4e4de47f86d84713L, 0xfe0450396b209851L, 0x99d6e893b01ed92bL,
- 0xd94cf8705f8eba86L, 0x763451110c00291bL, 0xdf4f60b9aa45d064L, 0xf473d4bfd86ad526L, 0x41b9e3fa1a6dba94L,
- 0xbaa7cdeb00796a4aL, 0xf668194c40626450L, 0xb894e0ae40a9c87fL, 0x5bc1eea8587d3ddbL, 0xc4c0ecb91bb50d75L,
- 0x819fdfd17ff2917bL, 0x681484e54b6b12f7L, 0x2f510aa2f8977995L, 0x7d1582a293b8fa3dL, 0x3dad5a0f0da45470L,
- 0x33c113aefb480520L, 0xbd524b2da7ce6c1fL, 0xe4cc051d00d8ddc0L, 0x2995950e206efa90L, 0x8b0e5dca588e3f50L,
- 0xaabb3583f7f87082L, 0x75dbbecfa34cb4d6L, 0xf195977068849ae8L, 0x9223ca6fbb72767cL, 0xda7211029d59f04eL,
- 0x18d9987c6566405cL, 0x57833aa39ef75a04L, 0xd1750e36481f654bL, 0xce2b66bc8796acbL, 0xc7e79aa76c96b057L,
- 0x68f95b6b3c5cdc1dL, 0x2f5725cf5fc583aeL, 0x6b973013fd4484a6L, 0xaaeb2687f2d8bb96L, 0xad29cce061ba3934L,
- 0xcb60dd1c437eb1d9L, 0x5cd6f46b78181bb4L, 0x1561cdc95ace24d9L, 0xbb774e6705806245L, 0xdc29c8df29b2e975L,
- 0x6ee5ba502839dccdL, 0x670869bb64c60f69L, 0x8ca2931e927ae7L, 0x35cf6c0a27d8de77L, 0x94a3d86209af3920L,
- 0x4095a276475df5b7L, 0x1119e4c257ccf7fbL, 0x33376166d9064fe8L, 0xd68c2399f968b905L, 0xb7bf2902f40fc101L,
- 0x4ec18604cfd551e0L, 0xeb8e7fe1b6678e99L, 0xdcfe68fc0e042fa6L, 0xd2e58dfb1a8e3866L, 0xf4322bc57fb9a35aL,
- 0xe0c665c8cf1fb49bL, 0x60de1f1050684297L, 0xf400c04cb00784cdL, 0xfc2a216f12016984L, 0xa808b477fd65fb4aL,
- 0xd9b614adfcb5d0f1L, 0x50afdbc66e3efad2L, 0x82337b3f1764851cL, 0xdc98850eb93ef45eL, 0xe1c314bbc2c6af27L,
- 0xd35614ba27e74a71L, 0xa5d592e04a31bb6fL, 0x3f143cd0bc243fbeL, 0x81641ac25408b21L, 0xd4166b32a26fc1c6L,
- 0xccd088ee4d4a1f67L, 0x698c913d46c1ec99L, 0xf6b9086a5b986abL, 0x4a73c05ef72e3595L, 0x307aeeb350ab081L,
- 0x43e20045bcb06b0eL, 0x3f58d1d6cd3aa0dcL, 0xd71cd7c996faba80L, 0x4431d8268eebfb71L, 0x254246df109e3dd5L,
- 0xa7ca1449a238b06aL, 0x49b40e7b082493e7L, 0x45d80e6bd330d613L, 0xaf3d8a578b6d6232L, 0xa4b98341785262d1L,
- 0xf4f1f424af963102L, 0xa84a986395146774L, 0x90da037fb61d5c88L, 0xb645534b2cf5b89fL, 0x3fdb3073310934b4L,
- 0x1a0307d01f57f514L, 0x509c9b87a4a1e66cL, 0xbf320cf0888d8aa8L, 0x45a51f76c5f76892L, 0x23eb7a2b99a64402L,
- 0x4c600e5675dd7757L, 0x4896757aa01a5c34L, 0xb808dbbda7a8a1daL, 0x762c21058ba50349L, 0x99b0a9d5deeebb37L,
- 0xd6d98ef70a1e465dL, 0xb052f2c1163894f6L, 0xc55e73526f8bc8faL, 0xb31a0537f5b3b269L, 0xf09c1819c0c7f78aL,
- 0xc36d4e2187e430f8L, 0xf141831a47299c7bL, 0x62f938047903ef34L, 0xf2a0dd678f92e0a5L, 0xc7fe6a53efaaa65L,
- 0xcc539fcdcc466310L, 0x55199357cdc55491L, 0x6917fb45babb399eL, 0xb098da3c7b012b1aL, 0x54916438f426c41L,
- 0x1a5ff3356d77d43bL, 0x74e71995e0aacf1aL, 0x6562a8da6b5e69eeL, 0xacbc2b8d1fb16ea8L, 0x400ea8e1f3f5535eL,
- 0x2ea792dad3a4538fL, 0xf580fe481db60b5cL, 0xcb101198dd0aba9fL, 0x259acbe0461cb837L, 0x30033c3964b56a40L,
- 0x6c15d4283eeb6fa6L, 0xdea7b626998ea3eeL, 0xdbb2e1b8c0c2abdbL, 0x3a856a6742b6edc2L, 0x777ed6b1683f48bL,
- 0xde72fd7d6db3bb63L, 0xc8766969b599dc68L, 0xb39a5b76dce26160L, 0x97464948ce81d8a2L, 0xae20fda5af404ae6L,
- 0xde1100c4f1ae3265L, 0x5a94d43bf60f574L, 0xc087a2116f52d0fcL, 0xfacb3be87e615d89L, 0xe184cb9fba7b0feL,
- 0x824779bede6d84ffL, 0xa0852e96875da152L, 0x620046e8ba89baefL, 0x247c32c5f34b08ddL, 0x49294468356e7298L,
- 0xaf6d6e0f8b5009ebL, 0x8c25bfcdb8abd77fL, 0x4f5464a1bc417e38L, 0x2df8fbe8993f8c9fL, 0x6540566281dd6d91L,
- 0xb90690dcfb03a83L, 0xe270b7c7f8fab463L, 0x898ead41792a7f87L, 0xa1b1248822b7c292L, 0xfa2c0d61dd383eabL,
- 0x5574c091830bd677L, 0x43640e20702986e5L, 0x622d0a1c860d0302L, 0x9528ea0051990eb9L, 0x28f057ef30af388fL,
- 0x88320e974a2721a0L, 0x8a12cb33cdd88b60L, 0xd91a9763f991780dL, 0xdf22e332867c0e97L, 0xad95801b6c801f10L,
- 0xb34e21d4afe2c4a0L, 0xd5465bf172494dd3L, 0x16594af34f1b5767L, 0xa675dceaee1591e6L, 0x53db891db5e1d768L,
- 0x39a80f5d365c71afL, 0xdce01c73eac54372L, 0x1087fb03e5ce69e9L, 0x67cac3905594378L, 0x275d24c9aa1607f0L,
- 0x9163a77a53e361b8L, 0x17d10f8254fa7f0bL, 0x49efeab6642e9e45L, 0x376e24839b1df1beL, 0xc46221cc408546fL,
- 0x98eb5bb7001ebf5cL, 0xc6c4d56e3c9a78efL, 0x23c0723e123a899L, 0x145912ec44b57548L, 0x488a34fe824ff4c3L,
- 0xac3bc6de9929c707L, 0x1dbac6e98813a70fL, 0xf566054941858266L, 0x18e0a3a2a8b8f2f1L, 0xcc6245a26564a399L,
- 0x14416ca0e1a84a9aL, 0x4eaf095631a6e7bfL, 0xf2f89f104c9d0b8dL, 0x8fb278a5953e52d8L, 0x8fcee83a30a8be30L,
- 0xb66850da1a0ceb33L, 0x5f37d31bad76f4dcL, 0xff4d956ffea8dea4L, 0x78c583b396635b3L, 0xad268fb5b1105028L,
- 0xa480149a0dcbc5f4L, 0xb0e8d69c8b15c864L, 0x6ed49c46f19bb8eaL, 0x7f1871fdf321818dL, 0x1ec5816f5a9843eaL,
- 0x77c8da91b5313675L, 0x4cdb66ad515e0717L, 0x2ec4712b0bfdfcd6L, 0x6c6f5767fff27330L, 0x71083b972d80c0cL,
- 0x8d8325e82c4fdcdcL, 0xb47a658dad8e13a4L, 0x88710bf005fda027L, 0x69bd3edaf7111200L, 0xdccdd0c65c810ffL,
- };
-
- for (int i = 0; i < refLong.length; ++i) {
- Assert.assertEquals(refLong[i], rng.nextLong());
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source64/SplitMix64Test.java b/src/test/java/org/apache/commons/math4/rng/internal/source64/SplitMix64Test.java
deleted file mode 100644
index d2d980f4f..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source64/SplitMix64Test.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source64;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class SplitMix64Test {
- @Test
- public void testReferenceCode() {
- final long refSeed = 0x1a2b3c4d5e6f7531L;
- final SplitMix64 rng = new SplitMix64(refSeed);
-
- final long[] refValues = {
- 0x4141302768c9e9d0L, 0x64df48c4eab51b1aL, 0x4e723b53dbd901b3L, 0xead8394409dd6454L,
- 0x3ef60e485b412a0aL, 0xb2a23aee63aecf38L, 0x6cc3b8933c4fa332L, 0x9c9e75e031e6fccbL,
- 0x0fddffb161c9f30fL, 0x2d1d75d4e75c12a3L, 0xcdcf9d2dde66da2eL, 0x278ba7d1d142cfecL,
- 0x4ca423e66072e606L, 0x8f2c3c46ebc70bb7L, 0xc9def3b1eeae3e21L, 0x8e06670cd3e98bceL,
- 0x2326dee7dd34747fL, 0x3c8fff64392bb3c1L, 0xfc6aa1ebe7916578L, 0x3191fb6113694e70L,
- 0x3453605f6544dac6L, 0x86cf93e5cdf81801L, 0x0d764d7e59f724dfL, 0xae1dfb943ebf8659L,
- 0x012de1babb3c4104L, 0xa5a818b8fc5aa503L, 0xb124ea2b701f4993L, 0x18e0374933d8c782L,
- 0x2af8df668d68ad55L, 0x76e56f59daa06243L, 0xf58c016f0f01e30fL, 0x8eeafa41683dbbf4L,
- 0x7bf121347c06677fL, 0x4fd0c88d25db5ccbL, 0x99af3be9ebe0a272L, 0x94f2b33b74d0bdcbL,
- 0x24b5d9d7a00a3140L, 0x79d983d781a34a3cL, 0x582e4a84d595f5ecL, 0x7316fe8b0f606d20L,
- };
-
- for (int i = 0; i < refValues.length; ++i) {
- Assert.assertEquals(refValues[i], rng.nextLong());
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source64/TwoCmresTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source64/TwoCmresTest.java
deleted file mode 100644
index 8505e6bc6..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source64/TwoCmresTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source64;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import org.apache.commons.math4.exception.InsufficientDataException;
-import org.apache.commons.math4.exception.DimensionMismatchException;
-
-public class TwoCmresTest {
- @Test
- public void testAsymmetric() {
- final int index1 = 2;
- final int index2 = 5;
- final int seed = -123456789;
-
- final TwoCmres rng1 = new TwoCmres(seed, index1, index2);
- final TwoCmres rng2 = new TwoCmres(seed, index2, index1);
-
- // Try a few values.
- final int n = 1000;
- for (int i = 0; i < n; i++) {
- Assert.assertNotEquals("i=" + i, rng1.nextLong(), rng2.nextLong());
- }
- }
-
- @Test
- public void testSubcycleGeneratorsMustBeDifferent() {
- final int max = TwoCmres.numberOfSubcycleGenerators();
- for (int i = 0; i < max; i++) {
- try {
- new TwoCmres(-97845, i, i);
- Assert.fail("Exception expected");
- } catch (InsufficientDataException e) {
- // Expected.
- }
- }
- }
-}
-
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/source64/XorShift1024StarTest.java b/src/test/java/org/apache/commons/math4/rng/internal/source64/XorShift1024StarTest.java
deleted file mode 100644
index e9f2fa727..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/source64/XorShift1024StarTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.source64;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class XorShift1024StarTest {
- @Test
- public void testReferenceCode() {
- /*
- * Data from running the executable compiled from the author's C code:
- * http://xorshift.di.unimi.it/xorshift1024star.c
- */
- final long[] refSeed = new long[] {
- 0x012de1babb3c4104L, 0xa5a818b8fc5aa503L, 0xb124ea2b701f4993L, 0x18e0374933d8c782L,
- 0x2af8df668d68ad55L, 0x76e56f59daa06243L, 0xf58c016f0f01e30fL, 0x8eeafa41683dbbf4L,
- 0x7bf121347c06677fL, 0x4fd0c88d25db5ccbL, 0x99af3be9ebe0a272L, 0x94f2b33b74d0bdcbL,
- 0x24b5d9d7a00a3140L, 0x79d983d781a34a3cL, 0x582e4a84d595f5ecL, 0x7316fe8b0f606d20L,
- };
-
- final XorShift1024Star rng = new XorShift1024Star(refSeed);
-
- final long[] refValues = {
- 0xd85e9fc0855614cdL, 0xaf4965c9c1ac6a3dL, 0x067da398791111d8L, 0x2771c41db58d7644L,
- 0xf71a471e1ac2b03eL, 0x953449ae275f7409L, 0x8aa570c72de0af5eL, 0xae59db2acdae32beL,
- 0x3d46f316b8f97301L, 0x72dc8399b7a70957L, 0xf5624d788b3b6f4eL, 0xb7a79275f6c0e7b1L,
- 0xf79354208377d498L, 0x0e5d2f2ac2b4f28fL, 0x0f8f57edc8aa802fL, 0x5e918ea72ece0c36L,
- 0xeeb8dbdb00ac7a5aL, 0xf16f88dfef0d6047L, 0x1244c29e0e0d8d2dL, 0xaa94f1cc42691eb7L,
- 0xd06425dd329e5de5L, 0x968b1c2e016f159cL, 0x6aadff7055065295L, 0x3bce2efcb0d00876L,
- 0xb28d5b69ad8fb719L, 0x1e4040c451376920L, 0x6b0801a8a00de7d7L, 0x891ba2cbe2a4675bL,
- 0x6355008481852527L, 0x7a47bcd9960126f3L, 0x07f72fcd4ebe3580L, 0x4658b29c126840ccL,
- 0xdc7b36d3037c7539L, 0x9e30aab0410122e8L, 0x7215126e0fce932aL, 0xda63f12a489fc8deL,
- 0x769997671b2a0158L, 0xfa9cd84e0ffc174dL, 0x34df1cd959dca211L, 0xccea41a33ec1f763L,
- };
-
- for (int i = 0; i < refValues.length; ++i) {
- Assert.assertEquals(refValues[i], rng.nextLong());
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/util/NumberFactoryTest.java b/src/test/java/org/apache/commons/math4/rng/internal/util/NumberFactoryTest.java
deleted file mode 100644
index ae9bc8d6b..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/util/NumberFactoryTest.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import org.apache.commons.math4.exception.DimensionMismatchException;
-
-/**
- * Tests for the {@link NumberFactory}.
- */
-public class NumberFactoryTest {
- /** sizeof(int). */
- final int INT_SIZE = 4;
- /** sizeof(long). */
- final int LONG_SIZE = 8;
-
- /** Test values. */
- private static final long[] LONG_TEST_VALUES = new long[] {
- 0L,
- 1L,
- -1L,
- 19337L,
- 1234567891011213L,
- -11109876543211L,
- Long.valueOf(Integer.MAX_VALUE),
- Long.valueOf(Integer.MIN_VALUE),
- Long.MAX_VALUE,
- Long.MIN_VALUE,
- };
- /** Test values. */
- private static final int[] INT_TEST_VALUES = new int[] {
- 0,
- 1,
- -1,
- 19337,
- 1234567891,
- -1110987656,
- Integer.MAX_VALUE,
- Integer.MIN_VALUE,
- };
-
- @Test
- public void testMakeIntFromLong() {
- for (long v : LONG_TEST_VALUES) {
- final int vL = NumberFactory.extractLo(v);
- final int vH = NumberFactory.extractHi(v);
-
- final long actual = (((long) vH) << 32) | (vL & 0xffffffffL);
- Assert.assertEquals(v, actual);
- }
- }
-
- @Test
- public void testLong2Long() {
- for (long v : LONG_TEST_VALUES) {
- final int vL = NumberFactory.extractLo(v);
- final int vH = NumberFactory.extractHi(v);
-
- Assert.assertEquals(v, NumberFactory.makeLong(vH, vL));
- }
- }
-
- @Test
- public void testLongFromByteArray2Long() {
- for (long expected : LONG_TEST_VALUES) {
- final byte[] b = NumberFactory.makeByteArray(expected);
- Assert.assertEquals(expected, NumberFactory.makeLong(b));
- }
- }
-
- @Test
- public void testLongArrayFromByteArray2LongArray() {
- final byte[] b = NumberFactory.makeByteArray(LONG_TEST_VALUES);
- Assert.assertArrayEquals(LONG_TEST_VALUES,
- NumberFactory.makeLongArray(b));
- }
-
- @Test
- public void testIntFromByteArray2Int() {
- for (int expected : INT_TEST_VALUES) {
- final byte[] b = NumberFactory.makeByteArray(expected);
- Assert.assertEquals(expected, NumberFactory.makeInt(b));
- }
- }
-
- @Test
- public void testIntArrayFromByteArray2IntArray() {
- final byte[] b = NumberFactory.makeByteArray(INT_TEST_VALUES);
- Assert.assertArrayEquals(INT_TEST_VALUES,
- NumberFactory.makeIntArray(b));
- }
-
- @Test
- public void testMakeIntPrecondition1() {
- for (int i = 0; i <= 10; i++) {
- try {
- NumberFactory.makeInt(new byte[i]);
- if (i != INT_SIZE) {
- Assert.fail("Exception expected");
- }
- } catch (DimensionMismatchException e) {
- // Expected.
- }
- }
- }
-
- @Test
- public void testMakeIntArrayPrecondition1() {
- for (int i = 0; i <= 20; i++) {
- try {
- NumberFactory.makeIntArray(new byte[i]);
- if (i != 0 && (i % INT_SIZE != 0)) {
- Assert.fail("Exception expected");
- }
- } catch (DimensionMismatchException e) {
- // Expected.
- }
- }
- }
-
- @Test
- public void testMakeLongPrecondition1() {
- for (int i = 0; i <= 10; i++) {
- try {
- NumberFactory.makeLong(new byte[i]);
- if (i != LONG_SIZE) {
- Assert.fail("Exception expected");
- }
- } catch (DimensionMismatchException e) {
- // Expected.
- }
- }
- }
-
- @Test
- public void testMakeLongArrayPrecondition1() {
- for (int i = 0; i <= 20; i++) {
- try {
- NumberFactory.makeLongArray(new byte[i]);
- if (i != 0 && (i % LONG_SIZE != 0)) {
- Assert.fail("Exception expected");
- }
- } catch (DimensionMismatchException e) {
- // Expected.
- }
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/rng/internal/util/SeedFactoryTest.java b/src/test/java/org/apache/commons/math4/rng/internal/util/SeedFactoryTest.java
deleted file mode 100644
index 559f48412..000000000
--- a/src/test/java/org/apache/commons/math4/rng/internal/util/SeedFactoryTest.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.math4.rng.internal.util;
-
-import java.util.Map;
-import java.util.HashMap;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Tests for {@link SeedFactory}.
- */
-public class SeedFactoryTest {
- @Test
- public void testCreateLong() {
- final Map values = new HashMap<>();
-
- final int n = 100000;
- for (int i = 0; i < n; i++) {
- final long v = SeedFactory.createLong();
-
- Integer count = values.get(v);
- if (count == null) {
- count = 0;
- }
- values.put(v, count + 1);
- }
-
- // Check that all seeds are different.
- assertDifferentValues(values);
- }
-
- @Test
- public void testCreateLongArray() {
- final Map values = new HashMap<>();
-
- final int n = 100000;
- final long[] array = SeedFactory.createLongArray(n);
- Assert.assertEquals(n, array.length);
-
- for (long v : array) {
- Integer count = values.get(v);
- if (count == null) {
- count = 0;
- }
- values.put(v, count + 1);
- }
-
- // Check that all seeds are different.
- assertDifferentValues(values);
- }
-
- @Test
- public void testCreateIntArray() {
- final Map values = new HashMap<>();
-
- for (int i = 0; i < 50000; i++) {
- final int[] a = SeedFactory.createIntArray(2);
- final long v = NumberFactory.makeLong(a[0], a[1]);
- Integer count = values.get(v);
- if (count == null) {
- count = 0;
- }
- values.put(v, count + 1);
- }
-
- // Check that all pairs in are different.
- assertDifferentValues(values);
- }
-
- /**
- * Asserts that all the keys in given {@code map} have their
- * value equal to 1.
- *
- * @param map Map to counts.
- */
- private static void assertDifferentValues(Map map) {
- final StringBuilder sb = new StringBuilder();
-
- int duplicates = 0;
- for (Map.Entry entry : map.entrySet()) {
- final int count = entry.getValue();
- if (count <= 0) {
- throw new IllegalStateException();
- }
-
- if (count > 1) {
- duplicates += count - 1;
- sb.append(entry.getKey() + ": " + count + "\n");
- }
- }
-
- if (duplicates > 0) {
- Assert.fail(duplicates + " duplicates\n" + sb);
- }
- }
-}
diff --git a/src/test/java/org/apache/commons/math4/stat/correlation/KendallsCorrelationTest.java b/src/test/java/org/apache/commons/math4/stat/correlation/KendallsCorrelationTest.java
index 8b40f70d1..54819e8c6 100644
--- a/src/test/java/org/apache/commons/math4/stat/correlation/KendallsCorrelationTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/correlation/KendallsCorrelationTest.java
@@ -21,8 +21,8 @@ import java.util.Arrays;
import org.apache.commons.math4.TestUtils;
import org.apache.commons.math4.linear.BlockRealMatrix;
import org.apache.commons.math4.linear.RealMatrix;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.correlation.KendallsCorrelation;
import org.junit.Assert;
import org.junit.Before;
diff --git a/src/test/java/org/apache/commons/math4/stat/correlation/StorelessCovarianceTest.java b/src/test/java/org/apache/commons/math4/stat/correlation/StorelessCovarianceTest.java
index 9378f29f3..36c10cce2 100644
--- a/src/test/java/org/apache/commons/math4/stat/correlation/StorelessCovarianceTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/correlation/StorelessCovarianceTest.java
@@ -19,8 +19,8 @@ package org.apache.commons.math4.stat.correlation;
import org.apache.commons.math4.TestUtils;
import org.apache.commons.math4.linear.Array2DRowRealMatrix;
import org.apache.commons.math4.linear.RealMatrix;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.correlation.StorelessBivariateCovariance;
import org.apache.commons.math4.stat.correlation.StorelessCovariance;
import org.junit.Assert;
diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/AggregateSummaryStatisticsTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/AggregateSummaryStatisticsTest.java
index 43ca593a2..196a0f9ce 100644
--- a/src/test/java/org/apache/commons/math4/stat/descriptive/AggregateSummaryStatisticsTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/descriptive/AggregateSummaryStatisticsTest.java
@@ -27,7 +27,7 @@ import org.apache.commons.math4.distribution.AbstractRealDistribution;
import org.apache.commons.math4.distribution.UniformIntegerDistribution;
import org.apache.commons.math4.distribution.UniformRealDistribution;
import org.apache.commons.math4.util.Precision;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/UnivariateStatisticAbstractTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/UnivariateStatisticAbstractTest.java
index 38e844dd5..a15935452 100644
--- a/src/test/java/org/apache/commons/math4/stat/descriptive/UnivariateStatisticAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/descriptive/UnivariateStatisticAbstractTest.java
@@ -27,7 +27,7 @@ import org.apache.commons.math4.distribution.UniformIntegerDistribution;
import org.apache.commons.math4.stat.descriptive.UnivariateStatistic;
import org.apache.commons.math4.stat.descriptive.WeightedEvaluation;
import org.apache.commons.math4.util.FastMath;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentileTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentileTest.java
index 042e2fd01..933ceaa8a 100644
--- a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentileTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentileTest.java
@@ -31,8 +31,8 @@ import org.apache.commons.math4.distribution.AbstractRealDistribution;
import org.apache.commons.math4.exception.MathIllegalArgumentException;
import org.apache.commons.math4.exception.NullArgumentException;
import org.apache.commons.math4.exception.OutOfRangeException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.descriptive.StorelessUnivariateStatistic;
import org.apache.commons.math4.stat.descriptive.StorelessUnivariateStatisticAbstractTest;
import org.apache.commons.math4.stat.descriptive.UnivariateStatistic;
diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java
index 29b901ced..14e795de1 100644
--- a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java
@@ -25,8 +25,8 @@ import org.apache.commons.math4.exception.MathIllegalArgumentException;
import org.apache.commons.math4.exception.NotANumberException;
import org.apache.commons.math4.exception.NullArgumentException;
import org.apache.commons.math4.exception.OutOfRangeException;
-import org.apache.commons.math4.rng.RandomSource;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.math4.stat.descriptive.UnivariateStatistic;
import org.apache.commons.math4.stat.descriptive.UnivariateStatisticAbstractTest;
import org.apache.commons.math4.stat.descriptive.rank.Percentile.EstimationType;
diff --git a/src/test/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTestTest.java b/src/test/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTestTest.java
index 0c9c0dd5d..32aa6422a 100644
--- a/src/test/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTestTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTestTest.java
@@ -23,8 +23,8 @@ import java.util.Arrays;
import org.apache.commons.math4.TestUtils;
import org.apache.commons.math4.distribution.NormalDistribution;
import org.apache.commons.math4.distribution.UniformRealDistribution;
-import org.apache.commons.math4.rng.RandomSource;
-import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.math4.util.CombinatoricsUtils;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
diff --git a/src/test/java/org/apache/commons/math4/stat/ranking/NaturalRankingTest.java b/src/test/java/org/apache/commons/math4/stat/ranking/NaturalRankingTest.java
index 46b2ede6f..19099b7c3 100644
--- a/src/test/java/org/apache/commons/math4/stat/ranking/NaturalRankingTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/ranking/NaturalRankingTest.java
@@ -19,8 +19,8 @@ package org.apache.commons.math4.stat.ranking;
import org.junit.Assert;
import org.apache.commons.math4.TestUtils;
import org.apache.commons.math4.exception.NotANumberException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.ranking.NaNStrategy;
import org.apache.commons.math4.stat.ranking.NaturalRanking;
import org.apache.commons.math4.stat.ranking.TiesStrategy;
diff --git a/src/test/java/org/apache/commons/math4/stat/regression/GLSMultipleLinearRegressionTest.java b/src/test/java/org/apache/commons/math4/stat/regression/GLSMultipleLinearRegressionTest.java
index a5b61d144..249253504 100644
--- a/src/test/java/org/apache/commons/math4/stat/regression/GLSMultipleLinearRegressionTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/regression/GLSMultipleLinearRegressionTest.java
@@ -27,8 +27,8 @@ import org.apache.commons.math4.linear.RealMatrix;
import org.apache.commons.math4.linear.RealVector;
import org.apache.commons.math4.random.CorrelatedRandomVectorGenerator;
import org.apache.commons.math4.random.GaussianRandomGenerator;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.distribution.RealDistribution;
import org.apache.commons.math4.distribution.NormalDistribution;
import org.apache.commons.math4.stat.correlation.Covariance;
diff --git a/src/test/java/org/apache/commons/math4/stat/regression/SimpleRegressionTest.java b/src/test/java/org/apache/commons/math4/stat/regression/SimpleRegressionTest.java
index bc9042933..531a4901b 100644
--- a/src/test/java/org/apache/commons/math4/stat/regression/SimpleRegressionTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/regression/SimpleRegressionTest.java
@@ -20,8 +20,8 @@ import java.util.Random;
import org.apache.commons.math4.exception.MathIllegalArgumentException;
import org.apache.commons.math4.exception.OutOfRangeException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.stat.regression.ModelSpecificationException;
import org.apache.commons.math4.stat.regression.RegressionResults;
import org.apache.commons.math4.stat.regression.SimpleRegression;
diff --git a/src/test/java/org/apache/commons/math4/util/FastMathTest.java b/src/test/java/org/apache/commons/math4/util/FastMathTest.java
index d9d7c6164..6314789dc 100644
--- a/src/test/java/org/apache/commons/math4/util/FastMathTest.java
+++ b/src/test/java/org/apache/commons/math4/util/FastMathTest.java
@@ -32,8 +32,8 @@ import org.apache.commons.math4.dfp.Dfp;
import org.apache.commons.math4.dfp.DfpField;
import org.apache.commons.math4.dfp.DfpMath;
import org.apache.commons.math4.exception.MathArithmeticException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
diff --git a/src/test/java/org/apache/commons/math4/util/MathArraysTest.java b/src/test/java/org/apache/commons/math4/util/MathArraysTest.java
index 05de1b0d3..9bb4c0790 100644
--- a/src/test/java/org/apache/commons/math4/util/MathArraysTest.java
+++ b/src/test/java/org/apache/commons/math4/util/MathArraysTest.java
@@ -25,8 +25,8 @@ import org.apache.commons.math4.exception.NotANumberException;
import org.apache.commons.math4.exception.NotPositiveException;
import org.apache.commons.math4.exception.NotStrictlyPositiveException;
import org.apache.commons.math4.exception.NullArgumentException;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.Precision;
diff --git a/src/test/java/org/apache/commons/math4/util/MathUtilsTest.java b/src/test/java/org/apache/commons/math4/util/MathUtilsTest.java
index f83476fc5..e60f2bfa7 100644
--- a/src/test/java/org/apache/commons/math4/util/MathUtilsTest.java
+++ b/src/test/java/org/apache/commons/math4/util/MathUtilsTest.java
@@ -19,8 +19,8 @@ import org.apache.commons.math4.exception.MathArithmeticException;
import org.apache.commons.math4.exception.NotFiniteNumberException;
import org.apache.commons.math4.exception.NullArgumentException;
import org.apache.commons.math4.exception.util.LocalizedFormats;
-import org.apache.commons.math4.rng.UniformRandomProvider;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.RandomSource;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/apache/commons/math4/util/ResizableDoubleArrayTest.java b/src/test/java/org/apache/commons/math4/util/ResizableDoubleArrayTest.java
index bf87c3ba6..ac2be2025 100644
--- a/src/test/java/org/apache/commons/math4/util/ResizableDoubleArrayTest.java
+++ b/src/test/java/org/apache/commons/math4/util/ResizableDoubleArrayTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.math4.distribution.IntegerDistribution;
import org.apache.commons.math4.distribution.UniformIntegerDistribution;
import org.apache.commons.math4.exception.MathIllegalArgumentException;
import org.apache.commons.math4.exception.NullArgumentException;
-import org.apache.commons.math4.rng.RandomSource;
+import org.apache.commons.rng.RandomSource;
import org.apache.commons.math4.util.ResizableDoubleArray.ExpansionMode;
import org.junit.After;
import org.junit.Assert;