Skip to content

Commit

Permalink
MATH-1416: Depend on "Commons Numbers".
Browse files Browse the repository at this point in the history
Replaced class "Precision" by its equivalent in module "commons-numbers-core".
  • Loading branch information
Gilles committed May 3, 2017
1 parent ef2507a commit e082e0c
Show file tree
Hide file tree
Showing 89 changed files with 90 additions and 1,247 deletions.
Expand Up @@ -28,7 +28,7 @@
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* First derivative computation with large number of variables.
Expand Down
Expand Up @@ -26,7 +26,7 @@
import org.apache.commons.math4.exception.NotStrictlyPositiveException;
import org.apache.commons.math4.exception.NullArgumentException;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* <a href="http://en.wikipedia.org/wiki/Gaussian_function">
Expand Down
Expand Up @@ -80,7 +80,7 @@ public abstract class BaseAbstractUnivariateIntegrator implements UnivariateInte
* achieved due to large values or short mantissa length. If this
* should be the primary criterion for convergence rather then a
* safety measure, set the absolute accuracy to a ridiculously small value,
* like {@link org.apache.commons.math4.util.Precision#SAFE_MIN Precision.SAFE_MIN}.</li>
* like {@link org.apache.commons.numbers.core.Precision#SAFE_MIN Precision.SAFE_MIN}.</li>
* <li>absolute accuracy:
* The default is usually chosen so that results in the interval
* -10..-0.1 and +0.1..+10 can be found with a reasonable accuracy. If the
Expand Down
Expand Up @@ -25,7 +25,7 @@
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Computes a cubic spline interpolation for the data set using the Akima
Expand Down
Expand Up @@ -24,7 +24,7 @@
import org.apache.commons.math4.exception.NumberIsTooSmallException;
import org.apache.commons.math4.exception.TooManyEvaluationsException;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* This class implements a modification of the <a
Expand Down
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.math4.exception.NumberIsTooLargeException;
import org.apache.commons.math4.exception.TooManyEvaluationsException;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* This class implements the <a href="http://mathworld.wolfram.com/BrentsMethod.html">
Expand Down
Expand Up @@ -27,7 +27,7 @@
import org.apache.commons.math4.util.IntegerSequence;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* This class implements a modification of the <a
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/apache/commons/math4/complex/Complex.java
Expand Up @@ -27,7 +27,7 @@
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Representation of a Complex number, i.e. a number which has both a
Expand All @@ -46,8 +46,8 @@
* Note that this contradicts the IEEE-754 standard for floating
* point numbers (according to which the test {@code x == x} must fail if
* {@code x} is {@code NaN}). The method
* {@link org.apache.commons.math4.util.Precision#equals(double,double,int)
* equals for primitive double} in {@link org.apache.commons.math4.util.Precision}
* {@link org.apache.commons.numbers.core.Precision#equals(double,double,int)
* equals for primitive double} in {@link org.apache.commons.numbers.core.Precision}
* conforms with IEEE-754 while this class conforms with the standard behavior
* for Java object types.</p>
*
Expand Down
Expand Up @@ -24,7 +24,7 @@
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* This class implements <a href="http://mathworld.wolfram.com/Quaternion.html">
Expand Down
Expand Up @@ -18,7 +18,7 @@

import org.apache.commons.math4.fitting.leastsquares.LeastSquaresProblem.Evaluation;
import org.apache.commons.math4.optim.ConvergenceChecker;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Check if an optimization has converged based on the change in computed RMS.
Expand Down
Expand Up @@ -26,7 +26,7 @@
import org.apache.commons.math4.optim.ConvergenceChecker;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Incrementor;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;


/**
Expand Down
Expand Up @@ -27,7 +27,7 @@
import org.apache.commons.math4.geometry.partitioning.BSPTree;
import org.apache.commons.math4.geometry.partitioning.BoundaryProjection;
import org.apache.commons.math4.geometry.partitioning.SubHyperplane;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/** This class represents a 1D region: a set of intervals.
* @since 3.0
Expand Down
Expand Up @@ -25,7 +25,7 @@
import org.apache.commons.math4.geometry.euclidean.oned.Vector1D;
import org.apache.commons.math4.geometry.partitioning.Embedding;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/** The class represent lines in a three dimensional space.
Expand Down
Expand Up @@ -34,7 +34,7 @@
import org.apache.commons.math4.geometry.partitioning.Side;
import org.apache.commons.math4.geometry.partitioning.SubHyperplane;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/** This class represents a 2D region: a set of polygons.
* @since 3.0
Expand Down
Expand Up @@ -29,7 +29,7 @@
import org.apache.commons.math4.geometry.partitioning.Region;
import org.apache.commons.math4.geometry.partitioning.RegionFactory;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* This class represents a convex hull in an two-dimensional euclidean space.
Expand Down
Expand Up @@ -25,7 +25,7 @@
import org.apache.commons.math4.geometry.euclidean.twod.Line;
import org.apache.commons.math4.geometry.euclidean.twod.Vector2D;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Implements Andrew's monotone chain method to generate the convex hull of a finite set of
Expand Down
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.math4.geometry.partitioning.Region.Location;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;


/** This class represents an arc on a circle.
Expand Down
Expand Up @@ -34,7 +34,7 @@
import org.apache.commons.math4.geometry.partitioning.SubHyperplane;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/** This class represents a region of a circle: a set of arcs.
* <p>
Expand Down
Expand Up @@ -25,7 +25,7 @@
import org.apache.commons.math4.exception.OutOfRangeException;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Implementation of a diagonal matrix.
Expand Down
Expand Up @@ -24,7 +24,7 @@
import org.apache.commons.math4.exception.MaxCountExceededException;
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Calculates the eigen decomposition of a real matrix.
Expand Down
Expand Up @@ -18,7 +18,7 @@
package org.apache.commons.math4.linear;

import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Class transforming a general real matrix to Hessenberg form.
Expand Down
Expand Up @@ -37,7 +37,7 @@
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* A collection of static methods that operate on or return matrices.
Expand Down
Expand Up @@ -20,7 +20,7 @@
import org.apache.commons.math4.exception.MaxCountExceededException;
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Class transforming a general real matrix to Schur form.
Expand Down
Expand Up @@ -19,7 +19,7 @@
import org.apache.commons.math4.exception.NumberIsTooLargeException;
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Calculates the compact Singular Value Decomposition of a matrix.
Expand Down
Expand Up @@ -23,7 +23,7 @@
import java.util.concurrent.atomic.AtomicLong;

import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;


/**
Expand Down
Expand Up @@ -39,7 +39,7 @@
import org.apache.commons.math4.ode.sampling.StepHandler;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.IntegerSequence;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Base class managing common boilerplate for all integrators.
Expand Down
Expand Up @@ -83,7 +83,7 @@ protected boolean getTriggeredIncreasing() {
* <li>h = min(-s,-g,+g)</li>
* <li>h = -g</li>
* </ul>
* where s is a tiny positive value: {@link org.apache.commons.math4.util.Precision#SAFE_MIN}.
* where s is a tiny positive value: {@link org.apache.commons.numbers.core.Precision#SAFE_MIN}.
* </p>
*/
@Override
Expand Down Expand Up @@ -261,7 +261,7 @@ protected boolean getTriggeredIncreasing() {
* <li>h = min(-s,-g,+g)</li>
* <li>h = -g</li>
* </ul>
* where s is a tiny positive value: {@link org.apache.commons.math4.util.Precision#SAFE_MIN}.
* where s is a tiny positive value: {@link org.apache.commons.numbers.core.Precision#SAFE_MIN}.
* </p>
*/
@Override
Expand Down
Expand Up @@ -18,7 +18,7 @@
package org.apache.commons.math4.ode.events;

import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;


/** Transformer for {@link EventHandler#g(double, double[]) g functions}.
Expand Down
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.math4.exception.MaxCountExceededException;
import org.apache.commons.math4.ode.FieldODEStateAndDerivative;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* This class wraps an object implementing {@link FieldFixedStepHandler}
Expand Down
Expand Up @@ -19,7 +19,7 @@

import org.apache.commons.math4.exception.MaxCountExceededException;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* This class wraps an object implementing {@link FixedStepHandler}
Expand Down
Expand Up @@ -23,7 +23,7 @@
import org.apache.commons.math4.optim.OptimizationData;
import org.apache.commons.math4.optim.PointValuePair;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Solves a linear problem using the "Two-Phase Simplex" method.
Expand Down
Expand Up @@ -34,7 +34,7 @@
import org.apache.commons.math4.linear.RealVector;
import org.apache.commons.math4.optim.PointValuePair;
import org.apache.commons.math4.optim.nonlinear.scalar.GoalType;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* A tableau for use in the Simplex method.
Expand Down
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.math4.optim.ConvergenceChecker;
import org.apache.commons.math4.optim.nonlinear.scalar.GoalType;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* For a function defined on some interval {@code (lo, hi)}, this class
Expand Down
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Abstract base class for implementations of the
Expand Down
Expand Up @@ -34,7 +34,7 @@
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* <p>Computes summary statistics for a stream of n-tuples added using the
Expand Down
Expand Up @@ -20,7 +20,7 @@

import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Value object representing the results of a univariate statistical summary.
Expand Down
Expand Up @@ -32,7 +32,7 @@
import org.apache.commons.math4.stat.descriptive.summary.SumOfSquares;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* <p>
Expand Down
Expand Up @@ -37,7 +37,7 @@
import org.apache.commons.math4.stat.descriptive.StorelessUnivariateStatistic;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* A {@link StorelessUnivariateStatistic} estimating percentiles using the
Expand Down
Expand Up @@ -32,7 +32,7 @@
import org.apache.commons.math4.util.MathUtils;
import org.apache.commons.math4.util.MedianOf3PivotingStrategy;
import org.apache.commons.math4.util.PivotingStrategyInterface;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Provides percentile computation.
Expand Down
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* This class is a concrete implementation of the {@link UpdatingMultipleLinearRegression} interface.
Expand Down
Expand Up @@ -24,7 +24,7 @@
import org.apache.commons.math4.exception.OutOfRangeException;
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Precision;
import org.apache.commons.numbers.core.Precision;

/**
* Estimates an ordinary least squares regression model
Expand Down
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.commons.math4.util;

import org.apache.commons.numbers.core.Precision;
import org.apache.commons.math4.exception.ConvergenceException;
import org.apache.commons.math4.exception.MaxCountExceededException;
import org.apache.commons.math4.exception.util.LocalizedFormats;
Expand Down

0 comments on commit e082e0c

Please sign in to comment.