Repository: commons-math Updated Branches: refs/heads/MATH_3_X cdfa228e7 -> 98b7057e0
Javadoc fixes. Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/98b7057e Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/98b7057e Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/98b7057e Branch: refs/heads/MATH_3_X Commit: 98b7057e037cc114b67e976fbfbd7745558faaa6 Parents: cdfa228 Author: Phil Steitz <phil.ste...@gmail.com> Authored: Mon Dec 28 14:00:29 2015 -0700 Committer: Phil Steitz <phil.ste...@gmail.com> Committed: Mon Dec 28 14:00:29 2015 -0700 ---------------------------------------------------------------------- .../solvers/BracketingNthOrderBrentSolver.java | 7 +++-- .../math3/analysis/solvers/BrentSolver.java | 15 +++++------ .../FieldBracketingNthOrderBrentSolver.java | 7 +++-- .../math3/analysis/solvers/LaguerreSolver.java | 28 ++++++++++---------- .../math3/analysis/solvers/MullerSolver.java | 6 ++--- .../math3/analysis/solvers/MullerSolver2.java | 10 +++---- .../analysis/solvers/UnivariateSolverUtils.java | 24 +++++++++-------- 7 files changed, 48 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/98b7057e/src/main/java/org/apache/commons/math3/analysis/solvers/BracketingNthOrderBrentSolver.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/solvers/BracketingNthOrderBrentSolver.java b/src/main/java/org/apache/commons/math3/analysis/solvers/BracketingNthOrderBrentSolver.java index 4981592..956bf9e 100644 --- a/src/main/java/org/apache/commons/math3/analysis/solvers/BracketingNthOrderBrentSolver.java +++ b/src/main/java/org/apache/commons/math3/analysis/solvers/BracketingNthOrderBrentSolver.java @@ -20,8 +20,8 @@ package org.apache.commons.math3.analysis.solvers; import org.apache.commons.math3.analysis.UnivariateFunction; import org.apache.commons.math3.exception.MathInternalError; import org.apache.commons.math3.exception.NoBracketingException; -import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.exception.NumberIsTooLargeException; +import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.exception.TooManyEvaluationsException; import org.apache.commons.math3.util.FastMath; import org.apache.commons.math3.util.Precision; @@ -36,9 +36,8 @@ import org.apache.commons.math3.util.Precision; * to user specified {@link AllowedSolution},</li> * <li>the maximal order for the invert polynomial root search is * user-specified instead of being invert quadratic only</li> - * </ul> - * </p> - * The given interval must bracket the root. + * </ul><p> + * The given interval must bracket the root.</p> * */ public class BracketingNthOrderBrentSolver http://git-wip-us.apache.org/repos/asf/commons-math/blob/98b7057e/src/main/java/org/apache/commons/math3/analysis/solvers/BrentSolver.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/solvers/BrentSolver.java b/src/main/java/org/apache/commons/math3/analysis/solvers/BrentSolver.java index 0cc8750..cf69410 100644 --- a/src/main/java/org/apache/commons/math3/analysis/solvers/BrentSolver.java +++ b/src/main/java/org/apache/commons/math3/analysis/solvers/BrentSolver.java @@ -18,8 +18,8 @@ package org.apache.commons.math3.analysis.solvers; import org.apache.commons.math3.exception.NoBracketingException; -import org.apache.commons.math3.exception.TooManyEvaluationsException; import org.apache.commons.math3.exception.NumberIsTooLargeException; +import org.apache.commons.math3.exception.TooManyEvaluationsException; import org.apache.commons.math3.util.FastMath; import org.apache.commons.math3.util.Precision; @@ -31,15 +31,14 @@ import org.apache.commons.math3.util.Precision; * in the given interval {@code [a, b]} to within a tolerance * {@code 2 eps abs(x) + t} where {@code eps} is the relative accuracy and * {@code t} is the absolute accuracy. - * The given interval must bracket the root. + * <p>The given interval must bracket the root.</p> * <p> * The reference implementation is given in chapter 4 of * <blockquote> - * <b>Algorithms for Minimization Without Derivatives</b><br> - * <em>Richard P. Brent</em><br> - * Dover, 2002<br> + * <b>Algorithms for Minimization Without Derivatives</b>, + * <em>Richard P. Brent</em>, + * Dover, 2002 * </blockquote> - * </p> * * @see BaseAbstractUnivariateSolver */ @@ -138,8 +137,8 @@ public class BrentSolver extends AbstractUnivariateSolver { * This implementation is based on the algorithm described at page 58 of * the book * <blockquote> - * <b>Algorithms for Minimization Without Derivatives</b> - * <it>Richard P. Brent</it> + * <b>Algorithms for Minimization Without Derivatives</b>, + * <it>Richard P. Brent</it>, * Dover 0-486-41998-3 * </blockquote> * http://git-wip-us.apache.org/repos/asf/commons-math/blob/98b7057e/src/main/java/org/apache/commons/math3/analysis/solvers/FieldBracketingNthOrderBrentSolver.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/solvers/FieldBracketingNthOrderBrentSolver.java b/src/main/java/org/apache/commons/math3/analysis/solvers/FieldBracketingNthOrderBrentSolver.java index d3f4a2a..f0ca8b9 100644 --- a/src/main/java/org/apache/commons/math3/analysis/solvers/FieldBracketingNthOrderBrentSolver.java +++ b/src/main/java/org/apache/commons/math3/analysis/solvers/FieldBracketingNthOrderBrentSolver.java @@ -36,12 +36,11 @@ import org.apache.commons.math3.util.Precision; * The changes with respect to the original Brent algorithm are: * <ul> * <li>the returned value is chosen in the current interval according - * to user specified {@link AllowedSolution},</li> + * to user specified {@link AllowedSolution}</li> * <li>the maximal order for the invert polynomial root search is * user-specified instead of being invert quadratic only</li> - * </ul> - * </p> - * The given interval must bracket the root. + * </ul><p> + * The given interval must bracket the root.</p> * * @param <T> the type of the field elements * @since 3.6 http://git-wip-us.apache.org/repos/asf/commons-math/blob/98b7057e/src/main/java/org/apache/commons/math3/analysis/solvers/LaguerreSolver.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/solvers/LaguerreSolver.java b/src/main/java/org/apache/commons/math3/analysis/solvers/LaguerreSolver.java index 9425112..5312dac 100644 --- a/src/main/java/org/apache/commons/math3/analysis/solvers/LaguerreSolver.java +++ b/src/main/java/org/apache/commons/math3/analysis/solvers/LaguerreSolver.java @@ -16,14 +16,14 @@ */ package org.apache.commons.math3.analysis.solvers; +import org.apache.commons.math3.analysis.polynomials.PolynomialFunction; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; -import org.apache.commons.math3.analysis.polynomials.PolynomialFunction; import org.apache.commons.math3.exception.NoBracketingException; -import org.apache.commons.math3.exception.NullArgumentException; import org.apache.commons.math3.exception.NoDataException; -import org.apache.commons.math3.exception.TooManyEvaluationsException; +import org.apache.commons.math3.exception.NullArgumentException; import org.apache.commons.math3.exception.NumberIsTooLargeException; +import org.apache.commons.math3.exception.TooManyEvaluationsException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.util.FastMath; @@ -32,8 +32,8 @@ import org.apache.commons.math3.util.FastMath; * Laguerre's Method</a> for root finding of real coefficient polynomials. * For reference, see * <blockquote> - * <b>A First Course in Numerical Analysis</b><br> - * ISBN 048641454X, chapter 8.<br> + * <b>A First Course in Numerical Analysis</b>, + * ISBN 048641454X, chapter 8. * </blockquote> * 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. @@ -136,7 +136,7 @@ public class LaguerreSolver extends AbstractPolynomialSolver { * Despite the bracketing condition, the root returned by * {@link LaguerreSolver.ComplexSolver#solve(Complex[],Complex)} may * not be a real zero inside {@code [min, max]}. - * For example, <code>p(x) = x<sup>3</sup> + 1,</code> + * For example, <code> p(x) = x<sup>3</sup> + 1, </code> * with {@code min = -2}, {@code max = 2}, {@code initial = 0}. * When it occurs, this code calls * {@link LaguerreSolver.ComplexSolver#solveAll(Complex[],Complex)} @@ -176,8 +176,8 @@ public class LaguerreSolver extends AbstractPolynomialSolver { /** * Find all complex roots for the polynomial with the given * coefficients, starting from the given initial value. - * <br/> - * Note: This method is not part of the API of {@link BaseUnivariateSolver}. + * <p> + * Note: This method is not part of the API of {@link BaseUnivariateSolver}.</p> * * @param coefficients Polynomial coefficients. * @param initial Start value. @@ -200,8 +200,8 @@ public class LaguerreSolver extends AbstractPolynomialSolver { /** * Find all complex roots for the polynomial with the given * coefficients, starting from the given initial value. - * <br/> - * Note: This method is not part of the API of {@link BaseUnivariateSolver}. + * <p> + * Note: This method is not part of the API of {@link BaseUnivariateSolver}.</p> * * @param coefficients polynomial coefficients * @param initial start value @@ -231,8 +231,8 @@ public class LaguerreSolver extends AbstractPolynomialSolver { /** * Find a complex root for the polynomial with the given coefficients, * starting from the given initial value. - * <br/> - * Note: This method is not part of the API of {@link BaseUnivariateSolver}. + * <p> + * Note: This method is not part of the API of {@link BaseUnivariateSolver}.</p> * * @param coefficients Polynomial coefficients. * @param initial Start value. @@ -255,8 +255,8 @@ public class LaguerreSolver extends AbstractPolynomialSolver { /** * Find a complex root for the polynomial with the given coefficients, * starting from the given initial value. - * <br/> - * Note: This method is not part of the API of {@link BaseUnivariateSolver}. + * <p> + * Note: This method is not part of the API of {@link BaseUnivariateSolver}.</p> * * @param coefficients polynomial coefficients * @param initial start value http://git-wip-us.apache.org/repos/asf/commons-math/blob/98b7057e/src/main/java/org/apache/commons/math3/analysis/solvers/MullerSolver.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/solvers/MullerSolver.java b/src/main/java/org/apache/commons/math3/analysis/solvers/MullerSolver.java index 06a7b6b..2e59ed4 100644 --- a/src/main/java/org/apache/commons/math3/analysis/solvers/MullerSolver.java +++ b/src/main/java/org/apache/commons/math3/analysis/solvers/MullerSolver.java @@ -16,10 +16,10 @@ */ package org.apache.commons.math3.analysis.solvers; -import org.apache.commons.math3.util.FastMath; -import org.apache.commons.math3.exception.NumberIsTooLargeException; import org.apache.commons.math3.exception.NoBracketingException; +import org.apache.commons.math3.exception.NumberIsTooLargeException; import org.apache.commons.math3.exception.TooManyEvaluationsException; +import org.apache.commons.math3.util.FastMath; /** * This class implements the <a href="http://mathworld.wolfram.com/MullersMethod.html"> @@ -30,7 +30,7 @@ import org.apache.commons.math3.exception.TooManyEvaluationsException; * Muller's method applies to both real and complex functions, but here we * restrict ourselves to real functions. * This class differs from {@link MullerSolver} in the way it avoids complex - * operations.</p> + * operations.</p><p> * Muller's original 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, http://git-wip-us.apache.org/repos/asf/commons-math/blob/98b7057e/src/main/java/org/apache/commons/math3/analysis/solvers/MullerSolver2.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/solvers/MullerSolver2.java b/src/main/java/org/apache/commons/math3/analysis/solvers/MullerSolver2.java index 2a79c11..864cfd5 100644 --- a/src/main/java/org/apache/commons/math3/analysis/solvers/MullerSolver2.java +++ b/src/main/java/org/apache/commons/math3/analysis/solvers/MullerSolver2.java @@ -30,15 +30,15 @@ import org.apache.commons.math3.util.FastMath; * Muller's method applies to both real and complex functions, but here we * restrict ourselves to real functions. * This class differs from {@link MullerSolver} in the way it avoids complex - * operations.</p> + * operations.</p><p> * Except for the initial [min, max], it 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 + * condition, e.g. f(x0), f(x1), f(x2) can have the same sign. If a complex + * number arises in the computation, we simply use its modulus as a real * approximation.</p> * <p> - * Because the interval may not be bracketing, bisection alternative is + * Because the interval may not be bracketing, the bisection alternative is * not applicable here. However in practice our treatment usually works - * well, especially near real zeroes where the imaginary part of complex + * well, especially near real zeroes where the imaginary part of the complex * approximation is often negligible.</p> * <p> * The formulas here do not use divided differences directly.</p> http://git-wip-us.apache.org/repos/asf/commons-math/blob/98b7057e/src/main/java/org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.java b/src/main/java/org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.java index b1ecded..71b34c5 100644 --- a/src/main/java/org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.java +++ b/src/main/java/org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.java @@ -81,8 +81,10 @@ public class UnivariateSolverUtils { return solver.solve(Integer.MAX_VALUE, function, x0, x1); } - /** Force a root found by a non-bracketing solver to lie on a specified side, - * as if the solver was a bracketing one. + /** + * Force a root found by a non-bracketing solver to lie on a specified side, + * as if the solver were a bracketing one. + * * @param maxEval maximal number of new evaluations of the function * (evaluations already done for finding the root should have already been subtracted * from this number) @@ -173,13 +175,13 @@ public class UnivariateSolverUtils { * This method simply calls {@link #bracket(UnivariateFunction, double, double, double, * double, double, int) bracket(function, initial, lowerBound, upperBound, q, r, maximumIterations)} * with {@code q} and {@code r} set to 1.0 and {@code maximumIterations} set to {@code Integer.MAX_VALUE}. - * <strong>Note: </strong> this method can take - * <code>Integer.MAX_VALUE</code> iterations to throw a - * <code>ConvergenceException.</code> Unless you are confident that there - * is a root between <code>lowerBound</code> and <code>upperBound</code> - * near <code>initial,</code> it is better to use - * {@link #bracket(UnivariateFunction, double, double, double, double, - * double, int) bracket(function, initial, lowerBound, upperBound, q, r, maximumIterations)}, + * <p> + * <strong>Note: </strong> this method can take {@code Integer.MAX_VALUE} + * iterations to throw a {@code ConvergenceException.} Unless you are + * confident that there is a root between {@code lowerBound} and + * {@code upperBound} near {@code initial}, it is better to use + * {@link #bracket(UnivariateFunction, double, double, double, double,double, int) + * bracket(function, initial, lowerBound, upperBound, q, r, maximumIterations)}, * explicitly specifying the maximum number of iterations.</p> * * @param function Function. @@ -244,11 +246,11 @@ public class UnivariateSolverUtils { * The algorithm stops when one of the following happens: <ul> * <li> at least one positive and one negative value have been found -- success!</li> * <li> both endpoints have reached their respective limits -- NoBracketingException </li> - * <li> {@code maximumIterations} iterations elapse -- NoBracketingException </li></ul></p> + * <li> {@code maximumIterations} iterations elapse -- NoBracketingException </li></ul> * <p> * If different signs are found at first iteration ({@code k=1}), then the returned * interval will be \( [a, b] = [l_1, u_1] \). If different signs are found at a later - * iteration ({code k>1}, then the returned interval will be either + * iteration {@code k>1}, then the returned interval will be either * \( [a, b] = [l_{k+1}, l_{k}] \) or \( [a, b] = [u_{k}, u_{k+1}] \). A root solver called * with these parameters will therefore start with the smallest bracketing interval known * at this step.