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 8cd59b991eeb911d94b82504cff737bcafa1b660
Author: Gilles Sadowski <gillese...@gmail.com>
AuthorDate: Mon Jul 19 15:02:29 2021 +0200

    Replace deprecated calls.
---
 .../math4/legacy/analysis/interpolation/InterpolatingMicrosphere.java | 2 +-
 .../analysis/interpolation/MicrosphereProjectionInterpolator.java     | 2 +-
 .../org/apache/commons/math4/legacy/genetics/GeneticAlgorithm.java    | 2 +-
 .../commons/math4/legacy/ml/clustering/FuzzyKMeansClusterer.java      | 2 +-
 .../commons/math4/legacy/ml/clustering/KMeansPlusPlusClusterer.java   | 2 +-
 .../math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java    | 4 ++--
 .../commons/math4/legacy/stat/inference/KolmogorovSmirnovTest.java    | 2 +-
 .../org/apache/commons/math4/legacy/stat/ranking/NaturalRanking.java  | 4 ++--
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/InterpolatingMicrosphere.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/InterpolatingMicrosphere.java
index bb3ffab..79fc28a 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/InterpolatingMicrosphere.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/InterpolatingMicrosphere.java
@@ -132,7 +132,7 @@ public class InterpolatingMicrosphere {
         // Generate the microsphere normals, assuming that a number of
         // randomly generated normals will represent a sphere.
         for (int i = 0; i < size; i++) {
-            add(rand.nextVector(), false);
+            add(rand.sample(), false);
         }
     }
 
diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/MicrosphereProjectionInterpolator.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/MicrosphereProjectionInterpolator.java
index d656ac6..9a0c7d0 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/MicrosphereProjectionInterpolator.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/MicrosphereProjectionInterpolator.java
@@ -84,7 +84,7 @@ public class MicrosphereProjectionInterpolator
                                           darkThreshold,
                                           background,
                                           new UnitSphereSampler(dimension,
-                                                                
RandomSource.create(RandomSource.MT_64))),
+                                                                
RandomSource.MT_64.create())),
              exponent,
              sharedSphere,
              noInterpolationTolerance);
diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithm.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithm.java
index 1745460..0d120aa 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithm.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithm.java
@@ -35,7 +35,7 @@ public class GeneticAlgorithm {
      * alternative to the default PRNG, and/or select a specific seed.
      */
     //@GuardedBy("this")
-    private static UniformRandomProvider randomGenerator = 
RandomSource.create(RandomSource.WELL_19937_C);
+    private static UniformRandomProvider randomGenerator = 
RandomSource.WELL_19937_C.create();
 
     /** the crossover policy used by the algorithm. */
     private final CrossoverPolicy crossoverPolicy;
diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/FuzzyKMeansClusterer.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/FuzzyKMeansClusterer.java
index 3eeb225..69c9712 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/FuzzyKMeansClusterer.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/FuzzyKMeansClusterer.java
@@ -118,7 +118,7 @@ public class FuzzyKMeansClusterer<T extends Clusterable> 
extends Clusterer<T> {
      */
     public FuzzyKMeansClusterer(final int k, final double fuzziness,
                                 final int maxIterations, final DistanceMeasure 
measure) {
-        this(k, fuzziness, maxIterations, measure, DEFAULT_EPSILON, 
RandomSource.create(RandomSource.MT_64));
+        this(k, fuzziness, maxIterations, measure, DEFAULT_EPSILON, 
RandomSource.MT_64.create());
     }
 
     /**
diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/KMeansPlusPlusClusterer.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/KMeansPlusPlusClusterer.java
index eb9e1fc..9890194 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/KMeansPlusPlusClusterer.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/KMeansPlusPlusClusterer.java
@@ -108,7 +108,7 @@ public class KMeansPlusPlusClusterer<T extends Clusterable> 
extends Clusterer<T>
      * @param measure the distance measure to use
      */
     public KMeansPlusPlusClusterer(final int k, final int maxIterations, final 
DistanceMeasure measure) {
-        this(k, maxIterations, measure, 
RandomSource.create(RandomSource.MT_64));
+        this(k, maxIterations, measure, RandomSource.MT_64.create());
     }
 
     /** Build a clusterer.
diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java
index 7415afd..bb91ba8 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java
@@ -49,7 +49,7 @@ public class RandomPivotingStrategy implements 
PivotingStrategy, Serializable {
     public RandomPivotingStrategy(RandomSource randomSource,
                                   long seed) {
         this.randomSource = randomSource;
-        random = RandomSource.create(randomSource, seed);
+        random = randomSource.create(seed);
     }
 
     /**
@@ -92,7 +92,7 @@ public class RandomPivotingStrategy implements 
PivotingStrategy, Serializable {
         in.defaultReadObject();
 
         // Recreate the "delegate" from serialized info.
-        random = RandomSource.create(randomSource);
+        random = randomSource.create();
         // And restore its state.
         final RandomProviderDefaultState state = new 
RandomProviderDefaultState((byte[]) in.readObject());
         random.restoreState(state);
diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/KolmogorovSmirnovTest.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/KolmogorovSmirnovTest.java
index 4dc003b..14ccc1a 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/KolmogorovSmirnovTest.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/KolmogorovSmirnovTest.java
@@ -1082,7 +1082,7 @@ public class KolmogorovSmirnovTest {
         if (hasTies(x, y)) {
             // Add jitter using a fixed seed (so same arguments always give 
same results),
             // low-initialization-overhead generator.
-            final UniformRandomProvider rng = 
RandomSource.create(RandomSource.SPLIT_MIX_64, 876543217L);
+            final UniformRandomProvider rng = 
RandomSource.SPLIT_MIX_64.create(876543217L);
 
             // It is theoretically possible that jitter does not break ties, 
so repeat
             // until all ties are gone.  Bound the loop and throw MIE if bound 
is exceeded.
diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaturalRanking.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaturalRanking.java
index bad04ca..49116c1 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaturalRanking.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaturalRanking.java
@@ -102,7 +102,7 @@ public class NaturalRanking implements RankingAlgorithm {
     public NaturalRanking(TiesStrategy tiesStrategy) {
         this(DEFAULT_NAN_STRATEGY,
              tiesStrategy,
-             RandomSource.create(RandomSource.WELL_19937_C));
+             RandomSource.WELL_19937_C.create());
     }
 
     /**
@@ -124,7 +124,7 @@ public class NaturalRanking implements RankingAlgorithm {
                           TiesStrategy tiesStrategy) {
         this(nanStrategy,
              tiesStrategy,
-             RandomSource.create(RandomSource.WELL_19937_C));
+             RandomSource.WELL_19937_C.create());
     }
 
     /**

Reply via email to