diff --git a/src/main/java/org/apache/commons/math3/RealFieldElement.java b/src/main/java/org/apache/commons/math3/RealFieldElement.java
index 033d65948..f0852d9e3 100644
--- a/src/main/java/org/apache/commons/math3/RealFieldElement.java
+++ b/src/main/java/org/apache/commons/math3/RealFieldElement.java
@@ -53,7 +53,7 @@ public interface RealFieldElement
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * Point type.
* @version $Id$
diff --git a/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/FieldRotation.java b/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/FieldRotation.java
index c74446967..c5c8ecf42 100644
--- a/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/FieldRotation.java
+++ b/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/FieldRotation.java
@@ -19,8 +19,8 @@ package org.apache.commons.math3.geometry.euclidean.threed;
import java.io.Serializable;
-import org.apache.commons.math3.Field;
import org.apache.commons.math3.RealFieldElement;
+import org.apache.commons.math3.Field;
import org.apache.commons.math3.exception.MathArithmeticException;
import org.apache.commons.math3.exception.MathIllegalArgumentException;
import org.apache.commons.math3.exception.util.LocalizedFormats;
@@ -1158,7 +1158,9 @@ public class FieldRotation This distance is an angle between 0 and π. Its value is the smallest
* possible upper bound of the angle in radians between r1(v)
* and r2(v) for all possible vectors v. This upper bound is
diff --git a/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/FieldVector3D.java b/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/FieldVector3D.java
index aa378a703..5371054ac 100644
--- a/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/FieldVector3D.java
+++ b/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/FieldVector3D.java
@@ -539,7 +539,7 @@ public class FieldVector3D This distance is an angle between 0 and π. Its value is the smallest
* possible upper bound of the angle in radians between r1(v)
* and r2(v) for all possible vectors v. This upper bound is
diff --git a/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Vector3D.java b/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Vector3D.java
index 2f6ad1777..e57d742d1 100644
--- a/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Vector3D.java
+++ b/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Vector3D.java
@@ -313,7 +313,7 @@ public class Vector3D implements Serializable, Vector
- * Sub-spaces are the lower dimensions subsets of a n-dimensions
+
+ * Sub-spaces are the lower dimensions subsets of a n-dimensions
* space. The (n-1)-dimension sub-spaces are specific sub-spaces known
* as {@link Hyperplane hyperplanes}. This interface can be used regardless
* of the dimensions differences. As an example, {@link
* org.apache.commons.math3.geometry.euclidean.threed.Line Line} in 3D
- * implements Embedding<{@link
- * org.apache.commons.math3.geometry.euclidean.threed.Vector3D Vector3D}, {@link
- * org.apache.commons.math3.geometry.euclidean.oned.Vector1D Vector1D}>, i.e. it
- * maps directly dimensions 3 and 1.
- *
- * In the 3D euclidean space, hyperplanes are 2D planes, and the 1D
- * sub-spaces are lines.
+ * implements Embedding<{@link
+ * org.apache.commons.math3.geometry.euclidean.threed.Vector3D Vector3D}, {link
+ * org.apache.commons.math3.geometry.euclidean.oned.Vector1D Vector1D>, i.e. it
+ * maps directly dimensions 3 and 1. In the 3D euclidean space, hyperplanes are 2D planes, and the 1D
+ * sub-spaces are lines.
* Note that this interface is not intended to be implemented
* by Apache Commons Math users, it is only intended to be implemented
* within the library itself. New methods may be added even for minor
* versions, which breaks compatibility for external implementations.
- *
+ * This picture shows a set of 100000 random 2-D pairs having their
* first component between -50 and +150 and their second component
diff --git a/src/main/java/org/apache/commons/math3/geometry/spherical/twod/SphericalPolygonsSet.java b/src/main/java/org/apache/commons/math3/geometry/spherical/twod/SphericalPolygonsSet.java
index 46b610c39..669ae4986 100644
--- a/src/main/java/org/apache/commons/math3/geometry/spherical/twod/SphericalPolygonsSet.java
+++ b/src/main/java/org/apache/commons/math3/geometry/spherical/twod/SphericalPolygonsSet.java
@@ -431,7 +431,7 @@ public class SphericalPolygonsSet extends AbstractRegion
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
- * Generally, optimizers are algorithms that will either
- * {@link org.apache.commons.math3.optim.nonlinear.scalar.GoalType#MINIMIZE minimize} or
- * {@link org.apache.commons.math3.optim.nonlinear.scalar.GoalType#MAXIMIZE maximize}
- * a scalar function, called the
- * {@link org.apache.commons.math3.optim.nonlinear.scalar.ObjectiveFunction objective
- * function}.
+ * Generally, optimizers are algorithms that will either
+ * {@link org.apache.commons.math3.optim.nonlinear.scalar.GoalType#MINIMIZE minimize} or
+ * {@link org.apache.commons.math3.optim.nonlinear.scalar.GoalType#MAXIMIZE maximize}
+ * a scalar function, called the
+ * {@link org.apache.commons.math3.optim.nonlinear.scalar.ObjectiveFunction objective
+ * function}.
+ *
- * For some scalar objective functions the gradient can be computed (analytically
- * or numerically). Algorithms that use this knowledge are defined in the
- * {@link org.apache.commons.math3.optim.nonlinear.scalar.gradient} package.
- * The algorithms that do not need this additional information are located in
- * the {@link org.apache.commons.math3.optim.nonlinear.scalar.noderiv} package.
+ * Some problems are solved more efficiently by algorithms that, instead of an
+ * objective function, need access to a
+ * {@link org.apache.commons.math3.optim.nonlinear.vector.ModelFunction
+ * model function}: such a model predicts a set of values which the
+ * algorithm tries to match with a set of given
+ * {@link org.apache.commons.math3.optim.nonlinear.vector.Target target values}.
+ * Those algorithms are located in the
+ * {@link org.apache.commons.math3.optim.nonlinear.vector} package.
+ *
- * Some problems are solved more efficiently by algorithms that, instead of an
- * objective function, need access to a
- * {@link org.apache.commons.math3.optim.nonlinear.vector.ModelFunction
- * model function}: such a model predicts a set of values which the
- * algorithm tries to match with a set of given
- * {@link org.apache.commons.math3.optim.nonlinear.vector.Target target values}.
- * Those algorithms are located in the
- * {@link org.apache.commons.math3.optim.nonlinear.vector} package.
+ * This package provides common functionality for the optimization algorithms.
+ * Abstract classes ({@link org.apache.commons.math3.optim.BaseOptimizer} and
+ * {@link org.apache.commons.math3.optim.BaseMultivariateOptimizer}) contain
+ * boiler-plate code for storing {@link org.apache.commons.math3.optim.MaxEval
+ * evaluations} and {@link org.apache.commons.math3.optim.MaxIter iterations}
+ * counters and a user-defined
+ * {@link org.apache.commons.math3.optim.ConvergenceChecker convergence checker}.
+ *
- * Algorithms that also require the
- * {@link org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian
- * Jacobian matrix of the model} are located in the
- * {@link org.apache.commons.math3.optim.nonlinear.vector.jacobian} package.
- *
- * The {@link org.apache.commons.math3.optim.nonlinear.vector.jacobian.AbstractLeastSquaresOptimizer
- * non-linear least-squares optimizers} are a specialization of the the latter,
- * that minimize the distance (called cost or χ2)
- * between model and observations.
- *
- * For cases where the Jacobian cannot be provided, a utility class will
- * {@link org.apache.commons.math3.optim.nonlinear.scalar.LeastSquaresConverter
- * convert} a (vector) model into a (scalar) objective function.
- *
- * This package provides common functionality for the optimization algorithms.
- * Abstract classes ({@link org.apache.commons.math3.optim.BaseOptimizer} and
- * {@link org.apache.commons.math3.optim.BaseMultivariateOptimizer}) contain
- * boiler-plate code for storing {@link org.apache.commons.math3.optim.MaxEval
- * evaluations} and {@link org.apache.commons.math3.optim.MaxIter iterations}
- * counters and a user-defined
- * {@link org.apache.commons.math3.optim.ConvergenceChecker convergence checker}.
- *
- * For each of the optimizer types, there is a special implementation that
- * wraps an optimizer instance and provides a "multi-start" feature: it calls
- * the underlying optimizer several times with different starting points and
- * returns the best optimum found, or all optima if so desired.
- * This could be useful to avoid being trapped in a local extremum.
+ * For each of the optimizer types, there is a special implementation that
+ * wraps an optimizer instance and provides a "multi-start" feature: it calls
+ * the underlying optimizer several times with different starting points and
+ * returns the best optimum found, or all optima if so desired.
+ * This could be useful to avoid being trapped in a local extremum.
+ *
+ *
+ *
+ *
* The scalar objective function value is computed as:
*
* Weights can be used for example to combine residuals with different standard
* deviations. As an example, consider a residuals array in which even elements
@@ -97,11 +96,12 @@ public class LeastSquaresConverter implements MultivariateFunction {
* In this case, the weights array should be initialized with value
* 1.0/(0.012) in the even elements and 1.0/(15.02) in the
* odd elements (i.e. reciprocals of variances).
+ *
* The array computed by the objective function, the observations array and the
* weights array must have consistent sizes or a {@link DimensionMismatchException}
* will be triggered while computing the scalar objective.
- *
+ *
* The scalar objective function value is computed as:
*
* The array computed by the objective function, the observations array and the
* the scaling matrix must have consistent sizes or a {@link DimensionMismatchException}
* will be triggered while computing the scalar objective.
- *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
* Harmonic fitting is a very simple case of curve fitting. The
* estimated coefficients are the amplitude a, the pulsation ω and
* the phase φ:
+ *
+ *
+ *
* avoiding intermediate overflow or underflow.
*
*
diff --git a/src/main/java/org/apache/commons/math3/complex/Complex.java b/src/main/java/org/apache/commons/math3/complex/Complex.java
index 75d9ccd29..52f3047b2 100644
--- a/src/main/java/org/apache/commons/math3/complex/Complex.java
+++ b/src/main/java/org/apache/commons/math3/complex/Complex.java
@@ -32,7 +32,7 @@ import org.apache.commons.math3.util.Precision;
/**
* Representation of a Complex number, i.e. a number which has both a
* real and imaginary part.
- *
* The redistribution policy for MINPACK is available here, for convenience, it
- * is reproduced below.
+ * is reproduced below.
* Implementations of arithmetic operations handle {@code NaN} and
* infinite values according to the rules for {@link java.lang.Double}, i.e.
* {@link #equals} is an equivalence relation for all instances that have
@@ -50,7 +50,7 @@ import org.apache.commons.math3.util.Precision;
* equals for primitive double} in {@link org.apache.commons.math3.util.Precision}
* conforms with IEEE-754 while this class conforms with the standard behavior
* for Java object types.
- *
* Implements Serializable since 2.0
*
* @version $Id$
@@ -144,7 +144,7 @@ public class Complex implements FieldElement
* If either {@code this} or {@code addend} has a {@code NaN} value in
* either part, {@link #NaN} is returned; otherwise {@code Infinite}
* and {@code NaN} values are returned in the parts of the result
@@ -183,10 +183,10 @@ public class Complex implements FieldElement
* {@link #NaN} is returned if either the real or imaginary
* part of this Complex number equals {@code Double.NaN}.
- *
* If the imaginary part is infinite, and the real part is not
* {@code NaN}, the returned value has infinite imaginary part
* of the opposite sign, e.g. the conjugate of
@@ -217,7 +217,7 @@ public class Complex implements FieldElement
* {@code Infinite} and {@code NaN} values are handled according to the
* following rules, applied in the order presented:
*
@@ -508,12 +508,12 @@ public class Complex implements FieldElement
* Returns {@link #INF} if neither {@code this} nor {@code factor} has one
* or more {@code NaN} parts and if either {@code this} or {@code factor}
* has one or more infinite parts (same result is returned regardless of
* the sign of the components).
- *
* Returns finite values in components of the result per the definitional
* formula in all remaining cases.
*
@@ -724,10 +724,10 @@ public class Complex implements FieldElement
* Returns {@link Complex#NaN} if either real or imaginary part of the
* input argument is {@code NaN}.
- *
* Infinite values in real or imaginary parts of the input may result in
* infinite or NaN values returned in parts of the result.
*
diff --git a/src/main/java/org/apache/commons/math3/geometry/enclosing/WelzlEncloser.java b/src/main/java/org/apache/commons/math3/geometry/enclosing/WelzlEncloser.java
index 830bf4a28..12a645f43 100644
--- a/src/main/java/org/apache/commons/math3/geometry/enclosing/WelzlEncloser.java
+++ b/src/main/java/org/apache/commons/math3/geometry/enclosing/WelzlEncloser.java
@@ -32,10 +32,10 @@ import org.apache.commons.math3.geometry.Space;
* href="http://www.inf.ethz.ch/personal/gaertner/texts/own_work/esa99_final.pdf">Fast and
* Robust Smallest Enclosing Balls, by Bernd Gärtner and further modified in
* paper
+ * href=http://www.idt.mdh.se/kurser/ct3340/ht12/MINICONFERENCE/FinalPapers/ircse12_submission_30.pdf">
* Efficient Computation of Smallest Enclosing Balls in Three Dimensions by Linus Källberg
* to avoid performing local copies of data have been included.
- *
+ *
Space type.
* @param r1(r) = r2
+ *
+ * r1(r) = r2
+ *
* r1(r) = r2
+ *
+ * r1(r) = r2
+ *
* Type of the embedding space.
* @param
+ *
*
*
* // compute region, plus an enclosing spherical cap
* SphericalPolygonsSet complexShape = ...;
- * EnclosingBall<Sphere2D, S2Point> cap = complexShape.getEnclosingCap();
+ * EnclosingBall
* This class wraps an optimizer in order to use it several times in
* turn with different starting points (trying to avoid being trapped
* in a local extremum when looking for a global one).
@@ -102,7 +102,7 @@ public abstract class BaseMultiStartMultivariateOptimizer
* The returned array as one element for each start as specified
* in the constructor. It is ordered with the results from the
* runs that did converge first, sorted from best to worst
@@ -113,7 +113,7 @@ public abstract class BaseMultiStartMultivariateOptimizer
* The behaviour is undefined if this method is called before
* {@code optimize}; it will likely throw {@code NullPointerException}.
*
diff --git a/src/main/java/org/apache/commons/math3/optim/ConvergenceChecker.java b/src/main/java/org/apache/commons/math3/optim/ConvergenceChecker.java
index 18ca560cf..f0bfab708 100644
--- a/src/main/java/org/apache/commons/math3/optim/ConvergenceChecker.java
+++ b/src/main/java/org/apache/commons/math3/optim/ConvergenceChecker.java
@@ -20,11 +20,11 @@ package org.apache.commons.math3.optim;
/**
* This interface specifies how to check if an optimization algorithm has
* converged.
- *
* Deciding if convergence has been reached is a problem-dependent issue. The
* user should provide a class implementing this interface to allow the
* optimization algorithm to stop its search according to the problem at hand.
- *
* For convenience, three implementations that fit simple needs are already
* provided: {@link SimpleValueChecker}, {@link SimpleVectorValueChecker} and
* {@link SimplePointChecker}. The first two consider that convergence is
diff --git a/src/main/java/org/apache/commons/math3/optim/InitialGuess.java b/src/main/java/org/apache/commons/math3/optim/InitialGuess.java
index 8aa4612b0..32df68df1 100644
--- a/src/main/java/org/apache/commons/math3/optim/InitialGuess.java
+++ b/src/main/java/org/apache/commons/math3/optim/InitialGuess.java
@@ -19,7 +19,7 @@ package org.apache.commons.math3.optim;
/**
* Starting point (first guess) of the optimization procedure.
- *
* Immutable class.
*
* @version $Id$
diff --git a/src/main/java/org/apache/commons/math3/optim/SimpleBounds.java b/src/main/java/org/apache/commons/math3/optim/SimpleBounds.java
index 4d26a9e82..6f5dcad1d 100644
--- a/src/main/java/org/apache/commons/math3/optim/SimpleBounds.java
+++ b/src/main/java/org/apache/commons/math3/optim/SimpleBounds.java
@@ -22,7 +22,7 @@ import java.util.Arrays;
* Simple optimization constraints: lower and upper bounds.
* The valid range of the parameters is an interval that can be infinite
* (in one or both directions).
- *
* Immutable class.
*
* @version $Id$
diff --git a/src/main/java/org/apache/commons/math3/optim/SimpleValueChecker.java b/src/main/java/org/apache/commons/math3/optim/SimpleValueChecker.java
index dc85c5139..094e38018 100644
--- a/src/main/java/org/apache/commons/math3/optim/SimpleValueChecker.java
+++ b/src/main/java/org/apache/commons/math3/optim/SimpleValueChecker.java
@@ -28,7 +28,7 @@ import org.apache.commons.math3.exception.NotStrictlyPositiveException;
* difference between the objective function values is smaller than a
* threshold or if either the absolute difference between the objective
* function values is smaller than another threshold.
- *
* The {@link #converged(int,PointValuePair,PointValuePair) converged}
* method will also return {@code true} if the number of iterations has been set
* (see {@link #SimpleValueChecker(double,double,int) this constructor}).
diff --git a/src/main/java/org/apache/commons/math3/optim/SimpleVectorValueChecker.java b/src/main/java/org/apache/commons/math3/optim/SimpleVectorValueChecker.java
index dd7ae6806..737911353 100644
--- a/src/main/java/org/apache/commons/math3/optim/SimpleVectorValueChecker.java
+++ b/src/main/java/org/apache/commons/math3/optim/SimpleVectorValueChecker.java
@@ -28,7 +28,7 @@ import org.apache.commons.math3.exception.NotStrictlyPositiveException;
* difference between the objective function values is smaller than a
* threshold or if either the absolute difference between the objective
* function values is smaller than another threshold for all vectors elements.
- *
* The {@link #converged(int,PointVectorValuePair,PointVectorValuePair) converged}
* method will also return {@code true} if the number of iterations has been set
* (see {@link #SimpleVectorValueChecker(double,double,int) this constructor}).
diff --git a/src/main/java/org/apache/commons/math3/optim/package-info.java b/src/main/java/org/apache/commons/math3/optim/package-info.java
index e52502f3e..b6c9fd7fa 100644
--- a/src/main/java/org/apache/commons/math3/optim/package-info.java
+++ b/src/main/java/org/apache/commons/math3/optim/package-info.java
@@ -17,54 +17,61 @@
/**
*
+ * For some scalar objective functions the gradient can be computed (analytically
+ * or numerically). Algorithms that use this knowledge are defined in the
+ * {@link org.apache.commons.math3.optim.nonlinear.scalar.gradient} package.
+ * The algorithms that do not need this additional information are located in
+ * the {@link org.apache.commons.math3.optim.nonlinear.scalar.noderiv} package.
+ *
+ * Algorithms that also require the
+ * {@link org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian
+ * Jacobian matrix of the model} are located in the
+ * {@link org.apache.commons.math3.optim.nonlinear.vector.jacobian} package.
+ *
+ * The {@link org.apache.commons.math3.optim.nonlinear.vector.jacobian.AbstractLeastSquaresOptimizer
+ * non-linear least-squares optimizers} are a specialization of the the latter,
+ * that minimize the distance (called cost or χ2)
+ * between model and observations.
+ *
+ * For cases where the Jacobian cannot be provided, a utility class will
+ * {@link org.apache.commons.math3.optim.nonlinear.scalar.LeastSquaresConverter
+ * convert} a (vector) model into a (scalar) objective function.
+ *
* The returned array as one element for each start as specified
* in the constructor. It is ordered with the results from the
* runs that did converge first, sorted from best to worst
diff --git a/src/main/java/org/apache/commons/math3/optimization/BaseMultivariateVectorMultiStartOptimizer.java b/src/main/java/org/apache/commons/math3/optimization/BaseMultivariateVectorMultiStartOptimizer.java
index efca7c461..7b9b11584 100644
--- a/src/main/java/org/apache/commons/math3/optimization/BaseMultivariateVectorMultiStartOptimizer.java
+++ b/src/main/java/org/apache/commons/math3/optimization/BaseMultivariateVectorMultiStartOptimizer.java
@@ -94,7 +94,7 @@ public class BaseMultivariateVectorMultiStartOptimizer
* The returned array as one element for each start as specified
* in the constructor. It is ordered with the results from the
* runs that did converge first, sorted from best to worst
diff --git a/src/main/java/org/apache/commons/math3/optimization/ConvergenceChecker.java b/src/main/java/org/apache/commons/math3/optimization/ConvergenceChecker.java
index 4bbf9186d..33b09ecb8 100644
--- a/src/main/java/org/apache/commons/math3/optimization/ConvergenceChecker.java
+++ b/src/main/java/org/apache/commons/math3/optimization/ConvergenceChecker.java
@@ -20,11 +20,11 @@ package org.apache.commons.math3.optimization;
/**
* This interface specifies how to check if an optimization algorithm has
* converged.
- *
* Deciding if convergence has been reached is a problem-dependent issue. The
* user should provide a class implementing this interface to allow the
* optimization algorithm to stop its search according to the problem at hand.
- *
* For convenience, three implementations that fit simple needs are already
* provided: {@link SimpleValueChecker}, {@link SimpleVectorValueChecker} and
* {@link SimplePointChecker}. The first two consider that convergence is
diff --git a/src/main/java/org/apache/commons/math3/optimization/InitialGuess.java b/src/main/java/org/apache/commons/math3/optimization/InitialGuess.java
index 510e4f2ff..2eb3a0270 100644
--- a/src/main/java/org/apache/commons/math3/optimization/InitialGuess.java
+++ b/src/main/java/org/apache/commons/math3/optimization/InitialGuess.java
@@ -19,7 +19,7 @@ package org.apache.commons.math3.optimization;
/**
* Starting point (first guess) of the optimization procedure.
- *
* Immutable class.
*
* @version $Id$
diff --git a/src/main/java/org/apache/commons/math3/optimization/LeastSquaresConverter.java b/src/main/java/org/apache/commons/math3/optimization/LeastSquaresConverter.java
index e215790d3..cb19f6c9e 100644
--- a/src/main/java/org/apache/commons/math3/optimization/LeastSquaresConverter.java
+++ b/src/main/java/org/apache/commons/math3/optimization/LeastSquaresConverter.java
@@ -85,10 +85,9 @@ public class LeastSquaresConverter implements MultivariateFunction {
*
- *
+ *
* objective = ∑weighti(observationi-objectivei)2
- *
*
- *
+ *
* objective = yTy with y = scale×(observation-objective)
- *
*
* Immutable class.
*
* @version $Id$
diff --git a/src/main/java/org/apache/commons/math3/optimization/SimplePointChecker.java b/src/main/java/org/apache/commons/math3/optimization/SimplePointChecker.java
index 0ae0e98cd..6b3af7075 100644
--- a/src/main/java/org/apache/commons/math3/optimization/SimplePointChecker.java
+++ b/src/main/java/org/apache/commons/math3/optimization/SimplePointChecker.java
@@ -29,7 +29,7 @@ import org.apache.commons.math3.exception.NotStrictlyPositiveException;
* difference between each point coordinate are smaller than a threshold
* or if either the absolute difference between the point coordinates are
* smaller than another threshold.
- *
* The {@link #converged(int,Pair,Pair) converged} method will also return
* {@code true} if the number of iterations has been set (see
* {@link #SimplePointChecker(double,double,int) this constructor}).
diff --git a/src/main/java/org/apache/commons/math3/optimization/SimpleValueChecker.java b/src/main/java/org/apache/commons/math3/optimization/SimpleValueChecker.java
index 0c2cf76db..ecef7a756 100644
--- a/src/main/java/org/apache/commons/math3/optimization/SimpleValueChecker.java
+++ b/src/main/java/org/apache/commons/math3/optimization/SimpleValueChecker.java
@@ -28,7 +28,7 @@ import org.apache.commons.math3.exception.NotStrictlyPositiveException;
* difference between the objective function values is smaller than a
* threshold or if either the absolute difference between the objective
* function values is smaller than another threshold.
- *
* The {@link #converged(int,PointValuePair,PointValuePair) converged}
* method will also return {@code true} if the number of iterations has been set
* (see {@link #SimpleValueChecker(double,double,int) this constructor}).
diff --git a/src/main/java/org/apache/commons/math3/optimization/SimpleVectorValueChecker.java b/src/main/java/org/apache/commons/math3/optimization/SimpleVectorValueChecker.java
index cb0ef232f..6633c8472 100644
--- a/src/main/java/org/apache/commons/math3/optimization/SimpleVectorValueChecker.java
+++ b/src/main/java/org/apache/commons/math3/optimization/SimpleVectorValueChecker.java
@@ -28,7 +28,7 @@ import org.apache.commons.math3.exception.NotStrictlyPositiveException;
* difference between the objective function values is smaller than a
* threshold or if either the absolute difference between the objective
* function values is smaller than another threshold for all vectors elements.
- *
* The {@link #converged(int,PointVectorValuePair,PointVectorValuePair) converged}
* method will also return {@code true} if the number of iterations has been set
* (see {@link #SimpleVectorValueChecker(double,double,int) this constructor}).
diff --git a/src/main/java/org/apache/commons/math3/optimization/Target.java b/src/main/java/org/apache/commons/math3/optimization/Target.java
index 68cfacc4f..27a1bed46 100644
--- a/src/main/java/org/apache/commons/math3/optimization/Target.java
+++ b/src/main/java/org/apache/commons/math3/optimization/Target.java
@@ -21,7 +21,7 @@ package org.apache.commons.math3.optimization;
* Target of the optimization procedure.
* They are the values which the objective vector function must reproduce
* When the parameters of the model have been optimized.
- *
* Immutable class.
*
* @version $Id$
diff --git a/src/main/java/org/apache/commons/math3/optimization/Weight.java b/src/main/java/org/apache/commons/math3/optimization/Weight.java
index 1371d0ce2..28c161903 100644
--- a/src/main/java/org/apache/commons/math3/optimization/Weight.java
+++ b/src/main/java/org/apache/commons/math3/optimization/Weight.java
@@ -23,7 +23,7 @@ import org.apache.commons.math3.linear.NonSquareMatrixException;
/**
* Weight matrix of the residuals between model and observations.
- *
* Immutable class.
*
* @version $Id$
diff --git a/src/main/java/org/apache/commons/math3/optimization/fitting/CurveFitter.java b/src/main/java/org/apache/commons/math3/optimization/fitting/CurveFitter.java
index 92d9a5598..f497da982 100644
--- a/src/main/java/org/apache/commons/math3/optimization/fitting/CurveFitter.java
+++ b/src/main/java/org/apache/commons/math3/optimization/fitting/CurveFitter.java
@@ -30,7 +30,7 @@ import org.apache.commons.math3.optimization.MultivariateDifferentiableVectorOpt
import org.apache.commons.math3.optimization.PointVectorValuePair;
/** Fitter for parametric univariate real functions y = f(x).
- *
* When a univariate real function y = f(x) does depend on some
* unknown parameters p0, p1 ... pn-1,
* this class can be used to find these parameters. It does this
diff --git a/src/main/java/org/apache/commons/math3/optimization/fitting/HarmonicFitter.java b/src/main/java/org/apache/commons/math3/optimization/fitting/HarmonicFitter.java
index b37dd43eb..1d59d19bc 100644
--- a/src/main/java/org/apache/commons/math3/optimization/fitting/HarmonicFitter.java
+++ b/src/main/java/org/apache/commons/math3/optimization/fitting/HarmonicFitter.java
@@ -17,17 +17,17 @@
package org.apache.commons.math3.optimization.fitting;
-import org.apache.commons.math3.analysis.function.HarmonicOscillator;
-import org.apache.commons.math3.exception.MathIllegalStateException;
-import org.apache.commons.math3.exception.NumberIsTooSmallException;
-import org.apache.commons.math3.exception.ZeroException;
-import org.apache.commons.math3.exception.util.LocalizedFormats;
import org.apache.commons.math3.optimization.DifferentiableMultivariateVectorOptimizer;
+import org.apache.commons.math3.analysis.function.HarmonicOscillator;
+import org.apache.commons.math3.exception.ZeroException;
+import org.apache.commons.math3.exception.NumberIsTooSmallException;
+import org.apache.commons.math3.exception.MathIllegalStateException;
+import org.apache.commons.math3.exception.util.LocalizedFormats;
import org.apache.commons.math3.util.FastMath;
/**
* Class that implements a curve fitting specialized for sinusoids.
- * f (t) = a cos (ω t + φ)
. They are
diff --git a/src/main/java/org/apache/commons/math3/optimization/general/AbstractLeastSquaresOptimizer.java b/src/main/java/org/apache/commons/math3/optimization/general/AbstractLeastSquaresOptimizer.java
index dc9826042..fddf51a8c 100644
--- a/src/main/java/org/apache/commons/math3/optimization/general/AbstractLeastSquaresOptimizer.java
+++ b/src/main/java/org/apache/commons/math3/optimization/general/AbstractLeastSquaresOptimizer.java
@@ -25,19 +25,19 @@ import org.apache.commons.math3.exception.DimensionMismatchException;
import org.apache.commons.math3.exception.NumberIsTooSmallException;
import org.apache.commons.math3.exception.util.LocalizedFormats;
import org.apache.commons.math3.linear.ArrayRealVector;
-import org.apache.commons.math3.linear.DecompositionSolver;
+import org.apache.commons.math3.linear.RealMatrix;
import org.apache.commons.math3.linear.DiagonalMatrix;
-import org.apache.commons.math3.linear.EigenDecomposition;
+import org.apache.commons.math3.linear.DecompositionSolver;
import org.apache.commons.math3.linear.MatrixUtils;
import org.apache.commons.math3.linear.QRDecomposition;
-import org.apache.commons.math3.linear.RealMatrix;
-import org.apache.commons.math3.optimization.ConvergenceChecker;
-import org.apache.commons.math3.optimization.DifferentiableMultivariateVectorOptimizer;
-import org.apache.commons.math3.optimization.InitialGuess;
+import org.apache.commons.math3.linear.EigenDecomposition;
import org.apache.commons.math3.optimization.OptimizationData;
-import org.apache.commons.math3.optimization.PointVectorValuePair;
+import org.apache.commons.math3.optimization.InitialGuess;
import org.apache.commons.math3.optimization.Target;
import org.apache.commons.math3.optimization.Weight;
+import org.apache.commons.math3.optimization.ConvergenceChecker;
+import org.apache.commons.math3.optimization.DifferentiableMultivariateVectorOptimizer;
+import org.apache.commons.math3.optimization.PointVectorValuePair;
import org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateVectorOptimizer;
import org.apache.commons.math3.util.FastMath;
@@ -45,7 +45,7 @@ import org.apache.commons.math3.util.FastMath;
* Base class for implementing least squares optimizers.
* It handles the boilerplate methods associated to thresholds settings,
* Jacobian and error estimation.
- *
* This class constructs the Jacobian matrix of the function argument in method
* {@link BaseAbstractMultivariateVectorOptimizer#optimize(int,
* org.apache.commons.math3.analysis.MultivariateVectorFunction,OptimizationData[])
@@ -288,7 +288,7 @@ public abstract class AbstractLeastSquaresOptimizer
/**
* Get the covariance matrix of the optimized parameters.
- *
* Note that this operation involves the inversion of the
* JTJ
matrix, where {@code J} is the
* Jacobian matrix.
@@ -310,7 +310,7 @@ public abstract class AbstractLeastSquaresOptimizer
/**
* Get the covariance matrix of the optimized parameters.
- *
* Note that this operation involves the inversion of the
* JTJ
matrix, where {@code J} is the
* Jacobian matrix.
diff --git a/src/main/java/org/apache/commons/math3/optimization/general/LevenbergMarquardtOptimizer.java b/src/main/java/org/apache/commons/math3/optimization/general/LevenbergMarquardtOptimizer.java
index c99a82c5d..d12e26fa7 100644
--- a/src/main/java/org/apache/commons/math3/optimization/general/LevenbergMarquardtOptimizer.java
+++ b/src/main/java/org/apache/commons/math3/optimization/general/LevenbergMarquardtOptimizer.java
@@ -20,11 +20,11 @@ import java.util.Arrays;
import org.apache.commons.math3.exception.ConvergenceException;
import org.apache.commons.math3.exception.util.LocalizedFormats;
-import org.apache.commons.math3.linear.RealMatrix;
-import org.apache.commons.math3.optimization.ConvergenceChecker;
import org.apache.commons.math3.optimization.PointVectorValuePair;
-import org.apache.commons.math3.util.FastMath;
+import org.apache.commons.math3.optimization.ConvergenceChecker;
+import org.apache.commons.math3.linear.RealMatrix;
import org.apache.commons.math3.util.Precision;
+import org.apache.commons.math3.util.FastMath;
/**
@@ -52,9 +52,9 @@ import org.apache.commons.math3.util.Precision;
*
* Minpack Copyright Notice (1999) University of Chicago. * All rights reserved @@ -99,7 +99,7 @@ import org.apache.commons.math3.util.Precision; * (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, * EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE * POSSIBILITY OF SUCH LOSS OR DAMAGES. - * |
* This package provides common interfaces for the optimization algorithms @@ -53,6 +54,7 @@ * org.apache.commons.math3.analysis.differentiation.MultivariateDifferentiableVectorFunction * multivariate differentiable vectorial functions} * + *
* ** Despite there are only four types of supported optimizers, it is possible to optimize a diff --git a/src/main/java/org/apache/commons/math3/optimization/univariate/BrentOptimizer.java b/src/main/java/org/apache/commons/math3/optimization/univariate/BrentOptimizer.java index 6a358d070..20d0980e1 100644 --- a/src/main/java/org/apache/commons/math3/optimization/univariate/BrentOptimizer.java +++ b/src/main/java/org/apache/commons/math3/optimization/univariate/BrentOptimizer.java @@ -16,12 +16,12 @@ */ package org.apache.commons.math3.optimization.univariate; -import org.apache.commons.math3.exception.NotStrictlyPositiveException; +import org.apache.commons.math3.util.Precision; +import org.apache.commons.math3.util.FastMath; import org.apache.commons.math3.exception.NumberIsTooSmallException; +import org.apache.commons.math3.exception.NotStrictlyPositiveException; import org.apache.commons.math3.optimization.ConvergenceChecker; import org.apache.commons.math3.optimization.GoalType; -import org.apache.commons.math3.util.FastMath; -import org.apache.commons.math3.util.Precision; /** * For a function defined on some interval {@code (lo, hi)}, this class @@ -30,7 +30,7 @@ import org.apache.commons.math3.util.Precision; * It implements Richard Brent's algorithm (from his book "Algorithms for * Minimization without Derivatives", p. 79) for finding minima of real * univariate functions. - *
+ *
* This code is an adaptation, partly based on the Python code from SciPy
* (module "optimize.py" v0.5); the original algorithm is also modified
*
+ *
* The {@link #converged(int,UnivariatePointValuePair,UnivariatePointValuePair)
* converged} method will also return {@code true} if the number of iterations
* has been set (see {@link #SimpleUnivariateValueChecker(double,double,int)
diff --git a/src/main/java/org/apache/commons/math3/optimization/univariate/UnivariateMultiStartOptimizer.java b/src/main/java/org/apache/commons/math3/optimization/univariate/UnivariateMultiStartOptimizer.java
index 2231fe46d..5cbf47a14 100644
--- a/src/main/java/org/apache/commons/math3/optimization/univariate/UnivariateMultiStartOptimizer.java
+++ b/src/main/java/org/apache/commons/math3/optimization/univariate/UnivariateMultiStartOptimizer.java
@@ -25,14 +25,14 @@ import org.apache.commons.math3.exception.MathIllegalStateException;
import org.apache.commons.math3.exception.NotStrictlyPositiveException;
import org.apache.commons.math3.exception.NullArgumentException;
import org.apache.commons.math3.exception.util.LocalizedFormats;
-import org.apache.commons.math3.optimization.ConvergenceChecker;
-import org.apache.commons.math3.optimization.GoalType;
import org.apache.commons.math3.random.RandomGenerator;
+import org.apache.commons.math3.optimization.GoalType;
+import org.apache.commons.math3.optimization.ConvergenceChecker;
/**
* Special implementation of the {@link UnivariateOptimizer} interface
* adding multi-start features to an existing optimizer.
- *
+ *
* This class wraps a classical optimizer to use it several times in
* turn with different starting points in order to avoid being trapped
* into a local extremum when looking for a global one.
@@ -113,7 +113,7 @@ public class UnivariateMultiStartOptimizer
+ *
* The returned array as one element for each start as specified
* in the constructor. It is ordered with the results from the
* runs that did converge first, sorted from best to worst
diff --git a/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java b/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java
index cdc231936..28b265ca3 100644
--- a/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java
+++ b/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java
@@ -85,7 +85,7 @@ public final class ArithmeticUtils {
* {@code < Long.MAX_VALUE} is 66. If the computed value exceeds
* {@code Long.MAX_VALUE} an {@code ArithMeticException} is
* thrown.
- *
+ *
* Special cases:
*
+ *
* Special cases:
*
* The preconditions are {@code 0 <= k <= n } (otherwise * {@code NotPositiveException} is thrown) - * + *
* @param n the size of the set * @param k the number of non-empty subsets * @return {@code S(n,k)} @@ -425,7 +426,8 @@ public final class CombinatoricsUtils { * they are visited in lexicographic order with significance from right to * left. For example, combinationsIterator(4, 2) returns an Iterator that * will generate the following sequence of arrays on successive calls to - * {@code next()}: {@code [0, 1], [0, 2], [1, 2], [0, 3], [1, 3], [2, 3]} + * {@code next()}:* References: *
+ * * * @version $Id$ */ @@ -109,6 +111,7 @@ public abstract class ContinuedFraction { * * Note: the implementation uses the terms ai and bi as defined in * Continued Fraction @ MathWorld. + * * * @param x the evaluation point. * @param epsilon maximum error allowed. diff --git a/src/main/java/org/apache/commons/math3/util/FastMath.java b/src/main/java/org/apache/commons/math3/util/FastMath.java index 712a6cc21..c24e7d14a 100644 --- a/src/main/java/org/apache/commons/math3/util/FastMath.java +++ b/src/main/java/org/apache/commons/math3/util/FastMath.java @@ -27,11 +27,13 @@ import java.io.PrintStream; * {@code Math.cbrt(y)}), user can directly change the class and use the * methods as is (using {@code FastMath.sin(x)} or {@code FastMath.cbrt(y)} * in the previous example). + * ** FastMath speed is achieved by relying heavily on optimizing compilers * to native code present in many JVMs today and use of large tables. * The larger tables are lazily initialised on first use, so that the setup * time does not penalise methods that don't need them. + *
** Note that FastMath is * extensively used inside Apache Commons Math, so by calling some algorithms, @@ -40,6 +42,7 @@ import java.io.PrintStream; * Performance figures for a specific JVM and hardware can be evaluated by * running the FastMathTestPerformance tests in the test directory of the source * distribution. + *
** FastMath accuracy should be mostly independent of the JVM as it relies only * on IEEE-754 basic operations and on embedded tables. Almost all operations @@ -48,6 +51,7 @@ import java.io.PrintStream; * guarantee for every double numbers input (see William Kahan's Table * Maker's Dilemma). + *
** FastMath additionally implements the following methods not found in Math/StrictMath: *
* If arguments compare equal, then the second argument is returned. *
@@ -3289,7 +3293,7 @@ public class FastMath { *
* If arguments compare equal, then the second argument is returned. *
@@ -3333,7 +3337,7 @@ public class FastMath {
/** Get the largest whole number smaller than x.
* @param x number from which floor is requested
- * @return a double number f such that f is an integer f ≤ x < f + 1.0
+ * @return a double number f such that f is an integer f <= x < f + 1.0
*/
public static double floor(double x) {
long y;
@@ -3360,7 +3364,7 @@ public class FastMath {
/** Get the smallest whole number larger than x.
* @param x number from which ceil is requested
- * @return a double number c such that c is an integer c - 1.0 < x ≤ c
+ * @return a double number c such that c is an integer c - 1.0 < x <= c
*/
public static double ceil(double x) {
double y;
@@ -3385,7 +3389,7 @@ public class FastMath {
/** Get the whole number that is the nearest to x, or the even one if x is exactly half way between two integers.
* @param x number from which nearest whole number is requested
- * @return a double number r such that r is an integer r - 0.5 ≤ x ≤ r + 0.5
+ * @return a double number r such that r is an integer r - 0.5 <= x <= r + 0.5
*/
public static double rint(double x) {
double y = floor(x);
@@ -3560,7 +3564,7 @@ public class FastMath {
/**
* Returns the hypotenuse of a triangle with sides {@code x} and {@code y}
- * - sqrt(x2 +y2)
+ * - sqrt(x2 +y2)
* avoiding intermediate overflow or underflow.
*
*
- * The array is modified in place (no copy is created). + *
Multiply each element of an array by a value.
+ * + *The array is modified in place (no copy is created).
* * @param arr Array to scale * @param val Scalar @@ -490,7 +490,7 @@ public class MathArrays { } /** - * Check that all entries of the input array are ≥ 0. + * Check that all entries of the input array are >= 0. * * @param in Array to be tested * @throws NotPositiveException if any array entries are less than 0. @@ -506,7 +506,7 @@ public class MathArrays { } /** - * Check all entries of the input array are ≥ 0. + * Check all entries of the input array are >= 0. * * @param in Array to be tested * @throws NotPositiveException if any array entries are less than 0. @@ -526,12 +526,12 @@ public class MathArrays { /** * Returns the Cartesian norm (2-norm), handling both overflow and underflow. * Translation of the minpack enorm subroutine. - *+ * * The redistribution policy for MINPACK is available * here, for - * convenience, it is reproduced below. - *
- *
* Minpack Copyright Notice (1999) University of Chicago. * All rights reserved @@ -576,7 +576,7 @@ public class MathArrays { * (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, * EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE * POSSIBILITY OF SUCH LOSS OR DAMAGES. - * |
ai bi
to high accuracy.
* It does so by using specific multiplication and addition algorithms to
* preserve accuracy and reduce cancellation effects.
- *
+ *
* It is based on the 2005 paper
*
* Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump,
@@ -1277,7 +1277,7 @@ public class MathArrays {
* Normalizes an array to make it sum to a specified value.
* Returns the result of the transformation
*
- * x |-> x * normalizedSum / sum + * x |-> x * normalizedSum / sum ** applied to each non-NaN element x of the input array, where sum is the * sum of the non-NaN entries in the input array. @@ -1458,7 +1458,7 @@ public class MathArrays { /** * Shuffle the entries of the given array, using the - * + * * Fisher–Yates algorithm. * The {@code start} and {@code pos} parameters select which portion * of the array is randomized and which is left untouched. @@ -1557,8 +1557,9 @@ public class MathArrays { * positive length *
MathIllegalArgumentException
if the array is null or
* or the indices are invalidfalse
if the array is non-null, but length
is 0.false
length
is 0.
+ *
*
* @param values the input array
* @param begin index of the first array element to include
@@ -1581,9 +1582,9 @@ public class MathArrays {
* non-negative length
* IllegalArgumentException
if the array is null or
* or the indices are invalidfalse
if the array is non-null, but
- * length
is 0 unless allowEmpty
is true
false
length
is 0 unless allowEmpty
is true
+ *
*
* @param values the input array
* @param begin index of the first array element to include
@@ -1638,9 +1639,9 @@ public class MathArrays {
* false
if the array is non-null, but
- * length
is 0.false
length
is 0.
+ *
*
* @param values the input array
* @param weights the weights array
@@ -1675,9 +1676,9 @@ public class MathArrays {
* false
if the array is non-null, but
- * length
is 0 unless allowEmpty
is true
.false
length
is 0 unless allowEmpty
is true
.
+ *
*
* @param values the input array.
* @param weights the weights array.
diff --git a/src/main/java/org/apache/commons/math3/util/MathUtils.java b/src/main/java/org/apache/commons/math3/util/MathUtils.java
index 8812d19b1..047cd3fe6 100644
--- a/src/main/java/org/apache/commons/math3/util/MathUtils.java
+++ b/src/main/java/org/apache/commons/math3/util/MathUtils.java
@@ -84,9 +84,9 @@ public final class MathUtils {
* Normalize an angle in a 2π wide interval around a center value.
* This method has three main uses:
*
- * Specifically, the value returned is
- * {@code a - |period| * floor((a - offset) / |period|) - offset}.
- *
- * If any of the parameters are {@code NaN} or infinite, the result is - * {@code NaN}. + *
Reduce {@code |a - offset|} to the primary interval + * {@code [0, |period|)}.
+ * + *Specifically, the value returned is
+ * {@code a - |period| * floor((a - offset) / |period|) - offset}.
If any of the parameters are {@code NaN} or infinite, the result is + * {@code NaN}.
* * @param a Value to reduce. * @param period Period. diff --git a/src/main/java/org/apache/commons/math3/util/Pair.java b/src/main/java/org/apache/commons/math3/util/Pair.java index 7d7aeb83c..ee24a8582 100644 --- a/src/main/java/org/apache/commons/math3/util/Pair.java +++ b/src/main/java/org/apache/commons/math3/util/Pair.java @@ -18,7 +18,7 @@ package org.apache.commons.math3.util; /** * Generic pair. - *
+ *
* Although the instances of this class are immutable, it is impossible
* to ensure that the references passed to the constructor will not be
* modified by the caller.
diff --git a/src/main/java/org/apache/commons/math3/util/Precision.java b/src/main/java/org/apache/commons/math3/util/Precision.java
index 0b4db4a05..d08947617 100644
--- a/src/main/java/org/apache/commons/math3/util/Precision.java
+++ b/src/main/java/org/apache/commons/math3/util/Precision.java
@@ -47,7 +47,7 @@ public class Precision {
/**
* Safe minimum, such that {@code 1 / SAFE_MIN} does not overflow.
- *
+ *
* In IEEE 754 arithmetic, this is also the smallest normalized
* number 2-1022.
*/
@@ -92,7 +92,7 @@ public class Precision {
* @param eps the amount of error to allow when checking for equality
* @return
+ *
* Throws IllegalArgumentException if the following conditions are
* not met:
*
+ *
* Throws IllegalArgumentException if the following conditions are
* not met:
*
+ * Create a ResizableArray with the specified properties.
** Throws IllegalArgumentException if the following conditions are * not met: *
initialCapacity > 0
expansionFactor > 1
contractionFactor ≥ expansionFactor
initialCapacity > 0
expansionFactor > 1
contractionFactor >= expansionFactor
expansionMode in {MULTIPLICATIVE_MODE, ADDITIVE_MODE}
*
+ *
* Throws MathIllegalArgumentException if the following conditions are
* not met:
*
- * Original may not be null; otherwise a {@link NullArgumentException} is thrown. + * fresh copy of the original. Needs to acquire synchronization lock + * on original. Original may not be null; otherwise a {@link NullArgumentException} + * is thrown. * * @param original array to copy * @exception NullArgumentException if original is null @@ -461,10 +465,12 @@ public class ResizableDoubleArray implements DoubleArray, Serializable { * Adds an element to the end of the array and removes the first * element in the array. Returns the discarded first element. * The effect is similar to a push operation in a FIFO queue. + *
** Example: If the array contains the elements 1, 2, 3, 4 (in that order) * and addElementRolling(5) is invoked, the result is an array containing * the entries 2, 3, 4, 5 and the value returned is 1. + *
* * @param value Value to be added to the array. * @return the value which has been discarded or "pushed" out of the array @@ -517,7 +523,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable { /** * Checks the expansion factor and the contraction criterion and throws an * IllegalArgumentException if the contractionCriteria is less than the - * expansionCriteria. + * expansionCriteria * * @param expansion factor to be checked * @param contraction criteria to be checked @@ -580,7 +586,8 @@ public class ResizableDoubleArray implements DoubleArray, Serializable { /** * Contracts the storage array to the (size of the element set) + 1 - to - * avoid a zero length array. This function also resets the startIndex to zero. + * avoid a zero length array. This function also resets the startIndex to + * zero. */ public synchronized void contract() { final double[] tempArray = new double[numElements + 1]; @@ -871,15 +878,15 @@ public class ResizableDoubleArray implements DoubleArray, Serializable { * Provides direct access to the internal storage array. * Please note that this method returns a reference to this object's * storage array, not a copy. - *
+ *
* To correctly address elements of the array, the "start index" is
* required (available via the {@link #getStartIndex() getStartIndex}
* method.
- *
+ *
* This method should only be used to avoid copying the internal array.
* The returned value must be used for reading only; other
* uses could lead to this object becoming inconsistent.
- *
+ *
* The {@link #getElements} method has no such limitation since it
* returns a copy of this array's addressable elements.
*
@@ -969,11 +976,11 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
* Sets the expansionFactor. Throws IllegalArgumentException if the
* the following conditions are not met:
*
expansionFactor > 1
contractionFactor ≥ expansionFactor
expansionFactor > 1
contractionFactor >= expansionFactor
- * Obtains synchronization locks on both source and dest - * (in that order) before performing the copy. - *
- * Neither source nor dest may be null; otherwise a {@link NullArgumentException} - * is thrown. + *
Copies source to dest, copying the underlying data, so dest is + * a new, independent copy of source. Does not contract before + * the copy.
+ * + *Obtains synchronization locks on both source and dest + * (in that order) before performing the copy.
+ * + *Neither source nor dest may be null; otherwise a {@link NullArgumentException} + * is thrown
* * @param source ResizableDoubleArray to copy * @param dest ResizableArray to replace with a copy of the source array @@ -1130,7 +1138,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable { } /** - * Returns a copy of the ResizableDoubleArray. Does not contract before + * Returns a copy of the ResizableDoubleArray. Does not contract before * the copy, so the returned object is an exact copy of this. * * @return a new ResizableDoubleArray with the same data and configuration