From 87cbe1675e68a769b95b93bb3c84c26f86a9044b Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Mon, 28 Jan 2008 06:10:03 +0000 Subject: [PATCH] Javadoc only. Added missing

's git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@615734 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/math/MathException.java | 4 +- .../math/analysis/BisectionSolver.java | 2 +- .../commons/math/analysis/BrentSolver.java | 4 +- .../DividedDifferenceInterpolator.java | 9 +- .../commons/math/analysis/LaguerreSolver.java | 6 +- .../commons/math/analysis/MullerSolver.java | 16 +-- .../math/analysis/NevilleInterpolator.java | 2 +- .../commons/math/analysis/NewtonSolver.java | 2 +- .../math/analysis/PolynomialFunction.java | 9 +- .../PolynomialFunctionLagrangeForm.java | 16 +-- .../PolynomialFunctionNewtonForm.java | 12 +- .../analysis/PolynomialSplineFunction.java | 18 +-- .../commons/math/analysis/RiddersSolver.java | 6 +- .../math/analysis/RombergIntegrator.java | 2 +- .../commons/math/analysis/SecantSolver.java | 4 +- .../math/analysis/SimpsonIntegrator.java | 2 +- .../math/analysis/SplineInterpolator.java | 6 +- .../math/analysis/TrapezoidIntegrator.java | 4 +- .../analysis/UnivariateRealIntegrator.java | 18 +-- .../math/analysis/UnivariateRealSolver.java | 24 ++-- .../analysis/UnivariateRealSolverFactory.java | 4 +- .../UnivariateRealSolverFactoryImpl.java | 2 +- .../analysis/UnivariateRealSolverUtils.java | 6 +- .../apache/commons/math/complex/Complex.java | 106 +++++++++--------- .../commons/math/complex/ComplexUtils.java | 6 +- .../math/random/AbstractRandomGenerator.java | 22 ++-- .../math/random/EmpiricalDistribution.java | 4 +- .../NotPositiveDefiniteMatrixException.java | 7 +- .../commons/math/random/RandomData.java | 55 ++++----- .../commons/math/random/RandomDataImpl.java | 34 +++--- .../math/random/RandomVectorGenerator.java | 5 +- .../math/random/UniformRandomGenerator.java | 2 + .../commons/math/random/ValueServer.java | 16 +-- 33 files changed, 226 insertions(+), 209 deletions(-) diff --git a/src/java/org/apache/commons/math/MathException.java b/src/java/org/apache/commons/math/MathException.java index c45373136..7f82eb27f 100644 --- a/src/java/org/apache/commons/math/MathException.java +++ b/src/java/org/apache/commons/math/MathException.java @@ -27,9 +27,9 @@ import java.util.ResourceBundle; /** * Base class for commons-math checked exceptions. *

-* Supports nesting, emulating JDK 1.4 behavior if necessary. +* Supports nesting, emulating JDK 1.4 behavior if necessary.

*

-* Adapted from {@link org.apache.commons.collections.FunctorException}. +* Adapted from {@link org.apache.commons.collections.FunctorException}.

* * @version $Revision$ $Date$ */ diff --git a/src/java/org/apache/commons/math/analysis/BisectionSolver.java b/src/java/org/apache/commons/math/analysis/BisectionSolver.java index db768affd..3488b552f 100644 --- a/src/java/org/apache/commons/math/analysis/BisectionSolver.java +++ b/src/java/org/apache/commons/math/analysis/BisectionSolver.java @@ -23,7 +23,7 @@ import org.apache.commons.math.MaxIterationsExceededException; * Implements the * bisection algorithm for finding zeros of univariate real functions. *

- * The function should be continuous but not necessarily smooth. + * The function should be continuous but not necessarily smooth.

* * @version $Revision$ $Date$ */ diff --git a/src/java/org/apache/commons/math/analysis/BrentSolver.java b/src/java/org/apache/commons/math/analysis/BrentSolver.java index 62677ecda..c8e8cd456 100644 --- a/src/java/org/apache/commons/math/analysis/BrentSolver.java +++ b/src/java/org/apache/commons/math/analysis/BrentSolver.java @@ -24,7 +24,7 @@ import org.apache.commons.math.MaxIterationsExceededException; * Implements the * Brent algorithm for finding zeros of real univariate functions. *

- * The function should be continuous but not necessarily smooth. + * The function should be continuous but not necessarily smooth.

* * @version $Revision$ $Date$ */ @@ -111,7 +111,7 @@ public class BrentSolver extends UnivariateRealSolverImpl { *

* Requires that the values of the function at the endpoints have opposite * signs. An IllegalArgumentException is thrown if this is not - * the case. + * the case.

* * @param min the lower bound for the interval. * @param max the upper bound for the interval. diff --git a/src/java/org/apache/commons/math/analysis/DividedDifferenceInterpolator.java b/src/java/org/apache/commons/math/analysis/DividedDifferenceInterpolator.java index 9a90bb057..e28e2e188 100644 --- a/src/java/org/apache/commons/math/analysis/DividedDifferenceInterpolator.java +++ b/src/java/org/apache/commons/math/analysis/DividedDifferenceInterpolator.java @@ -28,7 +28,7 @@ import org.apache.commons.math.DuplicateSampleAbscissaException; * ISBN 038795452X, chapter 2. *

* The actual code of Neville's evalution is in PolynomialFunctionLagrangeForm, - * this class provides an easy-to-use interface to it. + * this class provides an easy-to-use interface to it.

* * @version $Revision$ $Date$ */ @@ -64,7 +64,7 @@ public class DividedDifferenceInterpolator implements UnivariateRealInterpolator * f[x0,x1,...,x[n-1]](x-x0)(x-x1)...(x-x[n-2]) * Therefore, a[k] = f[x0,x1,...,xk], c[k] = x[k]. *

- * Note x[], y[], a[] have the same length but c[]'s size is one less. + * Note x[], y[], a[] have the same length but c[]'s size is one less.

*/ c = new double[x.length-1]; for (int i = 0; i < c.length; i++) { @@ -83,8 +83,9 @@ public class DividedDifferenceInterpolator implements UnivariateRealInterpolator * The divided difference array is defined recursively by
      * f[x0] = f(x0)
      * f[x0,x1,...,xk] = (f(x1,...,xk) - f(x0,...,x[k-1])) / (xk - x0)
-     * 

- * The computational complexity is O(N^2). + *

+ *

+ * The computational complexity is O(N^2).

* * @param x the interpolating points array * @param y the interpolating values array diff --git a/src/java/org/apache/commons/math/analysis/LaguerreSolver.java b/src/java/org/apache/commons/math/analysis/LaguerreSolver.java index d1ace4c1d..30f2b8b39 100644 --- a/src/java/org/apache/commons/math/analysis/LaguerreSolver.java +++ b/src/java/org/apache/commons/math/analysis/LaguerreSolver.java @@ -28,7 +28,7 @@ import org.apache.commons.math.complex.Complex; * ISBN 048641454X, chapter 8. *

* Laguerre's method is global in the sense that it can start with any initial - * approximation and be able to solve all roots from that point. + * approximation and be able to solve all roots from that point.

* * @version $Revision$ $Date$ */ @@ -69,7 +69,7 @@ public class LaguerreSolver extends UnivariateRealSolverImpl { /** * Find a real root in the given interval with initial value. *

- * Requires bracketing condition. + * Requires bracketing condition.

* * @param min the lower bound for the interval * @param max the upper bound for the interval @@ -105,7 +105,7 @@ public class LaguerreSolver extends UnivariateRealSolverImpl { * Complex) may not be a real zero inside [min, max]. For example, * p(x) = x^3 + 1, min = -2, max = 2, initial = 0. We can either try * another initial value, or, as we did here, call solveAll() to obtain - * all roots and pick up the one that we're looking for. + * all roots and pick up the one that we're looking for.

* * @param min the lower bound for the interval * @param max the upper bound for the interval diff --git a/src/java/org/apache/commons/math/analysis/MullerSolver.java b/src/java/org/apache/commons/math/analysis/MullerSolver.java index 5d1e765e4..198ac0ce4 100644 --- a/src/java/org/apache/commons/math/analysis/MullerSolver.java +++ b/src/java/org/apache/commons/math/analysis/MullerSolver.java @@ -28,7 +28,7 @@ import org.apache.commons.math.util.MathUtils; *

* Muller's method applies to both real and complex functions, but here we * restrict ourselves to real functions. Methods solve() and solve2() find - * real zeros, using different ways to bypass complex arithmetics. + * real zeros, using different ways to bypass complex arithmetics.

* * @version $Revision$ $Date$ */ @@ -49,7 +49,7 @@ public class MullerSolver extends UnivariateRealSolverImpl { /** * Find a real root in the given interval with initial value. *

- * Requires bracketing condition. + * Requires bracketing condition.

* * @param min the lower bound for the interval * @param max the upper bound for the interval @@ -84,14 +84,14 @@ public class MullerSolver extends UnivariateRealSolverImpl { * Original Muller's method would have function evaluation at complex point. * Since our f(x) is real, we have to find ways to avoid that. Bracketing * condition is one way to go: by requiring bracketing in every iteration, - * the newly computed approximation is guaranteed to be real. + * the newly computed approximation is guaranteed to be real.

*

* Normally Muller's method converges quadratically in the vicinity of a * zero, however it may be very slow in regions far away from zeros. For * example, f(x) = exp(x) - 1, min = -50, max = 100. In such case we use - * bisection as a safety backup if it performs very poorly. + * bisection as a safety backup if it performs very poorly.

*

- * The formulas here use divided differences directly. + * The formulas here use divided differences directly.

* * @param min the lower bound for the interval * @param max the upper bound for the interval @@ -188,14 +188,14 @@ public class MullerSolver extends UnivariateRealSolverImpl { * Except for the initial [min, max], solve2() does not require bracketing * condition, e.g. f(x0), f(x1), f(x2) can have the same sign. If complex * number arises in the computation, we simply use its modulus as real - * approximation. + * approximation.

*

* Because the interval may not be bracketing, bisection alternative is * not applicable here. However in practice our treatment usually works * well, especially near real zeros where the imaginary part of complex - * approximation is often negligible. + * approximation is often negligible.

*

- * The formulas here do not use divided differences directly. + * The formulas here do not use divided differences directly.

* * @param min the lower bound for the interval * @param max the upper bound for the interval diff --git a/src/java/org/apache/commons/math/analysis/NevilleInterpolator.java b/src/java/org/apache/commons/math/analysis/NevilleInterpolator.java index 97b344bd9..b2b093115 100644 --- a/src/java/org/apache/commons/math/analysis/NevilleInterpolator.java +++ b/src/java/org/apache/commons/math/analysis/NevilleInterpolator.java @@ -26,7 +26,7 @@ import org.apache.commons.math.MathException; * chapter 2. *

* The actual code of Neville's evalution is in PolynomialFunctionLagrangeForm, - * this class provides an easy-to-use interface to it. + * this class provides an easy-to-use interface to it.

* * @version $Revision$ $Date$ */ diff --git a/src/java/org/apache/commons/math/analysis/NewtonSolver.java b/src/java/org/apache/commons/math/analysis/NewtonSolver.java index ea9f5a7fd..152605586 100644 --- a/src/java/org/apache/commons/math/analysis/NewtonSolver.java +++ b/src/java/org/apache/commons/math/analysis/NewtonSolver.java @@ -25,7 +25,7 @@ import org.apache.commons.math.MaxIterationsExceededException; * Implements * Newton's Method for finding zeros of real univariate functions. *

- * The function should be continuous but not necessarily smooth. + * The function should be continuous but not necessarily smooth.

* * @version $Revision$ $Date$ */ diff --git a/src/java/org/apache/commons/math/analysis/PolynomialFunction.java b/src/java/org/apache/commons/math/analysis/PolynomialFunction.java index 4fe36ad1f..da6fc8f7f 100644 --- a/src/java/org/apache/commons/math/analysis/PolynomialFunction.java +++ b/src/java/org/apache/commons/math/analysis/PolynomialFunction.java @@ -22,7 +22,7 @@ import java.io.Serializable; * Immutable representation of a real polynomial function with real coefficients. *

* Horner's Method - * is used to evaluate the function. + * is used to evaluate the function.

* * @version $Revision$ $Date$ */ @@ -45,7 +45,7 @@ public class PolynomialFunction implements DifferentiableUnivariateRealFunction, * is the length of the array minus 1. *

* The constructor makes a copy of the input array and assigns the copy to - * the coefficients property. + * the coefficients property.

* * @param c polynominal coefficients * @throws NullPointerException if c is null @@ -65,7 +65,8 @@ public class PolynomialFunction implements DifferentiableUnivariateRealFunction, *

* The value returned is
* coefficients[n] * x^n + ... + coefficients[1] * x + coefficients[0] - * + *

+ * * @param x the argument for which the function value should be computed * @return the value of the polynomial at the given point * @see UnivariateRealFunction#value(double) @@ -88,7 +89,7 @@ public class PolynomialFunction implements DifferentiableUnivariateRealFunction, * Returns a copy of the coefficients array. *

* Changes made to the returned copy will not affect the coefficients of - * the polynomial. + * the polynomial.

* * @return a fresh copy of the coefficients array */ diff --git a/src/java/org/apache/commons/math/analysis/PolynomialFunctionLagrangeForm.java b/src/java/org/apache/commons/math/analysis/PolynomialFunctionLagrangeForm.java index c152588bf..2cd82ac34 100644 --- a/src/java/org/apache/commons/math/analysis/PolynomialFunctionLagrangeForm.java +++ b/src/java/org/apache/commons/math/analysis/PolynomialFunctionLagrangeForm.java @@ -28,7 +28,7 @@ import org.apache.commons.math.FunctionEvaluationException; * Analysis, ISBN 038795452X, chapter 2. *

* The approximated function should be smooth enough for Lagrange polynomial - * to work well. Otherwise, consider using splines instead. + * to work well. Otherwise, consider using splines instead.

* * @version $Revision$ $Date$ */ @@ -59,7 +59,7 @@ public class PolynomialFunctionLagrangeForm implements UnivariateRealFunction, * Construct a Lagrange polynomial with the given abscissas and function * values. The order of interpolating points are not important. *

- * The constructor makes copy of the input arrays and assigns them. + * The constructor makes copy of the input arrays and assigns them.

* * @param x interpolating points * @param y function values at interpolating points @@ -104,7 +104,7 @@ public class PolynomialFunctionLagrangeForm implements UnivariateRealFunction, /** * Returns a copy of the interpolating points array. *

- * Changes made to the returned copy will not affect the polynomial. + * Changes made to the returned copy will not affect the polynomial.

* * @return a fresh copy of the interpolating points array */ @@ -117,7 +117,7 @@ public class PolynomialFunctionLagrangeForm implements UnivariateRealFunction, /** * Returns a copy of the interpolating values array. *

- * Changes made to the returned copy will not affect the polynomial. + * Changes made to the returned copy will not affect the polynomial.

* * @return a fresh copy of the interpolating values array */ @@ -130,7 +130,7 @@ public class PolynomialFunctionLagrangeForm implements UnivariateRealFunction, /** * Returns a copy of the coefficients array. *

- * Changes made to the returned copy will not affect the polynomial. + * Changes made to the returned copy will not affect the polynomial.

* * @return a fresh copy of the coefficients array */ @@ -149,7 +149,7 @@ public class PolynomialFunctionLagrangeForm implements UnivariateRealFunction, * Neville's Algorithm. It takes O(N^2) time. *

* This function is made public static so that users can call it directly - * without instantiating PolynomialFunctionLagrangeForm object. + * without instantiating PolynomialFunctionLagrangeForm object.

* * @param x the interpolating points array * @param y the interpolating values array @@ -216,7 +216,7 @@ public class PolynomialFunctionLagrangeForm implements UnivariateRealFunction, * interpolation data. It takes O(N^2) time. *

* Note this computation can be ill-conditioned. Use with caution - * and only when it is necessary. + * and only when it is necessary.

* * @throws ArithmeticException if any abscissas coincide */ @@ -274,7 +274,7 @@ public class PolynomialFunctionLagrangeForm implements UnivariateRealFunction, * Verifies that the interpolation arrays are valid. *

* The interpolating points must be distinct. However it is not - * verified here, it is checked in evaluate() and computeCoefficients(). + * verified here, it is checked in evaluate() and computeCoefficients().

* * @param x the interpolating points array * @param y the interpolating values array diff --git a/src/java/org/apache/commons/math/analysis/PolynomialFunctionNewtonForm.java b/src/java/org/apache/commons/math/analysis/PolynomialFunctionNewtonForm.java index a3cf20fdd..6ad3c3bfa 100644 --- a/src/java/org/apache/commons/math/analysis/PolynomialFunctionNewtonForm.java +++ b/src/java/org/apache/commons/math/analysis/PolynomialFunctionNewtonForm.java @@ -27,7 +27,7 @@ import org.apache.commons.math.FunctionEvaluationException; * The formula of polynomial in Newton form is * p(x) = a[0] + a[1](x-c[0]) + a[2](x-c[0])(x-c[1]) + ... + * a[n](x-c[0])(x-c[1])...(x-c[n-1]) - * Note that the length of a[] is one more than the length of c[] + * Note that the length of a[] is one more than the length of c[]

* * @version $Revision$ $Date$ */ @@ -61,7 +61,7 @@ public class PolynomialFunctionNewtonForm implements UnivariateRealFunction, * centers are important in that if c[] shuffle, then values of a[] would * completely change, not just a permutation of old a[]. *

- * The constructor makes copy of the input arrays and assigns them. + * The constructor makes copy of the input arrays and assigns them.

* * @param a the coefficients in Newton form formula * @param c the centers @@ -102,7 +102,7 @@ public class PolynomialFunctionNewtonForm implements UnivariateRealFunction, /** * Returns a copy of coefficients in Newton form formula. *

- * Changes made to the returned copy will not affect the polynomial. + * Changes made to the returned copy will not affect the polynomial.

* * @return a fresh copy of coefficients in Newton form formula */ @@ -115,7 +115,7 @@ public class PolynomialFunctionNewtonForm implements UnivariateRealFunction, /** * Returns a copy of the centers array. *

- * Changes made to the returned copy will not affect the polynomial. + * Changes made to the returned copy will not affect the polynomial.

* * @return a fresh copy of the centers array */ @@ -128,7 +128,7 @@ public class PolynomialFunctionNewtonForm implements UnivariateRealFunction, /** * Returns a copy of the coefficients array. *

- * Changes made to the returned copy will not affect the polynomial. + * Changes made to the returned copy will not affect the polynomial.

* * @return a fresh copy of the coefficients array */ @@ -194,7 +194,7 @@ public class PolynomialFunctionNewtonForm implements UnivariateRealFunction, * Verifies that the input arrays are valid. *

* The centers must be distinct for interpolation purposes, but not - * for general use. Thus it is not verified here. + * for general use. Thus it is not verified here.

* * @param a the coefficients in Newton form formula * @param c the centers diff --git a/src/java/org/apache/commons/math/analysis/PolynomialSplineFunction.java b/src/java/org/apache/commons/math/analysis/PolynomialSplineFunction.java index fd370b3ae..e53ef867f 100644 --- a/src/java/org/apache/commons/math/analysis/PolynomialSplineFunction.java +++ b/src/java/org/apache/commons/math/analysis/PolynomialSplineFunction.java @@ -31,14 +31,16 @@ import org.apache.commons.math.ArgumentOutsideDomainException; * have been computed to match the values of another function at the knot * points. The value consistency constraints are not currently enforced by * PolynomialSplineFunction itself, but are assumed to hold among - * the polynomials and knot points passed to the constructor. + * the polynomials and knot points passed to the constructor.

*

* N.B.: The polynomials in the polynomials property must be - * centered on the knot points to compute the spline function values. See below. + * centered on the knot points to compute the spline function values. + * See below.

*

* The domain of the polynomial spline function is * [smallest knot, largest knot]. Attempts to evaluate the * function at values outside of this range generate IllegalArgumentExceptions. + *

*

* The value of the polynomial spline function for an argument x * is computed as follows: @@ -49,7 +51,7 @@ import org.apache.commons.math.ArgumentOutsideDomainException; * is thrown. *

  • Let j be the index of the largest knot point that is less * than or equal to x. The value returned is
    - * polynomials[j](x - knot[j])
  • + * polynomials[j](x - knot[j])

    * * @version $Revision$ $Date$ */ @@ -83,7 +85,7 @@ public class PolynomialSplineFunction * and interpolating polynomials. *

    * The constructor copies both arrays and assigns the copies to the knots - * and polynomials properties, respectively. + * and polynomials properties, respectively.

    * * @param knots spline segment interval delimiters * @param polynomials polynomial functions that make up the spline @@ -118,10 +120,10 @@ public class PolynomialSplineFunction * Compute the value for the function. *

    * Throws FunctionEvaluationException if v is outside of the domain of the - * function. The domain is [smallest knot, largest knot]. + * function. The domain is [smallest knot, largest knot].

    *

    * See {@link PolynomialSplineFunction} for details on the algorithm for - * computing the value of the function. + * computing the value of the function.

    * * @param v the point for which the function value should be computed * @return the value @@ -181,7 +183,7 @@ public class PolynomialSplineFunction * Returns a copy of the interpolating polynomials array. *

    * Returns a fresh copy of the array. Changes made to the copy will - * not affect the polynomials property. + * not affect the polynomials property.

    * * @return the interpolating polynomials */ @@ -195,7 +197,7 @@ public class PolynomialSplineFunction * Returns an array copy of the knot points. *

    * Returns a fresh copy of the array. Changes made to the copy - * will not affect the knots property. + * will not affect the knots property.

    * * @return the knot points */ diff --git a/src/java/org/apache/commons/math/analysis/RiddersSolver.java b/src/java/org/apache/commons/math/analysis/RiddersSolver.java index 298597cfc..e9e6144d4 100644 --- a/src/java/org/apache/commons/math/analysis/RiddersSolver.java +++ b/src/java/org/apache/commons/math/analysis/RiddersSolver.java @@ -27,7 +27,7 @@ import org.apache.commons.math.util.MathUtils; * of a real continuous function , IEEE Transactions on Circuits and * Systems, 26 (1979), 979 - 980. *

    - * The function should be continuous but not necessarily smooth. + * The function should be continuous but not necessarily smooth.

    * * @version $Revision$ $Date$ */ @@ -48,7 +48,7 @@ public class RiddersSolver extends UnivariateRealSolverImpl { /** * Find a root in the given interval with initial value. *

    - * Requires bracketing condition. + * Requires bracketing condition.

    * * @param min the lower bound for the interval * @param max the upper bound for the interval @@ -79,7 +79,7 @@ public class RiddersSolver extends UnivariateRealSolverImpl { /** * Find a root in the given interval. *

    - * Requires bracketing condition. + * Requires bracketing condition.

    * * @param min the lower bound for the interval * @param max the upper bound for the interval diff --git a/src/java/org/apache/commons/math/analysis/RombergIntegrator.java b/src/java/org/apache/commons/math/analysis/RombergIntegrator.java index 863f7fd94..5095e8d63 100644 --- a/src/java/org/apache/commons/math/analysis/RombergIntegrator.java +++ b/src/java/org/apache/commons/math/analysis/RombergIntegrator.java @@ -27,7 +27,7 @@ import org.apache.commons.math.MaxIterationsExceededException; *

    * Romberg integration employs k successvie refinements of the trapezoid * rule to remove error terms less than order O(N^(-2k)). Simpson's rule - * is a special case of k = 2. + * is a special case of k = 2.

    * * @version $Revision$ $Date$ */ diff --git a/src/java/org/apache/commons/math/analysis/SecantSolver.java b/src/java/org/apache/commons/math/analysis/SecantSolver.java index 862408684..59de5f6dc 100644 --- a/src/java/org/apache/commons/math/analysis/SecantSolver.java +++ b/src/java/org/apache/commons/math/analysis/SecantSolver.java @@ -32,9 +32,9 @@ import org.apache.commons.math.MaxIterationsExceededException; * the unrestricted secant algorithm. However, this implementation should in * general outperform the * - * regula falsi method. + * regula falsi method.

    *

    - * The function is assumed to be continuous but not necessarily smooth. + * The function is assumed to be continuous but not necessarily smooth.

    * * @version $Revision$ $Date$ */ diff --git a/src/java/org/apache/commons/math/analysis/SimpsonIntegrator.java b/src/java/org/apache/commons/math/analysis/SimpsonIntegrator.java index f74dbf6a3..b5ed5f361 100644 --- a/src/java/org/apache/commons/math/analysis/SimpsonIntegrator.java +++ b/src/java/org/apache/commons/math/analysis/SimpsonIntegrator.java @@ -26,7 +26,7 @@ import org.apache.commons.math.MaxIterationsExceededException; * chapter 3. *

    * This implementation employs basic trapezoid rule as building blocks to - * calculate the Simpson's rule of alternating 2/3 and 4/3. + * calculate the Simpson's rule of alternating 2/3 and 4/3.

    * * @version $Revision$ $Date$ */ diff --git a/src/java/org/apache/commons/math/analysis/SplineInterpolator.java b/src/java/org/apache/commons/math/analysis/SplineInterpolator.java index f788ee8d8..c5aed9077 100644 --- a/src/java/org/apache/commons/math/analysis/SplineInterpolator.java +++ b/src/java/org/apache/commons/math/analysis/SplineInterpolator.java @@ -21,22 +21,24 @@ package org.apache.commons.math.analysis; *

    * The {@link #interpolate(double[], double[])} method returns a {@link PolynomialSplineFunction} * consisting of n cubic polynomials, defined over the subintervals determined by the x values, - * x[0] < x[i] ... < x[n]. The x values are referred to as "knot points." + * x[0] < x[i] ... < x[n]. The x values are referred to as "knot points."

    *

    * The value of the PolynomialSplineFunction at a point x that is greater than or equal to the smallest * knot point and strictly less than the largest knot point is computed by finding the subinterval to which * x belongs and computing the value of the corresponding polynomial at x - x[i] where * i is the index of the subinterval. See {@link PolynomialSplineFunction} for more details. + *

    *

    * The interpolating polynomials satisfy:

      *
    1. The value of the PolynomialSplineFunction at each of the input x values equals the * corresponding y value.
    2. *
    3. Adjacent polynomials are equal through two derivatives at the knot points (i.e., adjacent polynomials * "match up" at the knot points, as do their first and second derivatives).
    4. - *
    + *

    *

    * The cubic spline interpolation algorithm implemented is as described in R.L. Burden, J.D. Faires, * Numerical Analysis, 4th Ed., 1989, PWS-Kent, ISBN 0-53491-585-X, pp 126-131. + *

    * * @version $Revision$ $Date$ * diff --git a/src/java/org/apache/commons/math/analysis/TrapezoidIntegrator.java b/src/java/org/apache/commons/math/analysis/TrapezoidIntegrator.java index 2f32587a2..2dce7d2af 100644 --- a/src/java/org/apache/commons/math/analysis/TrapezoidIntegrator.java +++ b/src/java/org/apache/commons/math/analysis/TrapezoidIntegrator.java @@ -25,7 +25,7 @@ import org.apache.commons.math.MaxIterationsExceededException; * reference, see Introduction to Numerical Analysis, ISBN 038795452X, * chapter 3. *

    - * The function should be integrable. + * The function should be integrable.

    * * @version $Revision$ $Date$ */ @@ -53,7 +53,7 @@ public class TrapezoidIntegrator extends UnivariateRealIntegratorImpl { *

    * The interval is divided equally into 2^n sections rather than an * arbitrary m sections because this configuration can best utilize the - * alrealy computed values. + * alrealy computed values.

    * * @param min the lower bound for the interval * @param max the upper bound for the interval diff --git a/src/java/org/apache/commons/math/analysis/UnivariateRealIntegrator.java b/src/java/org/apache/commons/math/analysis/UnivariateRealIntegrator.java index 186cbd655..7941557c1 100644 --- a/src/java/org/apache/commons/math/analysis/UnivariateRealIntegrator.java +++ b/src/java/org/apache/commons/math/analysis/UnivariateRealIntegrator.java @@ -31,10 +31,10 @@ public interface UnivariateRealIntegrator { *

    * Usually a high iteration count indicates convergence problem. However, * the "reasonable value" varies widely for different cases. Users are - * advised to use the default value. + * advised to use the default value.

    *

    * A ConvergenceException will be thrown if this number - * is exceeded. + * is exceeded.

    * * @param count maximum number of iterations */ @@ -50,7 +50,7 @@ public interface UnivariateRealIntegrator { /** * Reset the upper limit for the number of iterations to the default. *

    - * The default value is supplied by the implementation. + * The default value is supplied by the implementation.

    * * @see #setMaximalIterationCount(int) */ @@ -61,10 +61,10 @@ public interface UnivariateRealIntegrator { *

    * Minimal iteration is needed to avoid false early convergence, e.g. * the sample points happen to be zeroes of the function. Users can - * use the default value or choose one that they see as appropriate. + * use the default value or choose one that they see as appropriate.

    *

    * A ConvergenceException will be thrown if this number - * is not met. + * is not met.

    * * @param count minimum number of iterations */ @@ -80,7 +80,7 @@ public interface UnivariateRealIntegrator { /** * Reset the lower limit for the number of iterations to the default. *

    - * The default value is supplied by the implementation. + * The default value is supplied by the implementation.

    * * @see #setMinimalIterationCount(int) */ @@ -89,7 +89,7 @@ public interface UnivariateRealIntegrator { /** * Set the relative accuracy. *

    - * This is used to stop iterations. + * This is used to stop iterations.

    * * @param accuracy the relative accuracy * @throws IllegalArgumentException if the accuracy can't be achieved @@ -107,7 +107,7 @@ public interface UnivariateRealIntegrator { /** * Reset the relative accuracy to the default. *

    - * The default value is provided by the implementation. + * The default value is provided by the implementation.

    * * @see #setRelativeAccuracy(double) */ @@ -145,7 +145,7 @@ public interface UnivariateRealIntegrator { * help track down performance problems: if the iteration count * is notoriously high, check whether the function is evaluated * properly, and whether another integrator is more amenable to the - * problem. + * problem.

    * * @return the last iteration count * @throws IllegalStateException if there is no result available, either diff --git a/src/java/org/apache/commons/math/analysis/UnivariateRealSolver.java b/src/java/org/apache/commons/math/analysis/UnivariateRealSolver.java index 07de7ad01..3bf6dc1a9 100644 --- a/src/java/org/apache/commons/math/analysis/UnivariateRealSolver.java +++ b/src/java/org/apache/commons/math/analysis/UnivariateRealSolver.java @@ -23,7 +23,7 @@ import org.apache.commons.math.FunctionEvaluationException; /** * Interface for (univariate real) rootfinding algorithms. *

    - * Implementations will search for only one zero in the given interval. + * Implementations will search for only one zero in the given interval.

    * * @version $Revision$ $Date$ */ @@ -34,10 +34,10 @@ public interface UnivariateRealSolver { *

    * Usually a high iteration count indicates convergence problems. However, * the "reasonable value" varies widely for different solvers. Users are - * advised to use the default value supplied by the solver. + * advised to use the default value supplied by the solver.

    *

    * A ConvergenceException will be thrown if this number - * is exceeded. + * is exceeded.

    * * @param count maximum number of iterations */ @@ -53,7 +53,7 @@ public interface UnivariateRealSolver { /** * Reset the upper limit for the number of iterations to the default. *

    - * The default value is supplied by the solver implementation. + * The default value is supplied by the solver implementation.

    * * @see #setMaximalIterationCount(int) */ @@ -65,10 +65,10 @@ public interface UnivariateRealSolver { * The default is usually choosen so that roots in the interval * -10..-0.1 and +0.1..+10 can be found with a reasonable accuracy. If the * expected absolute value of your roots is of much smaller magnitude, set - * this to a smaller value. + * this to a smaller value.

    *

    * Solvers are advised to do a plausibility check with the relative - * accuracy, but clients should not rely on this. + * accuracy, but clients should not rely on this.

    * * @param accuracy the accuracy. * @throws IllegalArgumentException if the accuracy can't be achieved by @@ -86,7 +86,7 @@ public interface UnivariateRealSolver { /** * Reset the absolute accuracy to the default. *

    - * The default value is provided by the solver implementation. + * The default value is provided by the solver implementation.

    */ void resetAbsoluteAccuracy(); @@ -94,11 +94,11 @@ public interface UnivariateRealSolver { * Set the relative accuracy. *

    * This is used to stop iterations if the absolute accuracy can't be - * achieved due to large values or short mantissa length. + * 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 1E-1000. + * like 1E-1000.

    * * @param accuracy the relative accuracy. * @throws IllegalArgumentException if the accuracy can't be achieved by @@ -122,10 +122,10 @@ public interface UnivariateRealSolver { * Set the function value accuracy. *

    * This is used to determine when an evaluated function value or some other - * value which is used as divisor is zero. + * value which is used as divisor is zero.

    *

    * This is a safety guard and it shouldn't be necessary to change this in - * general. + * general.

    * * @param accuracy the accuracy. * @throws IllegalArgumentException if the accuracy can't be achieved by @@ -196,7 +196,7 @@ public interface UnivariateRealSolver { * help track down performance problems: if the iteration count * is notoriously high, check whether the function is evaluated * properly, and whether another solver is more amenable to the - * problem. + * problem.

    * * @return the last iteration count. * @throws IllegalStateException if there is no result available, either diff --git a/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactory.java b/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactory.java index 5b547ab84..f80f4cd96 100644 --- a/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactory.java +++ b/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactory.java @@ -28,10 +28,10 @@ import org.apache.commons.discovery.tools.DiscoverClass; *
  • Secant method
  • * * Concrete factories extending this class also specify a default solver, instances of which - * are returned by newDefaultSolver(). + * are returned by newDefaultSolver().

    *

    * Common usage:

    - * SolverFactory factory = UnivariateRealSolverFactory.newInstance();
    + * SolverFactory factory = UnivariateRealSolverFactory.newInstance();

    * * // create a Brent solver to use with a UnivariateRealFunction f * BrentSolver solver = factory.newBrentSolver(f); diff --git a/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImpl.java b/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImpl.java index 7b044185a..29d701b2e 100644 --- a/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImpl.java +++ b/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImpl.java @@ -20,7 +20,7 @@ package org.apache.commons.math.analysis; * A concrete {@link UnivariateRealSolverFactory}. This is the default solver factory * used by commons-math. *

    - * The default solver returned by this factory is a {@link BrentSolver}. + * The default solver returned by this factory is a {@link BrentSolver}.

    * * @version $Revision$ $Date$ */ diff --git a/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java b/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java index c649c0194..8c11bd5df 100644 --- a/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java +++ b/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java @@ -99,7 +99,7 @@ public class UnivariateRealSolverUtils { * -- ConvergenceException *
  • Integer.MAX_VALUE iterations elapse * -- ConvergenceException
  • - * + *

    *

    * Note: this method can take * Integer.MAX_VALUE iterations to throw a @@ -107,7 +107,7 @@ public class UnivariateRealSolverUtils { * is a root between lowerBound and upperBound * near initial, it is better to use * {@link #bracket(UnivariateRealFunction, double, double, double, int)}, - * explicitly specifying the maximum number of iterations. + * explicitly specifying the maximum number of iterations.

    * * @param function the function * @param initial initial midpoint of interval being expanded to @@ -146,7 +146,7 @@ public class UnivariateRealSolverUtils { *
  • a = lower and b = upper * -- ConvergenceException
  • *
  • maximumIterations iterations elapse - * -- ConvergenceException
  • + * -- ConvergenceException

    * * @param function the function * @param initial initial midpoint of interval being expanded to diff --git a/src/java/org/apache/commons/math/complex/Complex.java b/src/java/org/apache/commons/math/complex/Complex.java index 0266f205a..bcfb6134b 100644 --- a/src/java/org/apache/commons/math/complex/Complex.java +++ b/src/java/org/apache/commons/math/complex/Complex.java @@ -28,11 +28,11 @@ import org.apache.commons.math.util.MathUtils; * infinite values according to the rules for {@link java.lang.Double} * arithmetic, applying definitional formulas and returning NaN or * infinite values in real or imaginary parts as these arise in computation. - * See individual method javadocs for details. + * See individual method javadocs for details.

    *

    * {@link #equals} identifies all values with NaN in either real * or imaginary part - e.g.,

    - * 1 + NaNi  == NaN + i == NaN + NaNi.
    + * 1 + NaNi == NaN + i == NaN + NaNi.

    * * @author Apache Software Foundation * @version $Revision$ $Date$ @@ -81,7 +81,7 @@ public class Complex implements Serializable { * Returns NaN if either real or imaginary part is * NaN and Double.POSITIVE_INFINITY if * neither part is NaN, but at least one part takes an infinite - * value. + * value.

    * * @return the absolute value */ @@ -115,12 +115,12 @@ public class Complex implements Serializable { * Uses the definitional formula *
          * (a + bi) + (c + di) = (a+c) + (b+d)i
    -     * 
    + *

    *

    * If either this or rhs has a NaN value in either part, * {@link #NaN} is returned; otherwise Inifinite and NaN values are * returned in the parts of the result according to the rules for - * {@link java.lang.Double} arithmetic. + * {@link java.lang.Double} arithmetic.

    * * @param rhs the other complex number * @return the complex number sum @@ -136,12 +136,12 @@ public class Complex implements Serializable { * "A + Bi" is "A - Bi". *

    * {@link #NaN} is returned if either the real or imaginary - * part of this Complex number equals Double.NaN. + * part of this Complex number equals Double.NaN.

    *

    * If the imaginary part is infinite, and the real part is not NaN, * the returned value has infinite imaginary part of the opposite * sign - e.g. the conjugate of 1 + POSITIVE_INFINITY i - * is 1 - NEGATIVE_INFINITY i + * is 1 - NEGATIVE_INFINITY i

    * * @return the conjugate of this Complex object */ @@ -164,7 +164,7 @@ public class Complex implements Serializable { * but uses * * prescaling of operands to limit the effects of overflows and - * underflows in the computation. + * underflows in the computation.

    *

    * Infinite and NaN values are handled / returned according to the * following rules, applied in the order presented: @@ -181,7 +181,7 @@ public class Complex implements Serializable { *

  • If this is infinite and rhs is finite, NaN values are * returned in the parts of the result if the {@link java.lang.Double} * rules applied to the definitional formula force NaN results.
  • - * + *

    * * @param rhs the other complex number * @return the complex number quotient @@ -226,12 +226,12 @@ public class Complex implements Serializable { *

    * If both the real and imaginary parts of two Complex numbers * are exactly the same, and neither is Double.NaN, the two - * Complex objects are considered to be equal. + * Complex objects are considered to be equal.

    *

    * All NaN values are considered to be equal - i.e, if either * (or both) real and imaginary parts of the complex number are equal * to Double.NaN, the complex number is equal to - * Complex.NaN. + * Complex.NaN.

    * * @param other Object to test for equality to this * @return true if two Complex objects are equal, false if @@ -269,7 +269,7 @@ public class Complex implements Serializable { /** * Get a hashCode for the complex number. *

    - * All NaN values have the same hash code. + * All NaN values have the same hash code.

    * * @return a hash code value for this object */ @@ -368,7 +368,7 @@ public class Complex implements Serializable { * Return the additive inverse of this complex number. *

    * Returns Complex.NaN if either real or imaginary - * part of this Complex number equals Double.NaN. + * part of this Complex number equals Double.NaN.

    * * @return the negation of this complex number */ @@ -387,12 +387,12 @@ public class Complex implements Serializable { * Uses the definitional formula *
          * (a + bi) - (c + di) = (a-c) + (b-d)i
    -     * 
    + *

    *

    * If either this or rhs has a NaN value in either part, * {@link #NaN} is returned; otherwise inifinite and NaN values are * returned in the parts of the result according to the rules for - * {@link java.lang.Double} arithmetic. + * {@link java.lang.Double} arithmetic.

    * * @param rhs the other complex number * @return the complex number difference @@ -413,10 +413,10 @@ public class Complex implements Serializable { * inverse cosine of this complex number. *

    * Implements the formula:

    -     *  acos(z) = -i (log(z + i (sqrt(1 - z2))))
    + * acos(z) = -i (log(z + i (sqrt(1 - z2))))

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN or infinite. + * input argument is NaN or infinite.

    * * @return the inverse cosine of this complex number * @since 1.2 @@ -436,10 +436,10 @@ public class Complex implements Serializable { * inverse sine of this complex number. *

    * Implements the formula:

    -     *  asin(z) = -i (log(sqrt(1 - z2) + iz)) 
    + * asin(z) = -i (log(sqrt(1 - z2) + iz))

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN or infinite. + * input argument is NaN or infinite.

    * * @return the inverse sine of this complex number. * @since 1.2 @@ -459,10 +459,10 @@ public class Complex implements Serializable { * inverse tangent of this complex number. *

    * Implements the formula:

    -     *  atan(z) = (i/2) log((i + z)/(i - z)) 
    + * atan(z) = (i/2) log((i + z)/(i - z))

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN or infinite. + * input argument is NaN or infinite.

    * * @return the inverse tangent of this complex number * @since 1.2 @@ -486,10 +486,10 @@ public class Complex implements Serializable { * cos(a + bi) = cos(a)cosh(b) - sin(a)sinh(b)i * where the (real) functions on the right-hand side are * {@link java.lang.Math#sin}, {@link java.lang.Math#cos}, - * {@link MathUtils#cosh} and {@link MathUtils#sinh}. + * {@link MathUtils#cosh} and {@link MathUtils#sinh}.

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN. + * input argument is NaN.

    *

    * Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result.

    @@ -497,7 +497,7 @@ public class Complex implements Serializable  {
          * 
          * cos(1 ± INFINITY i) = 1 ∓ INFINITY i
          * cos(±INFINITY + i) = NaN + NaN i
    -     * cos(±INFINITY ± INFINITY i) = NaN + NaN i
    + * cos(±INFINITY ± INFINITY i) = NaN + NaN i

    * * @return the cosine of this complex number * @since 1.2 @@ -520,10 +520,10 @@ public class Complex implements Serializable { * cosh(a + bi) = cosh(a)cos(b) + sinh(a)sin(b)i * where the (real) functions on the right-hand side are * {@link java.lang.Math#sin}, {@link java.lang.Math#cos}, - * {@link MathUtils#cosh} and {@link MathUtils#sinh}. + * {@link MathUtils#cosh} and {@link MathUtils#sinh}.

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN. + * input argument is NaN.

    *

    * Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result.

    @@ -531,7 +531,7 @@ public class Complex implements Serializable  {
          * 
          * cosh(1 ± INFINITY i) = NaN + NaN i
          * cosh(±INFINITY + i) = INFINITY ± INFINITY i
    -     * cosh(±INFINITY ± INFINITY i) = NaN + NaN i
    + * cosh(±INFINITY ± INFINITY i) = NaN + NaN i

    * * @return the hyperbolic cosine of this complex number. * @since 1.2 @@ -554,10 +554,10 @@ public class Complex implements Serializable { * exp(a + bi) = exp(a)cos(b) + exp(a)sin(b)i * where the (real) functions on the right-hand side are * {@link java.lang.Math#exp}, {@link java.lang.Math#cos}, and - * {@link java.lang.Math#sin}. + * {@link java.lang.Math#sin}.

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN. + * input argument is NaN.

    *

    * Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result.

    @@ -566,7 +566,7 @@ public class Complex implements Serializable  {
          * exp(1 ± INFINITY i) = NaN + NaN i
          * exp(INFINITY + i) = INFINITY + INFINITY i
          * exp(-INFINITY + i) = 0 + 0i
    -     * exp(±INFINITY ± INFINITY i) = NaN + NaN i
    + * exp(±INFINITY ± INFINITY i) = NaN + NaN i

    * * @return ethis * @since 1.2 @@ -589,10 +589,10 @@ public class Complex implements Serializable { * log(a + bi) = ln(|a + bi|) + arg(a + bi)i * where ln on the right hand side is {@link java.lang.Math#log}, * |a + bi| is the modulus, {@link Complex#abs}, and - * arg(a + bi) = {@link java.lang.Math#atan2}(b, a) + * arg(a + bi) = {@link java.lang.Math#atan2}(b, a)

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN. + * input argument is NaN.

    *

    * Infinite (or critical) values in real or imaginary parts of the input may * result in infinite or NaN values returned in parts of the result.

    @@ -604,7 +604,7 @@ public class Complex implements Serializable  {
          * log(INFINITY ± INFINITY i) = INFINITY ± (π/4)i
          * log(-INFINITY ± INFINITY i) = INFINITY ± (3π/4)i
          * log(0 + 0i) = -INFINITY + 0i
    -     * 
    + *

    * * @return ln of this complex number. * @since 1.2 @@ -624,11 +624,11 @@ public class Complex implements Serializable { * Implements the formula:
          *  yx = exp(x·log(y))
    * where exp and log are {@link #exp} and - * {@link #log}, respectively. + * {@link #log}, respectively.

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is NaN or infinite, or if y - * equals {@link Complex#ZERO}. + * equals {@link Complex#ZERO}.

    * * @param x the exponent. * @return thisx @@ -652,10 +652,10 @@ public class Complex implements Serializable { * sin(a + bi) = sin(a)cosh(b) - cos(a)sinh(b)i * where the (real) functions on the right-hand side are * {@link java.lang.Math#sin}, {@link java.lang.Math#cos}, - * {@link MathUtils#cosh} and {@link MathUtils#sinh}. + * {@link MathUtils#cosh} and {@link MathUtils#sinh}.

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN. + * input argument is NaN.

    *

    * Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result.

    @@ -663,7 +663,7 @@ public class Complex implements Serializable  {
          * 
          * sin(1 ± INFINITY i) = 1 ± INFINITY i
          * sin(±INFINITY + i) = NaN + NaN i
    -     * sin(±INFINITY ± INFINITY i) = NaN + NaN i
    + * sin(±INFINITY ± INFINITY i) = NaN + NaN i

    * * @return the sine of this complex number. * @since 1.2 @@ -686,10 +686,10 @@ public class Complex implements Serializable { * sinh(a + bi) = sinh(a)cos(b)) + cosh(a)sin(b)i * where the (real) functions on the right-hand side are * {@link java.lang.Math#sin}, {@link java.lang.Math#cos}, - * {@link MathUtils#cosh} and {@link MathUtils#sinh}. + * {@link MathUtils#cosh} and {@link MathUtils#sinh}.

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN. + * input argument is NaN.

    *

    * Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result.

    @@ -697,7 +697,7 @@ public class Complex implements Serializable  {
          * 
          * sinh(1 ± INFINITY i) = NaN + NaN i
          * sinh(±INFINITY + i) = ± INFINITY + INFINITY i
    -     * sinh(±INFINITY ± INFINITY i) = NaN + NaN i

    * * @return the hyperbolic sine of this complex number * @since 1.2 @@ -725,10 +725,10 @@ public class Complex implements Serializable { *
  • |a| = {@link Math#abs}(a)
  • *
  • |a + bi| = {@link Complex#abs}(a + bi)
  • *
  • sign(b) = {@link MathUtils#indicator}(b) - * + *

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN. + * input argument is NaN.

    *

    * Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result.

    @@ -739,7 +739,7 @@ public class Complex implements Serializable  {
          * sqrt(-INFINITY + i) = 0 + INFINITY i
          * sqrt(INFINITY ± INFINITY i) = INFINITY + NaN i
          * sqrt(-INFINITY ± INFINITY i) = NaN ± INFINITY i
    -     * 
    + *

    * * @return the square root of this complex number * @since 1.2 @@ -769,13 +769,13 @@ public class Complex implements Serializable { * number. *

    * Computes the result directly as - * sqrt(Complex.ONE.subtract(z.multiply(z))). + * sqrt(Complex.ONE.subtract(z.multiply(z))).

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN. + * input argument is NaN.

    *

    * Infinite values in real or imaginary parts of the input may result in - * infinite or NaN values returned in parts of the result. + * infinite or NaN values returned in parts of the result.

    * * @return the square root of 1 - this2 * @since 1.2 @@ -793,10 +793,10 @@ public class Complex implements Serializable { * tan(a + bi) = sin(2a)/(cos(2a)+cosh(2b)) + [sinh(2b)/(cos(2a)+cosh(2b))]i * where the (real) functions on the right-hand side are * {@link java.lang.Math#sin}, {@link java.lang.Math#cos}, - * {@link MathUtils#cosh} and {@link MathUtils#sinh}. + * {@link MathUtils#cosh} and {@link MathUtils#sinh}.

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN. + * input argument is NaN.

    *

    * Infinite (or critical) values in real or imaginary parts of the input may * result in infinite or NaN values returned in parts of the result.

    @@ -805,7 +805,7 @@ public class Complex implements Serializable  {
          * tan(1 ± INFINITY i) = 0 + NaN i
          * tan(±INFINITY + i) = NaN + NaN i
          * tan(±INFINITY ± INFINITY i) = NaN + NaN i
    -     * tan(±π/2 + 0 i) = ±INFINITY + NaN i
    + * tan(±π/2 + 0 i) = ±INFINITY + NaN i

    * * @return the tangent of this complex number * @since 1.2 @@ -831,10 +831,10 @@ public class Complex implements Serializable { * tan(a + bi) = sinh(2a)/(cosh(2a)+cos(2b)) + [sin(2b)/(cosh(2a)+cos(2b))]i * where the (real) functions on the right-hand side are * {@link java.lang.Math#sin}, {@link java.lang.Math#cos}, - * {@link MathUtils#cosh} and {@link MathUtils#sinh}. + * {@link MathUtils#cosh} and {@link MathUtils#sinh}.

    *

    * Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is NaN. + * input argument is NaN.

    *

    * Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result.

    @@ -843,7 +843,7 @@ public class Complex implements Serializable  {
          * tanh(1 ± INFINITY i) = NaN + NaN i
          * tanh(±INFINITY + i) = NaN + 0 i
          * tanh(±INFINITY ± INFINITY i) = NaN + NaN i
    -     * tanh(0 + (π/2)i) = NaN + INFINITY i
    + * tanh(0 + (π/2)i) = NaN + INFINITY i

    * * @return the hyperbolic tangent of this complex number * @since 1.2 diff --git a/src/java/org/apache/commons/math/complex/ComplexUtils.java b/src/java/org/apache/commons/math/complex/ComplexUtils.java index 19481ee0b..457ca9a64 100644 --- a/src/java/org/apache/commons/math/complex/ComplexUtils.java +++ b/src/java/org/apache/commons/math/complex/ComplexUtils.java @@ -242,10 +242,10 @@ public class ComplexUtils { * Creates a complex number from the given polar representation. *

    * The value returned is r·ei·theta, - * computed as r·cos(theta) + r·sin(theta)i + * computed as r·cos(theta) + r·sin(theta)i

    *

    * If either r or theta is NaN, or - * theta is infinite, {@link Complex#NaN} is returned. + * theta is infinite, {@link Complex#NaN} is returned.

    *

    * If r is infinite and theta is finite, * infinite or NaN values may be returned in parts of the result, following @@ -255,7 +255,7 @@ public class ComplexUtils { * polar2Complex(INFINITY, π/4) = INFINITY + INFINITY i * polar2Complex(INFINITY, 0) = INFINITY + NaN i * polar2Complex(INFINITY, -π/4) = INFINITY - INFINITY i - * polar2Complex(INFINITY, 5π/4) = -INFINITY - INFINITY i + * polar2Complex(INFINITY, 5π/4) = -INFINITY - INFINITY i

    * * @param r the modulus of the complex number to create * @param theta the argument of the complex number to create diff --git a/src/java/org/apache/commons/math/random/AbstractRandomGenerator.java b/src/java/org/apache/commons/math/random/AbstractRandomGenerator.java index 26a065fa5..fd633464d 100644 --- a/src/java/org/apache/commons/math/random/AbstractRandomGenerator.java +++ b/src/java/org/apache/commons/math/random/AbstractRandomGenerator.java @@ -25,7 +25,7 @@ package org.apache.commons.math.random; * Concrete implementations must override * this method and should provide better / more * performant implementations of the other methods if the underlying PRNG - * supplies them. + * supplies them.

    * * @since 1.1 * @version $Revision$ $Date$ @@ -66,7 +66,7 @@ public abstract class AbstractRandomGenerator implements RandomGenerator { *

    * Implementations that do not override the default implementation of * nextGaussian should include a call to {@link #clear} in the - * implementation of this method. + * implementation of this method.

    * * @param seed the seed value */ @@ -78,7 +78,7 @@ public abstract class AbstractRandomGenerator implements RandomGenerator { * the length of the byte array. *

    * The default implementation fills the array with bytes extracted from - * random integers generated using {@link #nextInt}. + * random integers generated using {@link #nextInt}.

    * * @param bytes the non-null byte array in which to put the * random bytes @@ -108,7 +108,7 @@ public abstract class AbstractRandomGenerator implements RandomGenerator { * The default implementation provided here returns *
          * (int) (nextDouble() * Integer.MAX_VALUE)
    -     * 
    + *

    * * @return the next pseudorandom, uniformly distributed int * value from this random number generator's sequence @@ -125,7 +125,7 @@ public abstract class AbstractRandomGenerator implements RandomGenerator { * The default implementation returns *
          * (int) (nextDouble() * n
    -     * 
    + *

    * * @param n the bound on the random number to be returned. Must be * positive. @@ -150,7 +150,7 @@ public abstract class AbstractRandomGenerator implements RandomGenerator { * The default implementation returns *
          * (long) (nextDouble() * Long.MAX_VALUE)
    -     * 
    + *

    * * @return the next pseudorandom, uniformly distributed long *value from this random number generator's sequence @@ -167,7 +167,7 @@ public abstract class AbstractRandomGenerator implements RandomGenerator { * The default implementation returns *
          * nextDouble() <= 0.5
    -     * 
    + *

    * * @return the next pseudorandom, uniformly distributed * boolean value from this random number generator's @@ -185,7 +185,7 @@ public abstract class AbstractRandomGenerator implements RandomGenerator { * The default implementation returns *
          * (float) nextDouble() 
    -     * 
    + *

    * * @return the next pseudorandom, uniformly distributed float * value between 0.0 and 1.0 from this @@ -201,7 +201,7 @@ public abstract class AbstractRandomGenerator implements RandomGenerator { * 1.0 from this random number generator's sequence. *

    * This method provides the underlying source of random data used by the - * other methods. + * other methods.

    * * @return the next pseudorandom, uniformly distributed * double value between 0.0 and @@ -216,13 +216,13 @@ public abstract class AbstractRandomGenerator implements RandomGenerator { *

    * The default implementation uses the Polar Method * due to G.E.P. Box, M.E. Muller and G. Marsaglia, as described in - * D. Knuth, The Art of Computer Programming, 3.4.1C. + * D. Knuth, The Art of Computer Programming, 3.4.1C.

    *

    * The algorithm generates a pair of independent random values. One of * these is cached for reuse, so the full algorithm is not executed on each * activation. Implementations that do not override this method should * make sure to call {@link #clear} to clear the cached value in the - * implementation of {@link #setSeed(long)}. + * implementation of {@link #setSeed(long)}.

    * * @return the next pseudorandom, Gaussian ("normally") distributed * double value with mean 0.0 and diff --git a/src/java/org/apache/commons/math/random/EmpiricalDistribution.java b/src/java/org/apache/commons/math/random/EmpiricalDistribution.java index 283d9fbb3..60696fed3 100644 --- a/src/java/org/apache/commons/math/random/EmpiricalDistribution.java +++ b/src/java/org/apache/commons/math/random/EmpiricalDistribution.java @@ -40,9 +40,9 @@ import org.apache.commons.math.stat.descriptive.StatisticalSummary; *
  • generating random values from the distribution
  • * * Applications can use EmpiricalDistribution implementations to - * build grouped frequnecy histograms representing the input data or to + * build grouped frequency histograms representing the input data or to * generate random values "like" those in the input file -- i.e., the values - * generated will follow the distribution of the values in the file. + * generated will follow the distribution of the values in the file.

    * * @version $Revision$ $Date$ */ diff --git a/src/java/org/apache/commons/math/random/NotPositiveDefiniteMatrixException.java b/src/java/org/apache/commons/math/random/NotPositiveDefiniteMatrixException.java index 4e775a2ce..8b7ae9ac4 100644 --- a/src/java/org/apache/commons/math/random/NotPositiveDefiniteMatrixException.java +++ b/src/java/org/apache/commons/math/random/NotPositiveDefiniteMatrixException.java @@ -19,9 +19,12 @@ package org.apache.commons.math.random; import org.apache.commons.math.MathException; -/** This class represents exceptions thrown by the correlated random +/** + * This class represents exceptions thrown by the correlated random * vector generator. - * @version $Revision:$ $Date$ + * + * @since 1.2 + * @version $Revision$ $Date$ */ public class NotPositiveDefiniteMatrixException extends MathException { diff --git a/src/java/org/apache/commons/math/random/RandomData.java b/src/java/org/apache/commons/math/random/RandomData.java index b2b42688b..53f8f4ca0 100644 --- a/src/java/org/apache/commons/math/random/RandomData.java +++ b/src/java/org/apache/commons/math/random/RandomData.java @@ -29,12 +29,12 @@ public interface RandomData { *

    * The generated string will be random, but not cryptographically * secure. To generate cryptographically secure strings, use - * nextSecureHexString + * nextSecureHexString

    *

    * Preconditions:

    + *

    * * @param len the length of the string to be generated * @return random string of hex characters of length len @@ -47,12 +47,12 @@ public interface RandomData { *

    * The generated integer will be random, but not cryptographically secure. * To generate cryptographically secure integer sequences, use - * nextSecureInt. + * nextSecureInt.

    *

    * Preconditions:

    + *

    * * @param lower lower bound for generated integer * @param upper upper bound for generated integer @@ -68,12 +68,12 @@ public interface RandomData { * The generated long integer values will be random, but not * cryptographically secure. * To generate cryptographically secure sequences of longs, use - * nextSecureLong + * nextSecureLong

    *

    * Preconditions:

    + *

    * * @param lower lower bound for generated integer * @param upper upper bound for generated integer @@ -87,12 +87,12 @@ public interface RandomData { * sequence. *

    * If cryptographic security is not required, - * use nextHexString(). + * use nextHexString().

    *

    * Preconditions:

    + *

    * @param len length of return string * @return the random hex string */ @@ -105,16 +105,16 @@ public interface RandomData { *

    * Sequences of integers generated using this method will be * cryptographically secure. If cryptographic security is not required, - * nextInt should be used instead of this method. + * nextInt should be used instead of this method.

    *

    * Definition: * - * Secure Random Sequence + * Secure Random Sequence

    *

    * Preconditions:

    + *

    * * @param lower lower bound for generated integer * @param upper upper bound for generated integer @@ -125,19 +125,20 @@ public interface RandomData { /** * Generates a random long integer between lower - * and upper (endpoints included).

    + * and upper (endpoints included). + *

    * Sequences of long values generated using this method will be * cryptographically secure. If cryptographic security is not required, - * nextLong should be used instead of this method. + * nextLong should be used instead of this method.

    *

    * Definition: * - * Secure Random Sequence + * Secure Random Sequence

    *

    * Preconditions:

    + *

    * * @param lower lower bound for generated integer * @param upper upper bound for generated integer @@ -152,12 +153,12 @@ public interface RandomData { *

    * Definition: * - * Poisson Distribution + * Poisson Distribution

    *

    * Preconditions:

    + *

    * @param mean Mean of the distribution * @return poisson deviate with the specified mean */ @@ -170,12 +171,12 @@ public interface RandomData { *

    * Definition: * - * Normal Distribution + * Normal Distribution

    *

    * Preconditions:

    + *

    * @param mu Mean of the distribution * @param sigma Standard deviation of the distribution * @return random value from Gaussian distribution with mean = mu, @@ -189,12 +190,12 @@ public interface RandomData { *

    * Definition: * - * Exponential Distribution + * Exponential Distribution

    *

    * Preconditions:

    + *

    * @param mean Mean of the distribution * @return random value from exponential distribution */ @@ -209,12 +210,12 @@ public interface RandomData { * Uniform Distribution lower and * upper - lower are the * - * location and scale parameters, respectively. + * location and scale parameters, respectively.

    *

    * Preconditions:

    + *

    * * @param lower lower endpoint of the interval of support * @param upper upper endpoint of the interval of support @@ -229,14 +230,14 @@ public interface RandomData { * 0 through n-1 (inclusive). *

    * Generated arrays represent permutations - * of n taken k at a time. + * of n taken k at a time.

    *

    * Preconditions:

    * If the preconditions are not met, an IllegalArgumentException is - * thrown. + * thrown.

    * * @param n domain of the permutation * @param k size of the permutation @@ -254,14 +255,14 @@ public interface RandomData { * c are distinct, the resulting object array represents a * * Simple Random Sample of size - * k from the elements of c. + * k from the elements of c.

    *

    * Preconditions:

    * If the preconditions are not met, an IllegalArgumentException is - * thrown. + * thrown.

    * * @param c collection to be sampled * @param k size of the sample diff --git a/src/java/org/apache/commons/math/random/RandomDataImpl.java b/src/java/org/apache/commons/math/random/RandomDataImpl.java index 0ce3babfc..8d2e7ae5d 100644 --- a/src/java/org/apache/commons/math/random/RandomDataImpl.java +++ b/src/java/org/apache/commons/math/random/RandomDataImpl.java @@ -36,10 +36,10 @@ import java.util.Collection; *

    * Supports reseeding the underlying pseudo-random number generator (PRNG). * The SecurityProvider and Algorithm - * used by the SecureRandom instance can also be reset. + * used by the SecureRandom instance can also be reset.

    *

    * For details on the default PRNGs, see {@link java.util.Random} and - * {@link java.security.SecureRandom}. + * {@link java.security.SecureRandom}.

    *

    * Usage Notes:

    + *

    * * @version $Revision$ $Date$ */ @@ -109,12 +109,14 @@ public class RandomDataImpl implements RandomData, Serializable { } /** + * {@inheritDoc}

    * Algorithm Description: hex strings are generated * using a 2-step process.

      *
    1. * len/2+1 binary bytes are generated using the underlying Random
    2. *
    3. - * Each binary byte is translated into 2 hex digits
    + * Each binary byte is translated into 2 hex digits

    + * * @param len the desired string length. * @return the random string. */ @@ -190,6 +192,7 @@ public class RandomDataImpl implements RandomData, Serializable { } /** + * {@inheritDoc}

    * Algorithm Description: hex strings are generated in * 40-byte segments using a 3-step process.

      *
    1. @@ -199,6 +202,7 @@ public class RandomDataImpl implements RandomData, Serializable { * SHA-1 hash is applied to yield a 20-byte binary digest.
    2. *
    3. * Each byte of the binary digest is converted to 2 hex digits.
    + *

    * * @param len the length of the generated string * @return the random string @@ -288,17 +292,16 @@ public class RandomDataImpl implements RandomData, Serializable { } /** - * Generates a random long value from the Poisson distribution with the - * given mean. + * {@inheritDoc} *

    * Algorithm Description: * Uses simulation of a Poisson process using Uniform deviates, as * described * - * here. + * here.

    *

    * The Poisson process (and hence value returned) is bounded by - * 1000 * mean. + * 1000 * mean.

    * * @param mean mean of the Poisson distribution. * @return the random Poisson value. @@ -348,7 +351,7 @@ public class RandomDataImpl implements RandomData, Serializable { * Algorithm Description: Uses the * * Inversion Method to generate exponentially distributed random values - * from uniform deviates. + * from uniform deviates.

    * * @param mean the mean of the distribution * @return the random Exponential value @@ -367,11 +370,12 @@ public class RandomDataImpl implements RandomData, Serializable { } /** + * {@inheritDoc}

    * Algorithm Description: scales the output of * Random.nextDouble(), but rejects 0 values (i.e., will generate another * random double if Random.nextDouble() returns 0). * This is necessary to provide a symmetric output interval - * (both endpoints excluded). + * (both endpoints excluded).

    * * @param lower the lower bound. * @param upper the upper bound. @@ -397,7 +401,7 @@ public class RandomDataImpl implements RandomData, Serializable { * Returns the RandomGenerator used to generate non-secure * random data. *

    - * Creates and initializes a default generator if null. + * Creates and initializes a default generator if null.

    * * @return the Random used to generate random data * @since 1.1 @@ -413,7 +417,7 @@ public class RandomDataImpl implements RandomData, Serializable { /** * Returns the SecureRandom used to generate secure random data. *

    - * Creates and initializes if null. + * Creates and initializes if null.

    * * @return the SecureRandom used to generate secure random data */ @@ -428,7 +432,7 @@ public class RandomDataImpl implements RandomData, Serializable { /** * Reseeds the random number generator with the supplied seed. *

    - * Will create and initialize if null. + * Will create and initialize if null.

    * * @param seed the seed value to use */ @@ -443,7 +447,7 @@ public class RandomDataImpl implements RandomData, Serializable { * Reseeds the secure random number generator with the current time * in milliseconds. *

    - * Will create and initialize if null. + * Will create and initialize if null.

    */ public void reSeedSecure() { if (secRand == null) { @@ -455,7 +459,7 @@ public class RandomDataImpl implements RandomData, Serializable { /** * Reseeds the secure random number generator with the supplied seed. *

    - * Will create and initialize if null. + * Will create and initialize if null.

    * * @param seed the seed value to use */ diff --git a/src/java/org/apache/commons/math/random/RandomVectorGenerator.java b/src/java/org/apache/commons/math/random/RandomVectorGenerator.java index 2aa4fe648..28c928485 100644 --- a/src/java/org/apache/commons/math/random/RandomVectorGenerator.java +++ b/src/java/org/apache/commons/math/random/RandomVectorGenerator.java @@ -18,9 +18,10 @@ package org.apache.commons.math.random; /** This interface represents a random generator for whole vectors. - + * + * @since 1.2 * @version $Revision$ $Date$ - + * */ public interface RandomVectorGenerator { diff --git a/src/java/org/apache/commons/math/random/UniformRandomGenerator.java b/src/java/org/apache/commons/math/random/UniformRandomGenerator.java index ec6baf7d2..3c002de33 100644 --- a/src/java/org/apache/commons/math/random/UniformRandomGenerator.java +++ b/src/java/org/apache/commons/math/random/UniformRandomGenerator.java @@ -24,6 +24,8 @@ package org.apache.commons.math.random; * deviation equal to 1. Generated values fall in the range * [-√3, +√3].

    * + * @since 1.2 + * * @version $Revision$ $Date$ */ diff --git a/src/java/org/apache/commons/math/random/ValueServer.java b/src/java/org/apache/commons/math/random/ValueServer.java index 23844012b..f2b0476f5 100644 --- a/src/java/org/apache/commons/math/random/ValueServer.java +++ b/src/java/org/apache/commons/math/random/ValueServer.java @@ -26,7 +26,7 @@ import java.net.MalformedURLException; * Generates values for use in simulation applications. *

    * How values are generated is determined by the mode - * property. + * property.

    *

    * Supported mode values are:

    + *
  • CONSTANT_MODE -- returns mu every time.
  • * * @version $Revision$ $Date$ * @@ -142,10 +142,10 @@ public class ValueServer { * in valuesFileURL, using the default number of bins. *

    * valuesFileURL must exist and be - * readable by *this at runtime. + * readable by *this at runtime.

    *

    * This method must be called before using getNext() - * with mode = DIGEST_MODE + * with mode = DIGEST_MODE

    * * @throws IOException if an I/O error occurs reading the input file */ @@ -158,11 +158,11 @@ public class ValueServer { * Computes the empirical distribution using values from the file * in valuesFileURL and binCount bins. *

    - * valuesFileURL must exist and be - * readable by *this at runtime. + * valuesFileURL must exist and be readable by this process + * at runtime.

    *

    * This method must be called before using getNext() - * with mode = DIGEST_MODE + * with mode = DIGEST_MODE

    * * @param binCount the number of bins used in computing the empirical * distribution @@ -287,7 +287,7 @@ public class ValueServer { * Preconditions: + * IllegalStateException will be thrown

    * * @return next random value from the empirical distribution digest */