commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [13/25] [math] MATH-1335
Date Tue, 17 May 2016 15:49:46 GMT
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/73317734
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/73317734
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/73317734

Branch: refs/heads/develop
Commit: 7331773448c1f2e0b24deae4144db0deec85fc07
Parents: d707364
Author: Gilles <erans@apache.org>
Authored: Wed May 11 16:43:13 2016 +0200
Committer: Gilles <erans@apache.org>
Committed: Tue May 17 15:30:23 2016 +0200

----------------------------------------------------------------------
 .../analysis/differentiation/DerivativeStructureTest.java   | 7 ++++---
 .../math4/analysis/differentiation/SparseGradientTest.java  | 9 ++++++---
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/73317734/src/test/java/org/apache/commons/math4/analysis/differentiation/DerivativeStructureTest.java
----------------------------------------------------------------------
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 99fcdd1..8d4bf50 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,7 +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.random.Well1024a;
+import org.apache.commons.math4.rng.UniformRandomProvider;
+import org.apache.commons.math4.rng.RandomSource;
 import org.apache.commons.math4.util.ArithmeticUtils;
 import org.apache.commons.math4.util.CombinatoricsUtils;
 import org.apache.commons.math4.util.FastMath;
@@ -1447,7 +1448,7 @@ public class DerivativeStructureTest extends ExtendedFieldElementAbstractTest<De
     public void testLinearCombination2DSDS() {
         // we compare accurate versus naive dot product implementations
         // on regular vectors (i.e. not extreme cases like in the previous test)
-        Well1024a random = new Well1024a(0xc6af886975069f11l);
+        UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A, 0xc6af886975069f11l);
 
         for (int i = 0; i < 10000; ++i) {
             final DerivativeStructure[] u = new DerivativeStructure[4];
@@ -1491,7 +1492,7 @@ public class DerivativeStructureTest extends ExtendedFieldElementAbstractTest<De
     public void testLinearCombination2DoubleDS() {
         // we compare accurate versus naive dot product implementations
         // on regular vectors (i.e. not extreme cases like in the previous test)
-        Well1024a random = new Well1024a(0xc6af886975069f11l);
+        UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A, 0xc6af886975069f11l);
 
         for (int i = 0; i < 10000; ++i) {
             final double[] u = new double[4];

http://git-wip-us.apache.org/repos/asf/commons-math/blob/73317734/src/test/java/org/apache/commons/math4/analysis/differentiation/SparseGradientTest.java
----------------------------------------------------------------------
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 fdfe87b..569d540 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,7 +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.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.junit.Assert;
 import org.junit.Test;
@@ -1022,7 +1023,8 @@ public class SparseGradientTest extends ExtendedFieldElementAbstractTest<SparseG
     public void testLinearCombination2DSDS() {
         // we compare accurate versus naive dot product implementations
         // on regular vectors (i.e. not extreme cases like in the previous test)
-        Well1024a random = new Well1024a(0xc6af886975069f11l);
+        UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A,
+                                                           0xc6af886975069f11l);
 
         for (int i = 0; i < 10000; ++i) {
             final SparseGradient[] u = new SparseGradient[4];
@@ -1066,7 +1068,8 @@ public class SparseGradientTest extends ExtendedFieldElementAbstractTest<SparseG
     public void testLinearCombination2DoubleDS() {
         // we compare accurate versus naive dot product implementations
         // on regular vectors (i.e. not extreme cases like in the previous test)
-        Well1024a random = new Well1024a(0xc6af886975069f11l);
+        UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A,
+                                                           0xc6af886975069f11l);
 
         for (int i = 0; i < 10000; ++i) {
             final double[] u = new double[4];


Mime
View raw message