From 1d83419c90812f7db03707f9ae68d1c95e5acb72 Mon Sep 17 00:00:00 2001 From: Gilles Sadowski Date: Wed, 9 Jun 2021 16:20:39 +0200 Subject: [PATCH] Adapt to "Commons Numbers" API updates. Cf. NUMBERS-159. --- .../math4/legacy/core/ExtendedFieldElementAbstractTest.java | 2 +- .../apache/commons/math4/legacy/analysis/FunctionUtils.java | 2 +- .../math4/legacy/analysis/differentiation/DSCompiler.java | 2 +- .../analysis/differentiation/DerivativeStructure.java | 2 +- .../legacy/analysis/differentiation/SparseGradient.java | 2 +- .../interpolation/BicubicInterpolatingFunction.java | 2 +- .../analysis/interpolation/InterpolatingMicrosphere.java | 6 +++--- .../legacy/field/ExtendedFieldElementAbstractTest.java | 2 +- .../apache/commons/math4/legacy/ode/nonstiff/Decimal64.java | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/ExtendedFieldElementAbstractTest.java b/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/ExtendedFieldElementAbstractTest.java index ec34fcbde..5f6ab7df8 100644 --- a/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/ExtendedFieldElementAbstractTest.java +++ b/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/ExtendedFieldElementAbstractTest.java @@ -19,7 +19,7 @@ package org.apache.commons.math4.legacy.core; import org.junit.Assert; import org.junit.Test; -import org.apache.commons.numbers.arrays.LinearCombination; +import org.apache.commons.numbers.core.LinearCombination; import org.apache.commons.rng.UniformRandomProvider; import org.apache.commons.rng.simple.RandomSource; import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/FunctionUtils.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/FunctionUtils.java index cd4ff4863..884209d13 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/FunctionUtils.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/FunctionUtils.java @@ -17,7 +17,7 @@ package org.apache.commons.math4.legacy.analysis; -import org.apache.commons.numbers.arrays.LinearCombination; +import org.apache.commons.numbers.core.LinearCombination; import org.apache.commons.math4.legacy.analysis.differentiation.DerivativeStructure; import org.apache.commons.math4.legacy.analysis.differentiation.MultivariateDifferentiableFunction; import org.apache.commons.math4.legacy.analysis.differentiation.UnivariateDifferentiableFunction; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java index 646d85549..c8f52e9e8 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java @@ -21,7 +21,7 @@ import java.util.Arrays; import java.util.List; import java.util.concurrent.atomic.AtomicReference; -import org.apache.commons.numbers.arrays.LinearCombination; +import org.apache.commons.numbers.core.LinearCombination; import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.exception.MathArithmeticException; import org.apache.commons.math4.legacy.exception.MathInternalError; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java index 36c13f638..3e266e0f3 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java @@ -19,7 +19,7 @@ package org.apache.commons.math4.legacy.analysis.differentiation; import java.util.Arrays; import java.io.Serializable; -import org.apache.commons.numbers.arrays.LinearCombination; +import org.apache.commons.numbers.core.LinearCombination; import org.apache.commons.math4.legacy.core.Field; import org.apache.commons.math4.legacy.core.FieldElement; import org.apache.commons.math4.legacy.core.RealFieldElement; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradient.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradient.java index bb5999785..74c2c5d85 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradient.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradient.java @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.apache.commons.numbers.arrays.LinearCombination; +import org.apache.commons.numbers.core.LinearCombination; import org.apache.commons.numbers.core.Precision; import org.apache.commons.math4.legacy.core.Field; import org.apache.commons.math4.legacy.core.FieldElement; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunction.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunction.java index faf4ce5a6..7ceb2888d 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunction.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunction.java @@ -18,7 +18,7 @@ package org.apache.commons.math4.legacy.analysis.interpolation; import java.util.Arrays; -import org.apache.commons.numbers.arrays.LinearCombination; +import org.apache.commons.numbers.core.LinearCombination; import org.apache.commons.math4.legacy.analysis.BivariateFunction; import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.exception.NoDataException; 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 525cc210a..bb3ffabef 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 @@ -18,8 +18,8 @@ package org.apache.commons.math4.legacy.analysis.interpolation; import java.util.List; import java.util.ArrayList; -import org.apache.commons.numbers.arrays.CosAngle; -import org.apache.commons.numbers.arrays.SafeNorm; +import org.apache.commons.numbers.core.Norm; +import org.apache.commons.numbers.angle.CosAngle; import org.apache.commons.rng.sampling.UnitSphereSampler; import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.exception.NotPositiveException; @@ -222,7 +222,7 @@ public class InterpolatingMicrosphere { for (int i = 0; i < numSamples; i++) { // Vector between interpolation point and current sample point. final double[] diff = MathArrays.ebeSubtract(samplePoints[i], point); - final double diffNorm = SafeNorm.value(diff); + final double diffNorm = Norm.L2.of(diff); if (AccurateMath.abs(diffNorm) < noInterpolationTolerance) { // No need to interpolate, as the interpolation point is diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/ExtendedFieldElementAbstractTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/ExtendedFieldElementAbstractTest.java index 81a1e604a..64e2ae30c 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/ExtendedFieldElementAbstractTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/ExtendedFieldElementAbstractTest.java @@ -19,7 +19,7 @@ package org.apache.commons.math4.legacy.field; import org.junit.Assert; import org.junit.Test; -import org.apache.commons.numbers.arrays.LinearCombination; +import org.apache.commons.numbers.core.LinearCombination; import org.apache.commons.rng.UniformRandomProvider; import org.apache.commons.rng.simple.RandomSource; import org.apache.commons.math4.legacy.core.RealFieldElement; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64.java index 1e5af3f3b..31d547628 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64.java @@ -17,7 +17,7 @@ package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath; -import org.apache.commons.numbers.arrays.LinearCombination; +import org.apache.commons.numbers.core.LinearCombination; import org.apache.commons.math4.legacy.core.Field; import org.apache.commons.math4.legacy.core.RealFieldElement; import org.apache.commons.math4.legacy.exception.DimensionMismatchException;