This is an automated email from the ASF dual-hosted git repository. erans pushed a commit to branch modularized_master in repository https://gitbox.apache.org/repos/asf/commons-math.git
commit b416ae586e2e43bfb4544d99a7f639d3caa7f1b8 Author: Samy Badjoudj <samy.badjo...@gmail.com> AuthorDate: Thu May 27 12:16:44 2021 +0200 MATH-1586: Moved classes that are only used by a single package over to that package --- .../math4/legacy/{util => linear}/BigReal.java | 2 +- .../legacy/{util => linear}/BigRealField.java | 2 +- .../math4/legacy/linear/ConjugateGradient.java | 1 - .../legacy/{util => linear}/IterationEvent.java | 4 +- .../legacy/{util => linear}/IterationListener.java | 2 +- .../legacy/{util => linear}/IterationManager.java | 4 +- .../math4/legacy/linear/IterativeLinearSolver.java | 8 +-- .../legacy/linear/IterativeLinearSolverEvent.java | 1 - .../{util => linear}/OpenIntToDoubleHashMap.java | 4 +- .../{util => linear}/OpenIntToFieldHashMap.java | 3 +- .../math4/legacy/linear/OpenMapRealMatrix.java | 1 - .../math4/legacy/linear/OpenMapRealVector.java | 3 +- .../PreconditionedIterativeLinearSolver.java | 8 +-- .../math4/legacy/linear/SparseFieldMatrix.java | 1 - .../math4/legacy/linear/SparseFieldVector.java | 1 - .../apache/commons/math4/legacy/linear/SymmLQ.java | 8 +-- .../legacy/{util => ode/nonstiff}/Decimal64.java | 3 +- .../{util => ode/nonstiff}/Decimal64Field.java | 2 +- .../stat/descriptive/DescriptiveStatistics.java | 1 - .../{util => stat/descriptive}/DoubleArray.java | 2 +- .../descriptive}/ResizableDoubleArray.java | 4 +- .../{util => stat/descriptive}/TransformerMap.java | 28 ++++---- .../stat/descriptive/UnivariateStatistic.java | 80 +++++++++++++++++++++ .../descriptive/rank}/CentralPivotingStrategy.java | 4 +- .../descriptive/rank}/KthSelector.java | 3 +- .../math4/legacy/stat/descriptive/rank/Median.java | 1 - .../rank}/MedianOf3PivotingStrategy.java | 3 +- .../legacy/stat/descriptive/rank/Percentile.java | 3 - .../rank}/PivotingStrategyInterface.java | 2 +- .../descriptive/rank}/RandomPivotingStrategy.java | 4 +- .../math4/legacy/util/DefaultTransformer.java | 81 ---------------------- .../math4/legacy/util/NumberTransformer.java | 38 ---------- .../math4/legacy/linear/ArrayFieldVectorTest.java | 2 - .../legacy/{util => linear}/BigRealFieldTest.java | 4 +- .../math4/legacy/{util => linear}/BigRealTest.java | 4 +- .../math4/legacy/linear/BlockFieldMatrixTest.java | 2 - .../math4/legacy/linear/ConjugateGradientTest.java | 2 - .../math4/legacy/linear/FieldMatrixImplTest.java | 2 - .../OpenIntToDoubleHashMapTest.java | 3 +- .../{util => linear}/OpenIntToFieldTest.java | 3 +- .../commons/math4/legacy/linear/SymmLQTest.java | 2 - .../legacy/ode/ContinuousOutputFieldModelTest.java | 2 +- .../math4/legacy/ode/FieldExpandableODETest.java | 2 +- .../AdamsBashforthFieldIntegratorTest.java | 1 - .../nonstiff/AdamsMoultonFieldIntegratorTest.java | 1 - ...lassicalRungKuttaFieldStepInterpolatorTest.java | 1 - .../ClassicalRungeKuttaFieldIntegratorTest.java | 1 - .../{util => ode/nonstiff}/Decimal64Test.java | 3 +- .../DormandPrince54FieldIntegratorTest.java | 1 - .../DormandPrince54FieldStepInterpolatorTest.java | 1 - .../DormandPrince853FieldIntegratorTest.java | 1 - .../DormandPrince853FieldStepInterpolatorTest.java | 1 - .../ode/nonstiff/EulerFieldIntegratorTest.java | 1 - .../nonstiff/EulerFieldStepInterpolatorTest.java | 1 - .../ode/nonstiff/GillFieldIntegratorTest.java | 1 - .../nonstiff/GillFieldStepInterpolatorTest.java | 1 - .../nonstiff/HighamHall54FieldIntegratorTest.java | 1 - .../HighamHall54FieldStepInterpolatorTest.java | 1 - .../ode/nonstiff/LutherFieldIntegratorTest.java | 1 - .../nonstiff/LutherFieldStepInterpolatorTest.java | 1 - .../ode/nonstiff/MidpointFieldIntegratorTest.java | 1 - .../MidpointFieldStepInterpolatorTest.java | 1 - .../nonstiff/ThreeEighthesFieldIntegratorTest.java | 1 - .../ThreeEighthesFieldStepInterpolatorTest.java | 1 - .../descriptive}/DefaultTransformerTest.java | 17 ++--- .../descriptive}/DoubleArrayAbstractTest.java | 3 +- .../stat/descriptive/ListUnivariateImpl.java | 12 ++-- .../descriptive/MixedListUnivariateImplTest.java | 6 +- .../descriptive}/ResizableDoubleArrayTest.java | 5 +- .../descriptive}/TransformerMapTest.java | 18 ++--- .../descriptive/rank}/KthSelectorTest.java | 3 +- .../stat/descriptive/rank/PercentileTest.java | 5 -- pom.xml | 3 + 73 files changed, 188 insertions(+), 247 deletions(-) diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/BigReal.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigReal.java similarity index 99% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/BigReal.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigReal.java index 337bb49..ec22cca 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/BigReal.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigReal.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; import java.io.Serializable; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/BigRealField.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigRealField.java similarity index 98% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/BigRealField.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigRealField.java index c7b1090..71755bb 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/BigRealField.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigRealField.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; import java.io.Serializable; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/ConjugateGradient.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/ConjugateGradient.java index f68b7f7..20a1985 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/ConjugateGradient.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/ConjugateGradient.java @@ -20,7 +20,6 @@ import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.exception.MaxCountExceededException; import org.apache.commons.math4.legacy.exception.NullArgumentException; import org.apache.commons.math4.legacy.exception.util.ExceptionContext; -import org.apache.commons.math4.legacy.util.IterationManager; /** * <p> diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/IterationEvent.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationEvent.java similarity index 94% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/IterationEvent.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationEvent.java index 48fc52b..26e5d3e 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/IterationEvent.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationEvent.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; + +import org.apache.commons.math4.legacy.linear.IterationManager; import java.util.EventObject; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/IterationListener.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationListener.java similarity index 97% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/IterationListener.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationListener.java index 574c4c0..78b0c14 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/IterationListener.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationListener.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; import java.util.EventListener; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/IterationManager.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationManager.java similarity index 98% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/IterationManager.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationManager.java index 848eff2..38844e7 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/IterationManager.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationManager.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; + +import org.apache.commons.math4.legacy.util.IntegerSequence; import java.util.Collection; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolver.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolver.java index 6270954..caf6a3a 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolver.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolver.java @@ -19,7 +19,7 @@ package org.apache.commons.math4.legacy.linear; import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.exception.MaxCountExceededException; import org.apache.commons.math4.legacy.exception.NullArgumentException; -import org.apache.commons.math4.legacy.util.IterationManager; +import org.apache.commons.math4.legacy.util.IntegerSequence; /** * This abstract class defines an iterative solver for the linear system A @@ -112,7 +112,7 @@ public abstract class IterativeLinearSolver { * inconsistent with {@code a} * @throws MaxCountExceededException at exhaustion of the iteration count, * unless a custom - * {@link org.apache.commons.math4.legacy.util.IntegerSequence.Incrementor.MaxCountExceededCallback callback} + * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback} * has been set at construction of the {@link IterationManager} */ public RealVector solve(final RealLinearOperator a, final RealVector b) @@ -138,7 +138,7 @@ public abstract class IterativeLinearSolver { * dimensions inconsistent with {@code a} * @throws MaxCountExceededException at exhaustion of the iteration count, * unless a custom - * {@link org.apache.commons.math4.legacy.util.IntegerSequence.Incrementor.MaxCountExceededCallback callback} + * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback} * has been set at construction of the {@link IterationManager} */ public RealVector solve(RealLinearOperator a, RealVector b, RealVector x0) @@ -163,7 +163,7 @@ public abstract class IterativeLinearSolver { * dimensions inconsistent with {@code a} * @throws MaxCountExceededException at exhaustion of the iteration count, * unless a custom - * {@link org.apache.commons.math4.legacy.util.IntegerSequence.Incrementor.MaxCountExceededCallback callback} + * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback} * has been set at construction of the {@link IterationManager} */ public abstract RealVector solveInPlace(RealLinearOperator a, RealVector b, diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolverEvent.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolverEvent.java index b933cef..12a16ad 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolverEvent.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolverEvent.java @@ -17,7 +17,6 @@ package org.apache.commons.math4.legacy.linear; import org.apache.commons.math4.legacy.exception.MathUnsupportedOperationException; -import org.apache.commons.math4.legacy.util.IterationEvent; /** * This is the base class for all events occurring during the iterations of a diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/OpenIntToDoubleHashMap.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java similarity index 99% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/OpenIntToDoubleHashMap.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java index 2e47290..caa2c74 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/OpenIntToDoubleHashMap.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java @@ -15,7 +15,9 @@ * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; + +import org.apache.commons.math4.legacy.util.FastMath; import java.io.IOException; import java.io.ObjectInputStream; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/OpenIntToFieldHashMap.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java similarity index 99% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/OpenIntToFieldHashMap.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java index 7d99007..abbe56f 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/OpenIntToFieldHashMap.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; import java.io.IOException; import java.io.ObjectInputStream; @@ -25,6 +25,7 @@ import java.util.NoSuchElementException; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.FieldElement; +import org.apache.commons.math4.legacy.util.FastMath; /** * Open addressed map from int to FieldElement. diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealMatrix.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealMatrix.java index 1627da0..d35a3de 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealMatrix.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealMatrix.java @@ -23,7 +23,6 @@ import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.exception.NotStrictlyPositiveException; import org.apache.commons.math4.legacy.exception.NumberIsTooLargeException; import org.apache.commons.math4.legacy.exception.OutOfRangeException; -import org.apache.commons.math4.legacy.util.OpenIntToDoubleHashMap; /** * Sparse matrix implementation based on an open addressed map. diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealVector.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealVector.java index a8379f6..9cc813d 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealVector.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealVector.java @@ -24,8 +24,7 @@ import org.apache.commons.math4.legacy.exception.NotPositiveException; import org.apache.commons.math4.legacy.exception.OutOfRangeException; import org.apache.commons.math4.legacy.exception.util.LocalizedFormats; import org.apache.commons.math4.legacy.util.FastMath; -import org.apache.commons.math4.legacy.util.OpenIntToDoubleHashMap; -import org.apache.commons.math4.legacy.util.OpenIntToDoubleHashMap.Iterator; +import org.apache.commons.math4.legacy.linear.OpenIntToDoubleHashMap.Iterator; /** * This class implements the {@link RealVector} interface with a diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/PreconditionedIterativeLinearSolver.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/PreconditionedIterativeLinearSolver.java index 4195c19..d8aad64 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/PreconditionedIterativeLinearSolver.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/PreconditionedIterativeLinearSolver.java @@ -19,7 +19,7 @@ package org.apache.commons.math4.legacy.linear; import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.exception.MaxCountExceededException; import org.apache.commons.math4.legacy.exception.NullArgumentException; -import org.apache.commons.math4.legacy.util.IterationManager; +import org.apache.commons.math4.legacy.util.IntegerSequence; /** * <p> @@ -85,7 +85,7 @@ public abstract class PreconditionedIterativeLinearSolver * {@code x0} have dimensions inconsistent with {@code a} * @throws MaxCountExceededException at exhaustion of the iteration count, * unless a custom - * {@link org.apache.commons.math4.legacy.util.IntegerSequence.Incrementor.MaxCountExceededCallback callback} + * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback} * has been set at construction of the {@link IterationManager} */ public RealVector solve(final RealLinearOperator a, @@ -166,7 +166,7 @@ public abstract class PreconditionedIterativeLinearSolver * dimensions inconsistent with {@code a} * @throws MaxCountExceededException at exhaustion of the iteration count, * unless a custom - * {@link org.apache.commons.math4.legacy.util.IntegerSequence.Incrementor.MaxCountExceededCallback callback} + * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback} * has been set at construction of the {@link IterationManager} */ public RealVector solve(RealLinearOperator a, RealLinearOperator m, @@ -194,7 +194,7 @@ public abstract class PreconditionedIterativeLinearSolver * {@code x0} have dimensions inconsistent with {@code a} * @throws MaxCountExceededException at exhaustion of the iteration count, * unless a custom - * {@link org.apache.commons.math4.legacy.util.IntegerSequence.Incrementor.MaxCountExceededCallback callback} + * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback} * has been set at construction of the {@link IterationManager} */ public abstract RealVector solveInPlace(RealLinearOperator a, diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldMatrix.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldMatrix.java index 5d596c5..d69741b 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldMatrix.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldMatrix.java @@ -18,7 +18,6 @@ package org.apache.commons.math4.legacy.linear; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.FieldElement; -import org.apache.commons.math4.legacy.util.OpenIntToFieldHashMap; /** * Sparse matrix implementation based on an open addressed map. diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldVector.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldVector.java index 0410e0e..62b6644 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldVector.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldVector.java @@ -28,7 +28,6 @@ import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException; import org.apache.commons.math4.legacy.exception.OutOfRangeException; import org.apache.commons.math4.legacy.exception.util.LocalizedFormats; import org.apache.commons.math4.legacy.util.MathArrays; -import org.apache.commons.math4.legacy.util.OpenIntToFieldHashMap; /** * This class implements the {@link FieldVector} interface with a {@link OpenIntToFieldHashMap} backing store. diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SymmLQ.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SymmLQ.java index 8a4d7b1..308d90b 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SymmLQ.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SymmLQ.java @@ -21,7 +21,7 @@ import org.apache.commons.math4.legacy.exception.MaxCountExceededException; import org.apache.commons.math4.legacy.exception.NullArgumentException; import org.apache.commons.math4.legacy.exception.util.ExceptionContext; import org.apache.commons.math4.legacy.util.FastMath; -import org.apache.commons.math4.legacy.util.IterationManager; +import org.apache.commons.math4.legacy.util.IntegerSequence; /** * <p> @@ -953,7 +953,7 @@ public class SymmLQ * inconsistent with {@code a} * @throws MaxCountExceededException at exhaustion of the iteration count, * unless a custom - * {@link org.apache.commons.math4.legacy.util.IntegerSequence.Incrementor.MaxCountExceededCallback callback} + * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback} * has been set at construction of the {@link IterationManager} * @throws NonSelfAdjointOperatorException if {@link #getCheck()} is * {@code true}, and {@code a} or {@code m} is not self-adjoint @@ -1041,7 +1041,7 @@ public class SymmLQ * inconsistent with {@code a} * @throws MaxCountExceededException at exhaustion of the iteration count, * unless a custom - * {@link org.apache.commons.math4.legacy.util.IntegerSequence.Incrementor.MaxCountExceededCallback callback} + * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback} * has been set at construction of the {@link IterationManager} * @throws NonSelfAdjointOperatorException if {@link #getCheck()} is * {@code true}, and {@code a} is not self-adjoint @@ -1131,7 +1131,7 @@ public class SymmLQ * have dimensions inconsistent with {@code a}. * @throws MaxCountExceededException at exhaustion of the iteration count, * unless a custom - * {@link org.apache.commons.math4.legacy.util.IntegerSequence.Incrementor.MaxCountExceededCallback callback} + * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback} * has been set at construction of the {@link IterationManager} * @throws NonSelfAdjointOperatorException if {@link #getCheck()} is * {@code true}, and {@code a} or {@code m} is not self-adjoint diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/Decimal64.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64.java similarity index 99% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/Decimal64.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64.java index e057547..11f2328 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/Decimal64.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64.java @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.ode.nonstiff; +import org.apache.commons.math4.legacy.util.FastMath; import org.apache.commons.numbers.arrays.LinearCombination; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/Decimal64Field.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64Field.java similarity index 97% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/Decimal64Field.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64Field.java index 91d7513..647c88c 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/Decimal64Field.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64Field.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.FieldElement; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatistics.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatistics.java index 0610073..d95a7d0 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatistics.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatistics.java @@ -35,7 +35,6 @@ import org.apache.commons.math4.legacy.stat.descriptive.rank.Percentile; import org.apache.commons.math4.legacy.stat.descriptive.summary.Sum; import org.apache.commons.math4.legacy.stat.descriptive.summary.SumOfSquares; import org.apache.commons.math4.legacy.util.FastMath; -import org.apache.commons.math4.legacy.util.ResizableDoubleArray; /** diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/DoubleArray.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DoubleArray.java similarity index 98% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/DoubleArray.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DoubleArray.java index caa99b3..886b947 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/DoubleArray.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DoubleArray.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive; /** diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/ResizableDoubleArray.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/ResizableDoubleArray.java similarity index 99% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/ResizableDoubleArray.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/ResizableDoubleArray.java index c0036b0..3d11c30 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/ResizableDoubleArray.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/ResizableDoubleArray.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive; import java.io.Serializable; import java.util.Arrays; @@ -25,6 +25,8 @@ import org.apache.commons.math4.legacy.exception.NotStrictlyPositiveException; import org.apache.commons.math4.legacy.exception.NullArgumentException; import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException; import org.apache.commons.math4.legacy.exception.util.LocalizedFormats; +import org.apache.commons.math4.legacy.util.FastMath; +import org.apache.commons.math4.legacy.util.MathArrays; /** * A variable length {@link DoubleArray} implementation that automatically diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/TransformerMap.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/TransformerMap.java similarity index 81% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/TransformerMap.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/TransformerMap.java index 905335d..5d18f02 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/TransformerMap.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/TransformerMap.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive; import java.io.Serializable; import java.util.Collection; @@ -30,7 +30,7 @@ import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; * based on the Class of the object handed to the Maps * <code>double transform(Object o)</code> method. */ -public class TransformerMap implements NumberTransformer, Serializable { +public class TransformerMap implements UnivariateStatistic.NumberTransformer, Serializable { /** Serializable version identifier */ private static final long serialVersionUID = 4605318041528645258L; @@ -38,19 +38,19 @@ public class TransformerMap implements NumberTransformer, Serializable { /** * A default Number Transformer for Numbers and numeric Strings. */ - private NumberTransformer defaultTransformer; + private UnivariateStatistic.NumberTransformer defaultTransformer; /** * The internal Map. */ - private Map<Class<?>, NumberTransformer> map; + private Map<Class<?>, UnivariateStatistic.NumberTransformer> map; /** * Build a map containing only the default transformer. */ public TransformerMap() { map = new HashMap<>(); - defaultTransformer = new DefaultTransformer(); + defaultTransformer = new UnivariateStatistic.DefaultTransformer(); } /** @@ -67,7 +67,7 @@ public class TransformerMap implements NumberTransformer, Serializable { * @param value NumberTransformer to check * @return true|false */ - public boolean containsTransformer(NumberTransformer value) { + public boolean containsTransformer(UnivariateStatistic.NumberTransformer value) { return map.containsValue(value); } @@ -77,7 +77,7 @@ public class TransformerMap implements NumberTransformer, Serializable { * @param key The Class of the object * @return the mapped NumberTransformer or null. */ - public NumberTransformer getTransformer(Class<?> key) { + public UnivariateStatistic.NumberTransformer getTransformer(Class<?> key) { return map.get(key); } @@ -89,7 +89,7 @@ public class TransformerMap implements NumberTransformer, Serializable { * @param transformer The NumberTransformer * @return the replaced transformer if one is present */ - public NumberTransformer putTransformer(Class<?> key, NumberTransformer transformer) { + public UnivariateStatistic.NumberTransformer putTransformer(Class<?> key, UnivariateStatistic.NumberTransformer transformer) { return map.put(key, transformer); } @@ -99,7 +99,7 @@ public class TransformerMap implements NumberTransformer, Serializable { * @return the removed transformer if one is present or * null if none was present. */ - public NumberTransformer removeTransformer(Class<?> key) { + public UnivariateStatistic.NumberTransformer removeTransformer(Class<?> key) { return map.remove(key); } @@ -123,7 +123,7 @@ public class TransformerMap implements NumberTransformer, Serializable { * in the map. * @return Set of NumberTransformers */ - public Collection<NumberTransformer> transformers() { + public Collection<UnivariateStatistic.NumberTransformer> transformers() { return map.values(); } @@ -135,7 +135,7 @@ public class TransformerMap implements NumberTransformer, Serializable { * @return the double value of the Object. * @throws MathIllegalArgumentException if the Object can not be * transformed into a Double. - * @see org.apache.commons.math4.legacy.util.NumberTransformer#transform(java.lang.Object) + * @see UnivariateStatistic.NumberTransformer#transform(java.lang.Object) */ @Override public double transform(Object o) throws MathIllegalArgumentException { @@ -144,7 +144,7 @@ public class TransformerMap implements NumberTransformer, Serializable { if (o instanceof Number || o instanceof String) { value = defaultTransformer.transform(o); } else { - NumberTransformer trans = getTransformer(o.getClass()); + UnivariateStatistic.NumberTransformer trans = getTransformer(o.getClass()); if (trans != null) { value = trans.transform(o); } @@ -167,7 +167,7 @@ public class TransformerMap implements NumberTransformer, Serializable { if (map.size() != rhs.map.size()) { return false; } - for (Map.Entry<Class<?>, NumberTransformer> entry : map.entrySet()) { + for (Map.Entry<Class<?>, UnivariateStatistic.NumberTransformer> entry : map.entrySet()) { if (! entry.getValue().equals(rhs.map.get(entry.getKey()))) { return false; } @@ -181,7 +181,7 @@ public class TransformerMap implements NumberTransformer, Serializable { @Override public int hashCode() { int hash = defaultTransformer.hashCode(); - for (NumberTransformer t : map.values()) { + for (UnivariateStatistic.NumberTransformer t : map.values()) { hash = hash * 31 + t.hashCode(); } return hash; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/UnivariateStatistic.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/UnivariateStatistic.java index ab43612..eb26a6a 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/UnivariateStatistic.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/UnivariateStatistic.java @@ -17,8 +17,12 @@ package org.apache.commons.math4.legacy.stat.descriptive; import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; +import org.apache.commons.math4.legacy.exception.NullArgumentException; +import org.apache.commons.math4.legacy.exception.util.LocalizedFormats; import org.apache.commons.math4.legacy.util.MathArrays; +import java.io.Serializable; + /** * Base interface implemented by all statistics. @@ -53,4 +57,80 @@ public interface UnivariateStatistic extends MathArrays.Function { * @return a copy of the statistic */ UnivariateStatistic copy(); + + /** + * Subclasses implementing this interface can transform Objects to doubles. + * + * No longer extends Serializable since 2.0 + * + */ + interface NumberTransformer { + + /** + * Implementing this interface provides a facility to transform + * from Object to Double. + * + * @param o the Object to be transformed. + * @return the double value of the Object. + * @throws MathIllegalArgumentException if the Object can not be transformed into a Double. + */ + double transform(Object o) throws MathIllegalArgumentException; + } + + /** + * A Default NumberTransformer for java.lang.Numbers and Numeric Strings. This + * provides some simple conversion capabilities to turn any java.lang.Number + * into a primitive double or to turn a String representation of a Number into + * a double. + */ + class DefaultTransformer implements NumberTransformer, Serializable { + + /** Serializable version identifier */ + private static final long serialVersionUID = 4019938025047800455L; + + /** + * @param o the object that gets transformed. + * @return a double primitive representation of the Object o. + * @throws NullArgumentException if Object <code>o</code> is {@code null}. + * @throws MathIllegalArgumentException if Object <code>o</code> + * cannot successfully be transformed + * @see <a href="http://commons.apache.org/collections/api-release/org/apache/commons/collections/Transformer.html">Commons Collections Transformer</a> + */ + @Override + public double transform(Object o) + throws NullArgumentException, MathIllegalArgumentException { + + if (o == null) { + throw new NullArgumentException(LocalizedFormats.OBJECT_TRANSFORMATION); + } + + if (o instanceof Number) { + return ((Number)o).doubleValue(); + } + + try { + return Double.parseDouble(o.toString()); + } catch (NumberFormatException e) { + throw new MathIllegalArgumentException(LocalizedFormats.CANNOT_TRANSFORM_TO_DOUBLE, + o.toString()); + } + } + + /** {@inheritDoc} */ + @Override + public boolean equals(Object other) { + if (this == other) { + return true; + } + return other instanceof DefaultTransformer; + } + + /** {@inheritDoc} */ + @Override + public int hashCode() { + // some arbitrary number ... + return 401993047; + } + + } } diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CentralPivotingStrategy.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/CentralPivotingStrategy.java similarity index 89% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CentralPivotingStrategy.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/CentralPivotingStrategy.java index 77c6d3b..d579b8e 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CentralPivotingStrategy.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/CentralPivotingStrategy.java @@ -14,11 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive.rank; import java.io.Serializable; import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; +import org.apache.commons.math4.legacy.stat.descriptive.rank.PivotingStrategyInterface; +import org.apache.commons.math4.legacy.util.MathArrays; /** diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/KthSelector.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelector.java similarity index 97% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/KthSelector.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelector.java index 5b6138c..7c01406 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/KthSelector.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelector.java @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive.rank; import java.io.Serializable; import java.util.Arrays; import org.apache.commons.math4.legacy.exception.NullArgumentException; +import org.apache.commons.math4.legacy.util.FastMath; /** diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Median.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Median.java index 915f48b..26cf10f 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Median.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Median.java @@ -21,7 +21,6 @@ import java.io.Serializable; import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; import org.apache.commons.math4.legacy.exception.NullArgumentException; import org.apache.commons.math4.legacy.stat.ranking.NaNStrategy; -import org.apache.commons.math4.legacy.util.KthSelector; /** diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/MedianOf3PivotingStrategy.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/MedianOf3PivotingStrategy.java similarity index 95% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/MedianOf3PivotingStrategy.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/MedianOf3PivotingStrategy.java index bf5e2cf..9d6338e 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/MedianOf3PivotingStrategy.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/MedianOf3PivotingStrategy.java @@ -14,11 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive.rank; import java.io.Serializable; import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; +import org.apache.commons.math4.legacy.util.MathArrays; /** diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Percentile.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Percentile.java index 1beb937..4063dbe 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Percentile.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Percentile.java @@ -29,10 +29,7 @@ import org.apache.commons.math4.legacy.exception.util.LocalizedFormats; import org.apache.commons.math4.legacy.stat.descriptive.AbstractUnivariateStatistic; import org.apache.commons.math4.legacy.stat.ranking.NaNStrategy; import org.apache.commons.math4.legacy.util.FastMath; -import org.apache.commons.math4.legacy.util.KthSelector; import org.apache.commons.math4.legacy.util.MathArrays; -import org.apache.commons.math4.legacy.util.MedianOf3PivotingStrategy; -import org.apache.commons.math4.legacy.util.PivotingStrategyInterface; import org.apache.commons.numbers.core.Precision; /** diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/PivotingStrategyInterface.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PivotingStrategyInterface.java similarity index 96% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/PivotingStrategyInterface.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PivotingStrategyInterface.java index 5445183..c1cb83c 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/PivotingStrategyInterface.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PivotingStrategyInterface.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive.rank; import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/RandomPivotingStrategy.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java similarity index 94% rename from commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/RandomPivotingStrategy.java rename to commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java index 7fc11f7..fa0def1 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/RandomPivotingStrategy.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java @@ -14,13 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive.rank; import java.io.Serializable; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.ObjectInputStream; import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; +import org.apache.commons.math4.legacy.stat.descriptive.rank.PivotingStrategyInterface; +import org.apache.commons.math4.legacy.util.MathArrays; import org.apache.commons.rng.RestorableUniformRandomProvider; import org.apache.commons.rng.simple.RandomSource; import org.apache.commons.rng.core.RandomProviderDefaultState; diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/DefaultTransformer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/DefaultTransformer.java deleted file mode 100644 index e5711d9..0000000 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/DefaultTransformer.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.commons.math4.legacy.util; - -import java.io.Serializable; - -import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; -import org.apache.commons.math4.legacy.exception.NullArgumentException; -import org.apache.commons.math4.legacy.exception.util.LocalizedFormats; - -/** - * A Default NumberTransformer for java.lang.Numbers and Numeric Strings. This - * provides some simple conversion capabilities to turn any java.lang.Number - * into a primitive double or to turn a String representation of a Number into - * a double. - */ -public class DefaultTransformer implements NumberTransformer, Serializable { - - /** Serializable version identifier */ - private static final long serialVersionUID = 4019938025047800455L; - - /** - * @param o the object that gets transformed. - * @return a double primitive representation of the Object o. - * @throws NullArgumentException if Object <code>o</code> is {@code null}. - * @throws MathIllegalArgumentException if Object <code>o</code> - * cannot successfully be transformed - * @see <a href="http://commons.apache.org/collections/api-release/org/apache/commons/collections/Transformer.html">Commons Collections Transformer</a> - */ - @Override - public double transform(Object o) - throws NullArgumentException, MathIllegalArgumentException { - - if (o == null) { - throw new NullArgumentException(LocalizedFormats.OBJECT_TRANSFORMATION); - } - - if (o instanceof Number) { - return ((Number)o).doubleValue(); - } - - try { - return Double.parseDouble(o.toString()); - } catch (NumberFormatException e) { - throw new MathIllegalArgumentException(LocalizedFormats.CANNOT_TRANSFORM_TO_DOUBLE, - o.toString()); - } - } - - /** {@inheritDoc} */ - @Override - public boolean equals(Object other) { - if (this == other) { - return true; - } - return other instanceof DefaultTransformer; - } - - /** {@inheritDoc} */ - @Override - public int hashCode() { - // some arbitrary number ... - return 401993047; - } - -} diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/NumberTransformer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/NumberTransformer.java deleted file mode 100644 index 88bfc54..0000000 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/NumberTransformer.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.math4.legacy.util; - -import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; - -/** - * Subclasses implementing this interface can transform Objects to doubles. - * - * No longer extends Serializable since 2.0 - * - */ -public interface NumberTransformer { - - /** - * Implementing this interface provides a facility to transform - * from Object to Double. - * - * @param o the Object to be transformed. - * @return the double value of the Object. - * @throws MathIllegalArgumentException if the Object can not be transformed into a Double. - */ - double transform(Object o) throws MathIllegalArgumentException; -} diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ArrayFieldVectorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ArrayFieldVectorTest.java index 65d3059..4d63199 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ArrayFieldVectorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ArrayFieldVectorTest.java @@ -27,8 +27,6 @@ import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException; import org.apache.commons.math4.legacy.exception.OutOfRangeException; import org.apache.commons.math4.legacy.dfp.Dfp; -import org.apache.commons.math4.legacy.util.BigReal; -import org.apache.commons.math4.legacy.util.BigRealField; import org.junit.Assert; import org.junit.Test; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/BigRealFieldTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealFieldTest.java similarity index 89% rename from commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/BigRealFieldTest.java rename to commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealFieldTest.java index d28bab2..0ae912b 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/BigRealFieldTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealFieldTest.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; import org.apache.commons.math4.legacy.TestUtils; +import org.apache.commons.math4.legacy.linear.BigReal; +import org.apache.commons.math4.legacy.linear.BigRealField; import org.junit.Assert; import org.junit.Test; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/BigRealTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealTest.java similarity index 97% rename from commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/BigRealTest.java rename to commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealTest.java index 7f7181a..2b3e00a 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/BigRealTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; import java.math.BigDecimal; import java.math.BigInteger; @@ -22,6 +22,8 @@ import java.math.MathContext; import org.apache.commons.math4.legacy.TestUtils; import org.apache.commons.math4.legacy.exception.MathArithmeticException; +import org.apache.commons.math4.legacy.linear.BigReal; +import org.apache.commons.math4.legacy.util.FastMath; import org.junit.Assert; import org.junit.Test; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockFieldMatrixTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockFieldMatrixTest.java index 32cea98..49ad0b0 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockFieldMatrixTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockFieldMatrixTest.java @@ -29,8 +29,6 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException; import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException; import org.apache.commons.math4.legacy.exception.OutOfRangeException; import org.apache.commons.math4.legacy.dfp.Dfp; -import org.apache.commons.math4.legacy.util.BigReal; -import org.apache.commons.math4.legacy.util.BigRealField; /** * Test cases for the {@link BlockFieldMatrix} class. diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ConjugateGradientTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ConjugateGradientTest.java index 29679c0..8e730c3 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ConjugateGradientTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ConjugateGradientTest.java @@ -22,8 +22,6 @@ import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.exception.MathUnsupportedOperationException; import org.apache.commons.math4.legacy.exception.MaxCountExceededException; import org.apache.commons.math4.legacy.util.FastMath; -import org.apache.commons.math4.legacy.util.IterationEvent; -import org.apache.commons.math4.legacy.util.IterationListener; import org.junit.Assert; import org.junit.Test; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/FieldMatrixImplTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/FieldMatrixImplTest.java index 34aa8c3..56d241f 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/FieldMatrixImplTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/FieldMatrixImplTest.java @@ -28,8 +28,6 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException; import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException; import org.apache.commons.math4.legacy.exception.OutOfRangeException; import org.apache.commons.math4.legacy.dfp.Dfp; -import org.apache.commons.math4.legacy.util.BigReal; -import org.apache.commons.math4.legacy.util.BigRealField; /** * Test cases for the {@link Array2DRowFieldMatrix} class. diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/OpenIntToDoubleHashMapTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMapTest.java similarity index 98% rename from commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/OpenIntToDoubleHashMapTest.java rename to commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMapTest.java index ac63d70..d209658 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/OpenIntToDoubleHashMapTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMapTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; import java.util.ConcurrentModificationException; import java.util.HashMap; @@ -24,6 +24,7 @@ import java.util.NoSuchElementException; import java.util.Random; import java.util.Set; +import org.apache.commons.math4.legacy.linear.OpenIntToDoubleHashMap; import org.apache.commons.numbers.core.Precision; import org.junit.Assert; import org.junit.Before; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/OpenIntToFieldTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldTest.java similarity index 99% rename from commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/OpenIntToFieldTest.java rename to commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldTest.java index e5d7d84..0974c07 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/OpenIntToFieldTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.linear; import java.util.ConcurrentModificationException; import java.util.HashMap; @@ -29,6 +29,7 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.dfp.Dfp; import org.apache.commons.math4.legacy.dfp.DfpField; import org.apache.commons.math4.legacy.linear.Dfp25; +import org.apache.commons.math4.legacy.linear.OpenIntToFieldHashMap; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/SymmLQTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/SymmLQTest.java index 5490c32..ed8805d 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/SymmLQTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/SymmLQTest.java @@ -20,8 +20,6 @@ import java.util.Arrays; import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.util.FastMath; -import org.apache.commons.math4.legacy.util.IterationEvent; -import org.apache.commons.math4.legacy.util.IterationListener; import org.junit.Assert; import org.junit.Test; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/ContinuousOutputFieldModelTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/ContinuousOutputFieldModelTest.java index 4d2aae6..0166b6d 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/ContinuousOutputFieldModelTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/ContinuousOutputFieldModelTest.java @@ -27,7 +27,7 @@ import org.apache.commons.math4.legacy.ode.nonstiff.DormandPrince54FieldIntegrat import org.apache.commons.math4.legacy.ode.nonstiff.DormandPrince853FieldIntegrator; import org.apache.commons.math4.legacy.ode.sampling.DummyFieldStepInterpolator; import org.apache.commons.math4.legacy.ode.sampling.FieldStepInterpolator; -import org.apache.commons.math4.legacy.util.Decimal64Field; +import org.apache.commons.math4.legacy.ode.nonstiff.Decimal64Field; import org.apache.commons.math4.legacy.util.FastMath; import org.apache.commons.math4.legacy.util.MathArrays; import org.junit.Assert; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/FieldExpandableODETest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/FieldExpandableODETest.java index a988abb..1d37c36 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/FieldExpandableODETest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/FieldExpandableODETest.java @@ -22,7 +22,7 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; -import org.apache.commons.math4.legacy.util.Decimal64Field; +import org.apache.commons.math4.legacy.ode.nonstiff.Decimal64Field; import org.apache.commons.math4.legacy.util.MathArrays; import org.junit.Assert; import org.junit.Test; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsBashforthFieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsBashforthFieldIntegratorTest.java index 68ac6d7..9a542be 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsBashforthFieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsBashforthFieldIntegratorTest.java @@ -23,7 +23,6 @@ import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.exception.MathIllegalStateException; import org.apache.commons.math4.legacy.exception.MaxCountExceededException; import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class AdamsBashforthFieldIntegratorTest extends AdamsFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsMoultonFieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsMoultonFieldIntegratorTest.java index 40928f5..13c8515 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsMoultonFieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsMoultonFieldIntegratorTest.java @@ -23,7 +23,6 @@ import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.exception.MathIllegalStateException; import org.apache.commons.math4.legacy.exception.MaxCountExceededException; import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class AdamsMoultonFieldIntegratorTest extends AdamsFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ClassicalRungKuttaFieldStepInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ClassicalRungKuttaFieldStepInterpolatorTest.java index b19d56c..0c2279a 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ClassicalRungKuttaFieldStepInterpolatorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ClassicalRungKuttaFieldStepInterpolatorTest.java @@ -22,7 +22,6 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.ode.FieldEquationsMapper; import org.apache.commons.math4.legacy.ode.FieldODEStateAndDerivative; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class ClassicalRungKuttaFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ClassicalRungeKuttaFieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ClassicalRungeKuttaFieldIntegratorTest.java index 7c4f11d..c698a44 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ClassicalRungeKuttaFieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ClassicalRungeKuttaFieldIntegratorTest.java @@ -20,7 +20,6 @@ package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; -import org.apache.commons.math4.legacy.util.Decimal64Field; public class ClassicalRungeKuttaFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/Decimal64Test.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64Test.java similarity index 99% rename from commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/Decimal64Test.java rename to commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64Test.java index 0489fb7..acb1304 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/Decimal64Test.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/Decimal64Test.java @@ -14,9 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.ExtendedFieldElementAbstractTest; +import org.apache.commons.math4.legacy.ode.nonstiff.Decimal64; import org.junit.Assert; import org.junit.Test; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldIntegratorTest.java index f7860f0..70f646f 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldIntegratorTest.java @@ -20,7 +20,6 @@ package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; -import org.apache.commons.math4.legacy.util.Decimal64Field; public class DormandPrince54FieldIntegratorTest extends EmbeddedRungeKuttaFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldStepInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldStepInterpolatorTest.java index b69b37f..a8bce6f 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldStepInterpolatorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldStepInterpolatorTest.java @@ -22,7 +22,6 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.ode.FieldEquationsMapper; import org.apache.commons.math4.legacy.ode.FieldODEStateAndDerivative; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class DormandPrince54FieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldIntegratorTest.java index 0925fe2..cc35c4a 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldIntegratorTest.java @@ -20,7 +20,6 @@ package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; -import org.apache.commons.math4.legacy.util.Decimal64Field; public class DormandPrince853FieldIntegratorTest extends EmbeddedRungeKuttaFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldStepInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldStepInterpolatorTest.java index 01a1c7f..f4c9c53 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldStepInterpolatorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldStepInterpolatorTest.java @@ -22,7 +22,6 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.ode.FieldEquationsMapper; import org.apache.commons.math4.legacy.ode.FieldODEStateAndDerivative; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class DormandPrince853FieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/EulerFieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/EulerFieldIntegratorTest.java index 1dde228..35f378b 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/EulerFieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/EulerFieldIntegratorTest.java @@ -20,7 +20,6 @@ package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; -import org.apache.commons.math4.legacy.util.Decimal64Field; public class EulerFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/EulerFieldStepInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/EulerFieldStepInterpolatorTest.java index 10606f8..d63bd6e 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/EulerFieldStepInterpolatorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/EulerFieldStepInterpolatorTest.java @@ -22,7 +22,6 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.ode.FieldEquationsMapper; import org.apache.commons.math4.legacy.ode.FieldODEStateAndDerivative; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class EulerFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/GillFieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/GillFieldIntegratorTest.java index 047c42b..61799d4 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/GillFieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/GillFieldIntegratorTest.java @@ -20,7 +20,6 @@ package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; -import org.apache.commons.math4.legacy.util.Decimal64Field; public class GillFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/GillFieldStepInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/GillFieldStepInterpolatorTest.java index 563adbf..839cb0c 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/GillFieldStepInterpolatorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/GillFieldStepInterpolatorTest.java @@ -22,7 +22,6 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.ode.FieldEquationsMapper; import org.apache.commons.math4.legacy.ode.FieldODEStateAndDerivative; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class GillFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54FieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54FieldIntegratorTest.java index ffd668b..a40c1c6 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54FieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54FieldIntegratorTest.java @@ -20,7 +20,6 @@ package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; -import org.apache.commons.math4.legacy.util.Decimal64Field; public class HighamHall54FieldIntegratorTest extends EmbeddedRungeKuttaFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54FieldStepInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54FieldStepInterpolatorTest.java index 9f318b5..989df17 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54FieldStepInterpolatorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54FieldStepInterpolatorTest.java @@ -22,7 +22,6 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.ode.FieldEquationsMapper; import org.apache.commons.math4.legacy.ode.FieldODEStateAndDerivative; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class HighamHall54FieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldIntegratorTest.java index 25c2c99..34842fc 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldIntegratorTest.java @@ -24,7 +24,6 @@ import org.apache.commons.math4.legacy.exception.DimensionMismatchException; import org.apache.commons.math4.legacy.exception.MaxCountExceededException; import org.apache.commons.math4.legacy.exception.NoBracketingException; import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException; -import org.apache.commons.math4.legacy.util.Decimal64Field; public class LutherFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldStepInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldStepInterpolatorTest.java index f0fd780..d368902 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldStepInterpolatorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldStepInterpolatorTest.java @@ -22,7 +22,6 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.ode.FieldEquationsMapper; import org.apache.commons.math4.legacy.ode.FieldODEStateAndDerivative; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class LutherFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointFieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointFieldIntegratorTest.java index 7e35a82..079610f 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointFieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointFieldIntegratorTest.java @@ -20,7 +20,6 @@ package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; -import org.apache.commons.math4.legacy.util.Decimal64Field; public class MidpointFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointFieldStepInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointFieldStepInterpolatorTest.java index dadaf8e..d89662c 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointFieldStepInterpolatorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointFieldStepInterpolatorTest.java @@ -22,7 +22,6 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.ode.FieldEquationsMapper; import org.apache.commons.math4.legacy.ode.FieldODEStateAndDerivative; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class MidpointFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesFieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesFieldIntegratorTest.java index 164d464..dbba099 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesFieldIntegratorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesFieldIntegratorTest.java @@ -20,7 +20,6 @@ package org.apache.commons.math4.legacy.ode.nonstiff; import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; -import org.apache.commons.math4.legacy.util.Decimal64Field; public class ThreeEighthesFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java index c1152b8..dcc72ed 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java @@ -22,7 +22,6 @@ import org.apache.commons.math4.legacy.Field; import org.apache.commons.math4.legacy.RealFieldElement; import org.apache.commons.math4.legacy.ode.FieldEquationsMapper; import org.apache.commons.math4.legacy.ode.FieldODEStateAndDerivative; -import org.apache.commons.math4.legacy.util.Decimal64Field; import org.junit.Test; public class ThreeEighthesFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/DefaultTransformerTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/DefaultTransformerTest.java similarity index 75% rename from commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/DefaultTransformerTest.java rename to commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/DefaultTransformerTest.java index d049168..e29890d 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/DefaultTransformerTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/DefaultTransformerTest.java @@ -15,13 +15,14 @@ * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive; import java.math.BigDecimal; import org.apache.commons.math4.legacy.TestUtils; import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; import org.apache.commons.math4.legacy.exception.NullArgumentException; +import org.apache.commons.math4.legacy.stat.descriptive.UnivariateStatistic; import org.junit.Assert; import org.junit.Test; @@ -35,7 +36,7 @@ public class DefaultTransformerTest { public void testTransformDouble() throws Exception { double expected = 1.0; Double input = Double.valueOf(expected); - DefaultTransformer t = new DefaultTransformer(); + UnivariateStatistic.DefaultTransformer t = new UnivariateStatistic.DefaultTransformer(); Assert.assertEquals(expected, t.transform(input), 1.0e-4); } @@ -44,7 +45,7 @@ public class DefaultTransformerTest { */ @Test public void testTransformNull() throws Exception { - DefaultTransformer t = new DefaultTransformer(); + UnivariateStatistic.DefaultTransformer t = new UnivariateStatistic.DefaultTransformer(); try { t.transform(null); Assert.fail("Expecting NullArgumentException"); @@ -60,7 +61,7 @@ public class DefaultTransformerTest { public void testTransformInteger() throws Exception { double expected = 1.0; Integer input = Integer.valueOf(1); - DefaultTransformer t = new DefaultTransformer(); + UnivariateStatistic.DefaultTransformer t = new UnivariateStatistic.DefaultTransformer(); Assert.assertEquals(expected, t.transform(input), 1.0e-4); } @@ -71,7 +72,7 @@ public class DefaultTransformerTest { public void testTransformBigDecimal() throws Exception { double expected = 1.0; BigDecimal input = new BigDecimal("1.0"); - DefaultTransformer t = new DefaultTransformer(); + UnivariateStatistic.DefaultTransformer t = new UnivariateStatistic.DefaultTransformer(); Assert.assertEquals(expected, t.transform(input), 1.0e-4); } @@ -82,7 +83,7 @@ public class DefaultTransformerTest { public void testTransformString() throws Exception { double expected = 1.0; String input = "1.0"; - DefaultTransformer t = new DefaultTransformer(); + UnivariateStatistic.DefaultTransformer t = new UnivariateStatistic.DefaultTransformer(); Assert.assertEquals(expected, t.transform(input), 1.0e-4); } @@ -92,13 +93,13 @@ public class DefaultTransformerTest { @Test(expected=MathIllegalArgumentException.class) public void testTransformObject(){ Boolean input = Boolean.TRUE; - DefaultTransformer t = new DefaultTransformer(); + UnivariateStatistic.DefaultTransformer t = new UnivariateStatistic.DefaultTransformer(); t.transform(input); } @Test public void testSerial() { - Assert.assertEquals(new DefaultTransformer(), TestUtils.serializeAndRecover(new DefaultTransformer())); + Assert.assertEquals(new UnivariateStatistic.DefaultTransformer(), TestUtils.serializeAndRecover(new UnivariateStatistic.DefaultTransformer())); } } diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/DoubleArrayAbstractTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/DoubleArrayAbstractTest.java similarity index 96% rename from commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/DoubleArrayAbstractTest.java rename to commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/DoubleArrayAbstractTest.java index e113c31..1f9e253 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/DoubleArrayAbstractTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/DoubleArrayAbstractTest.java @@ -14,9 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive; import org.apache.commons.math4.legacy.stat.StatUtils; +import org.apache.commons.math4.legacy.stat.descriptive.DoubleArray; import org.junit.Assert; import org.junit.Test; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/ListUnivariateImpl.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/ListUnivariateImpl.java index 4f753c2..96b4af6 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/ListUnivariateImpl.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/ListUnivariateImpl.java @@ -21,9 +21,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; -import org.apache.commons.math4.legacy.util.DefaultTransformer; import org.apache.commons.math4.legacy.util.FastMath; -import org.apache.commons.math4.legacy.util.NumberTransformer; /** */ @@ -36,7 +34,7 @@ public class ListUnivariateImpl extends DescriptiveStatistics implements Seriali */ protected List<Object> list; /** Number Transformer maps Objects to Number for us. */ - protected NumberTransformer transformer; + protected UnivariateStatistic.NumberTransformer transformer; /** * No argument constructor @@ -50,7 +48,7 @@ public class ListUnivariateImpl extends DescriptiveStatistics implements Seriali * @param list The list that will back this DescriptiveStatistics */ public ListUnivariateImpl(List<Object> list) { - this(list, new DefaultTransformer()); + this(list, new UnivariateStatistic.DefaultTransformer()); } /** @@ -58,7 +56,7 @@ public class ListUnivariateImpl extends DescriptiveStatistics implements Seriali * @param list The list that will back this DescriptiveStatistics * @param transformer the number transformer used to convert the list items. */ - public ListUnivariateImpl(List<Object> list, NumberTransformer transformer) { + public ListUnivariateImpl(List<Object> list, UnivariateStatistic.NumberTransformer transformer) { this.list = list; this.transformer = transformer; } @@ -171,7 +169,7 @@ public class ListUnivariateImpl extends DescriptiveStatistics implements Seriali * Access the number transformer. * @return the number transformer. */ - public NumberTransformer getTransformer() { + public UnivariateStatistic.NumberTransformer getTransformer() { return transformer; } @@ -179,7 +177,7 @@ public class ListUnivariateImpl extends DescriptiveStatistics implements Seriali * Modify the number transformer. * @param transformer the new number transformer. */ - public void setTransformer(NumberTransformer transformer) { + public void setTransformer(UnivariateStatistic.NumberTransformer transformer) { this.transformer = transformer; } diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/MixedListUnivariateImplTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/MixedListUnivariateImplTest.java index 88414d0..e7feadf 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/MixedListUnivariateImplTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/MixedListUnivariateImplTest.java @@ -21,8 +21,6 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.math4.legacy.util.FastMath; -import org.apache.commons.math4.legacy.util.NumberTransformer; -import org.apache.commons.math4.legacy.util.TransformerMap; import org.junit.Assert; import org.junit.Test; @@ -179,7 +177,7 @@ public final class MixedListUnivariateImplTest { } } - public static final class FooTransformer implements NumberTransformer, Serializable { + public static final class FooTransformer implements UnivariateStatistic.NumberTransformer, Serializable { private static final long serialVersionUID = -4252248129291326127L; @Override public double transform(Object o) { @@ -193,7 +191,7 @@ public final class MixedListUnivariateImplTest { } } - public static final class BarTransformer implements NumberTransformer, Serializable { + public static final class BarTransformer implements UnivariateStatistic.NumberTransformer, Serializable { private static final long serialVersionUID = -1768345377764262043L; @Override public double transform(Object o) { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/ResizableDoubleArrayTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/ResizableDoubleArrayTest.java similarity index 99% rename from commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/ResizableDoubleArrayTest.java rename to commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/ResizableDoubleArrayTest.java index 3b31195..8a2a5a7 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/ResizableDoubleArrayTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/ResizableDoubleArrayTest.java @@ -14,14 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive; +import org.apache.commons.math4.legacy.util.MathArrays; import org.apache.commons.statistics.distribution.DiscreteDistribution; import org.apache.commons.statistics.distribution.UniformDiscreteDistribution; import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException; import org.apache.commons.math4.legacy.exception.NullArgumentException; import org.apache.commons.rng.simple.RandomSource; -import org.apache.commons.math4.legacy.util.ResizableDoubleArray.ExpansionMode; +import org.apache.commons.math4.legacy.stat.descriptive.ResizableDoubleArray.ExpansionMode; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/TransformerMapTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/TransformerMapTest.java similarity index 79% rename from commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/TransformerMapTest.java rename to commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/TransformerMapTest.java index 1bc1e80..6862b5a 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/TransformerMapTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/TransformerMapTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive; import org.apache.commons.math4.legacy.TestUtils; import org.junit.Assert; @@ -30,7 +30,7 @@ public class TransformerMapTest { */ @Test public void testPutTransformer(){ - NumberTransformer expected = new DefaultTransformer(); + UnivariateStatistic.NumberTransformer expected = new UnivariateStatistic.DefaultTransformer(); TransformerMap map = new TransformerMap(); map.putTransformer(TransformerMapTest.class, expected); @@ -42,7 +42,7 @@ public class TransformerMapTest { */ @Test public void testContainsClass(){ - NumberTransformer expected = new DefaultTransformer(); + UnivariateStatistic.NumberTransformer expected = new UnivariateStatistic.DefaultTransformer(); TransformerMap map = new TransformerMap(); map.putTransformer(TransformerMapTest.class, expected); Assert.assertTrue(map.containsClass(TransformerMapTest.class)); @@ -53,7 +53,7 @@ public class TransformerMapTest { */ @Test public void testContainsTransformer(){ - NumberTransformer expected = new DefaultTransformer(); + UnivariateStatistic.NumberTransformer expected = new UnivariateStatistic.DefaultTransformer(); TransformerMap map = new TransformerMap(); map.putTransformer(TransformerMapTest.class, expected); Assert.assertTrue(map.containsTransformer(expected)); @@ -64,7 +64,7 @@ public class TransformerMapTest { */ @Test public void testRemoveTransformer(){ - NumberTransformer expected = new DefaultTransformer(); + UnivariateStatistic.NumberTransformer expected = new UnivariateStatistic.DefaultTransformer(); TransformerMap map = new TransformerMap(); map.putTransformer(TransformerMapTest.class, expected); @@ -80,7 +80,7 @@ public class TransformerMapTest { */ @Test public void testClear(){ - NumberTransformer expected = new DefaultTransformer(); + UnivariateStatistic.NumberTransformer expected = new UnivariateStatistic.DefaultTransformer(); TransformerMap map = new TransformerMap(); map.putTransformer(TransformerMapTest.class, expected); @@ -94,7 +94,7 @@ public class TransformerMapTest { */ @Test public void testClasses(){ - NumberTransformer expected = new DefaultTransformer(); + UnivariateStatistic.NumberTransformer expected = new UnivariateStatistic.DefaultTransformer(); TransformerMap map = new TransformerMap(); map.putTransformer(TransformerMapTest.class, expected); Assert.assertTrue(map.classes().contains(TransformerMapTest.class)); @@ -105,7 +105,7 @@ public class TransformerMapTest { */ @Test public void testTransformers(){ - NumberTransformer expected = new DefaultTransformer(); + UnivariateStatistic.NumberTransformer expected = new UnivariateStatistic.DefaultTransformer(); TransformerMap map = new TransformerMap(); map.putTransformer(TransformerMapTest.class, expected); Assert.assertTrue(map.transformers().contains(expected)); @@ -113,7 +113,7 @@ public class TransformerMapTest { @Test public void testSerial(){ - NumberTransformer expected = new DefaultTransformer(); + UnivariateStatistic.NumberTransformer expected = new UnivariateStatistic.DefaultTransformer(); TransformerMap map = new TransformerMap(); map.putTransformer(TransformerMapTest.class, expected); Assert.assertEquals(map, TestUtils.serializeAndRecover(map)); diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/KthSelectorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelectorTest.java similarity index 94% rename from commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/KthSelectorTest.java rename to commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelectorTest.java index a808f2c..aee80ed 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/KthSelectorTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelectorTest.java @@ -14,13 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math4.legacy.util; +package org.apache.commons.math4.legacy.stat.descriptive.rank; import static org.junit.Assert.assertEquals; import java.util.Arrays; import java.util.Random; +import org.apache.commons.math4.legacy.stat.descriptive.rank.KthSelector; import org.junit.Test; public class KthSelectorTest { diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PercentileTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PercentileTest.java index ad1ad37..a430409 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PercentileTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PercentileTest.java @@ -33,11 +33,6 @@ import org.apache.commons.math4.legacy.stat.descriptive.UnivariateStatistic; import org.apache.commons.math4.legacy.stat.descriptive.UnivariateStatisticAbstractTest; import org.apache.commons.math4.legacy.stat.descriptive.rank.Percentile.EstimationType; import org.apache.commons.math4.legacy.stat.ranking.NaNStrategy; -import org.apache.commons.math4.legacy.util.CentralPivotingStrategy; -import org.apache.commons.math4.legacy.util.KthSelector; -import org.apache.commons.math4.legacy.util.MedianOf3PivotingStrategy; -import org.apache.commons.math4.legacy.util.PivotingStrategyInterface; -import org.apache.commons.math4.legacy.util.RandomPivotingStrategy; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/pom.xml b/pom.xml index 4c2ac7e..aeaae10 100644 --- a/pom.xml +++ b/pom.xml @@ -1049,6 +1049,9 @@ <contributor> <name>Alex Herbert</name> </contributor> + <contributor> + <name>Samy Badjoudj</name> + </contributor> </contributors> </project>