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 2022/01/25 00:37:55 UTC

[commons-math] 03/11: Replace deprecated calls.

This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git

commit e18ac1b03b095c3485fd2c86bb1b2843927ff80b
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Sun Jan 23 03:56:07 2022 +0100

    Replace deprecated calls.
---
 .../apache/commons/math4/examples/sofm/chineserings/ChineseRings.java | 2 +-
 .../math4/examples/sofm/chineserings/ChineseRingsClassifier.java      | 4 ++--
 .../java/org/apache/commons/math4/examples/sofm/tsp/StandAlone.java   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/commons-math-examples/examples-sofm/chinese-rings/src/main/java/org/apache/commons/math4/examples/sofm/chineserings/ChineseRings.java b/commons-math-examples/examples-sofm/chinese-rings/src/main/java/org/apache/commons/math4/examples/sofm/chineserings/ChineseRings.java
index 3127c1c..dab8e16 100644
--- a/commons-math-examples/examples-sofm/chinese-rings/src/main/java/org/apache/commons/math4/examples/sofm/chineserings/ChineseRings.java
+++ b/commons-math-examples/examples-sofm/chinese-rings/src/main/java/org/apache/commons/math4/examples/sofm/chineserings/ChineseRings.java
@@ -58,7 +58,7 @@ class ChineseRings {
         // Second ring (centered around the first ring).
         final Vector3D[] secondRing = new Vector3D[numPointsRing2];
 
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.WELL_19937_C);
+        final UniformRandomProvider rng = RandomSource.WELL_19937_C.create();
 
         // Create two rings lying in xy-plane.
         final UnitSphereSampler unit = UnitSphereSampler.of(rng, 2);
diff --git a/commons-math-examples/examples-sofm/chinese-rings/src/main/java/org/apache/commons/math4/examples/sofm/chineserings/ChineseRingsClassifier.java b/commons-math-examples/examples-sofm/chinese-rings/src/main/java/org/apache/commons/math4/examples/sofm/chineserings/ChineseRingsClassifier.java
index d8c5560..122ff6f 100644
--- a/commons-math-examples/examples-sofm/chinese-rings/src/main/java/org/apache/commons/math4/examples/sofm/chineserings/ChineseRingsClassifier.java
+++ b/commons-math-examples/examples-sofm/chinese-rings/src/main/java/org/apache/commons/math4/examples/sofm/chineserings/ChineseRingsClassifier.java
@@ -146,7 +146,7 @@ class ChineseRingsClassifier {
             0.1 * centre[2].getStandardDeviation()
         };
 
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.SPLIT_MIX_64);
+        final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
         return new FeatureInitializer[] {
             FeatureInitializerFactory.uniform(rng, mean[0] - dev[0], mean[0] + dev[0]),
             FeatureInitializerFactory.uniform(rng, mean[1] - dev[1], mean[1] + dev[1]),
@@ -166,7 +166,7 @@ class ChineseRingsClassifier {
             /** Data. */
             private final Vector3D[] points = rings.getPoints();
             /** RNG. */
-            private final UniformRandomProvider rng = RandomSource.create(RandomSource.KISS);
+            private final UniformRandomProvider rng = RandomSource.KISS.create();
             /** Number of samples. */
             private long n;
 
diff --git a/commons-math-examples/examples-sofm/tsp/src/main/java/org/apache/commons/math4/examples/sofm/tsp/StandAlone.java b/commons-math-examples/examples-sofm/tsp/src/main/java/org/apache/commons/math4/examples/sofm/tsp/StandAlone.java
index 6dd92fe..bb4e535 100644
--- a/commons-math-examples/examples-sofm/tsp/src/main/java/org/apache/commons/math4/examples/sofm/tsp/StandAlone.java
+++ b/commons-math-examples/examples-sofm/tsp/src/main/java/org/apache/commons/math4/examples/sofm/tsp/StandAlone.java
@@ -86,7 +86,7 @@ public final class StandAlone implements Callable<Void> {
             new City("i0", 1, 1),
         };
 
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.KISS);
+        final UniformRandomProvider rng = RandomSource.KISS.create();
         City[] best = null;
         int maxCities = 0;
         double minDist = Double.POSITIVE_INFINITY;