You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2016/05/17 15:49:51 UTC

[18/25] [math] MATH-1335

MATH-1335

Use new RNG API.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/f3108e27
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/f3108e27
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/f3108e27

Branch: refs/heads/develop
Commit: f3108e2771083bfcf02c9c67ebd70a3ac0ddfca8
Parents: 583d57d
Author: Gilles <er...@apache.org>
Authored: Thu May 12 13:32:54 2016 +0200
Committer: Gilles <er...@apache.org>
Committed: Tue May 17 15:30:23 2016 +0200

----------------------------------------------------------------------
 .../math4/ExtendedFieldElementAbstractTest.java | 22 ++++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/f3108e27/src/test/java/org/apache/commons/math4/ExtendedFieldElementAbstractTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ExtendedFieldElementAbstractTest.java b/src/test/java/org/apache/commons/math4/ExtendedFieldElementAbstractTest.java
index 03b5a1a..5f27243 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.random.RandomGenerator;
-import org.apache.commons.math4.random.Well1024a;
+import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.math4.rng.RandomSource;
 import org.apache.commons.math4.util.FastMath;
 import org.apache.commons.math4.util.MathArrays;
 import org.junit.Assert;
@@ -393,7 +393,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationFaFa() {
-        RandomGenerator r = new Well1024a(0xfafal);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xfafal);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 10);
             double[] bD = generateDouble(r, 10);
@@ -406,7 +406,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationDaFa() {
-        RandomGenerator r = new Well1024a(0xdafal);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdafal);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 10);
             double[] bD = generateDouble(r, 10);
@@ -418,7 +418,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationFF2() {
-        RandomGenerator r = new Well1024a(0xff2l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xff2l);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 2);
             double[] bD = generateDouble(r, 2);
@@ -431,7 +431,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationDF2() {
-        RandomGenerator r = new Well1024a(0xdf2l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdf2l);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 2);
             double[] bD = generateDouble(r, 2);
@@ -443,7 +443,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationFF3() {
-        RandomGenerator r = new Well1024a(0xff3l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xff3l);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 3);
             double[] bD = generateDouble(r, 3);
@@ -456,7 +456,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationDF3() {
-        RandomGenerator r = new Well1024a(0xdf3l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdf3l);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 3);
             double[] bD = generateDouble(r, 3);
@@ -468,7 +468,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationFF4() {
-        RandomGenerator r = new Well1024a(0xff4l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xff4l);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 4);
             double[] bD = generateDouble(r, 4);
@@ -481,7 +481,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationDF4() {
-        RandomGenerator r = new Well1024a(0xdf4l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdf4l);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 4);
             double[] bD = generateDouble(r, 4);
@@ -521,7 +521,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
         Assert.assertTrue(t1a.hashCode() != t2.hashCode());
     }
 
-    private double[] generateDouble (final RandomGenerator r, int n) {
+    private double[] generateDouble (final UniformRandomProvider r, int n) {
         double[] a = new double[n];
         for (int i = 0; i < n; ++i) {
             a[i] = r.nextDouble();