diff --git a/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java b/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java index 8de55324b..77dc7b19f 100644 --- a/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java +++ b/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java @@ -29,7 +29,7 @@ import org.apache.commons.math4.util.MathArrays; *
* The {@link #interpolate(double[], double[])} method returns a {@link PolynomialSplineFunction} * consisting of n cubic polynomials, defined over the subintervals determined by the x values, - * @code{x[0] < x[i] ... < x[n].} The x values are referred to as "knot points."
+ * {@code 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 diff --git a/src/main/java/org/apache/commons/math4/analysis/solvers/BracketingNthOrderBrentSolver.java b/src/main/java/org/apache/commons/math4/analysis/solvers/BracketingNthOrderBrentSolver.java index 65efde3fb..e519f028b 100644 --- a/src/main/java/org/apache/commons/math4/analysis/solvers/BracketingNthOrderBrentSolver.java +++ b/src/main/java/org/apache/commons/math4/analysis/solvers/BracketingNthOrderBrentSolver.java @@ -36,9 +36,8 @@ import org.apache.commons.math4.util.Precision; * to user specified {@link AllowedSolution}, *
+ * The given interval must bracket the root.
* */ public class BracketingNthOrderBrentSolver diff --git a/src/main/java/org/apache/commons/math4/analysis/solvers/BrentSolver.java b/src/main/java/org/apache/commons/math4/analysis/solvers/BrentSolver.java index 0d2afee2d..3b9f322e6 100644 --- a/src/main/java/org/apache/commons/math4/analysis/solvers/BrentSolver.java +++ b/src/main/java/org/apache/commons/math4/analysis/solvers/BrentSolver.java @@ -31,15 +31,14 @@ import org.apache.commons.math4.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. + *The given interval must bracket the root.
** The reference implementation is given in chapter 4 of *
- * Algorithms for Minimization Without Derivatives- * * * @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 *
- * Richard P. Brent
- * Dover, 2002
+ * Algorithms for Minimization Without Derivatives, + * Richard P. Brent, + * Dover, 2002 *
- * Algorithms for Minimization Without Derivatives - ** diff --git a/src/main/java/org/apache/commons/math4/analysis/solvers/FieldBracketingNthOrderBrentSolver.java b/src/main/java/org/apache/commons/math4/analysis/solvers/FieldBracketingNthOrderBrentSolver.java index 5a65ee2d7..71a79c4a2 100644 --- a/src/main/java/org/apache/commons/math4/analysis/solvers/FieldBracketingNthOrderBrentSolver.java +++ b/src/main/java/org/apache/commons/math4/analysis/solvers/FieldBracketingNthOrderBrentSolver.java @@ -36,12 +36,11 @@ import org.apache.commons.math4.util.Precision; * The changes with respect to the original Brent algorithm are: *Richard P. Brent + * Algorithms for Minimization Without Derivatives, + *Richard P. Brent , * Dover 0-486-41998-3 *
+ * The given interval must bracket the root.
* * @param- * A First Course in Numerical Analysis* 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,
- * ISBN 048641454X, chapter 8.
+ * A First Course in Numerical Analysis, + * ISBN 048641454X, chapter 8. *
p(x) = x3 + 1,
+ * For example, p(x) = x3 + 1,
* with {@code min = -2}, {@code max = 2}, {@code initial = 0}.
* When it occurs, this code calls
* {@link LaguerreSolver.ComplexSolver#solveAll(Complex[],Complex)}
@@ -173,8 +173,8 @@ public class LaguerreSolver extends AbstractPolynomialSolver {
/**
* Find all complex roots for the polynomial with the given
* coefficients, starting from the given initial value.
- * + * Note: This method is not part of the API of {@link BaseUnivariateSolver}.
* * @param coefficients Polynomial coefficients. * @param initial Start value. @@ -203,8 +203,8 @@ public class LaguerreSolver extends AbstractPolynomialSolver { /** * Find a complex root for the polynomial with the given coefficients, * starting from the given initial value. - *+ * Note: This method is not part of the API of {@link BaseUnivariateSolver}.
* * @param coefficients Polynomial coefficients. * @param initial Start value. diff --git a/src/main/java/org/apache/commons/math4/analysis/solvers/MullerSolver.java b/src/main/java/org/apache/commons/math4/analysis/solvers/MullerSolver.java index 9a864067a..b71439966 100644 --- a/src/main/java/org/apache/commons/math4/analysis/solvers/MullerSolver.java +++ b/src/main/java/org/apache/commons/math4/analysis/solvers/MullerSolver.java @@ -30,7 +30,7 @@ import org.apache.commons.math4.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. + * operations.* 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, diff --git a/src/main/java/org/apache/commons/math4/analysis/solvers/MullerSolver2.java b/src/main/java/org/apache/commons/math4/analysis/solvers/MullerSolver2.java index 1cbfdfdfe..e5d8b9b53 100644 --- a/src/main/java/org/apache/commons/math4/analysis/solvers/MullerSolver2.java +++ b/src/main/java/org/apache/commons/math4/analysis/solvers/MullerSolver2.java @@ -30,15 +30,15 @@ import org.apache.commons.math4.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.
+ * operations.* 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.
*- * 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.
** The formulas here do not use divided differences directly.
diff --git a/src/main/java/org/apache/commons/math4/analysis/solvers/UnivariateSolverUtils.java b/src/main/java/org/apache/commons/math4/analysis/solvers/UnivariateSolverUtils.java index bfdf07cb5..2a588807d 100644 --- a/src/main/java/org/apache/commons/math4/analysis/solvers/UnivariateSolverUtils.java +++ b/src/main/java/org/apache/commons/math4/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}. - * Note: this method can take - *Integer.MAX_VALUE
iterations to throw a
- * ConvergenceException.
Unless you are confident that there
- * is a root between lowerBound
and upperBound
- * near initial,
it is better to use
- * {@link #bracket(UnivariateFunction, double, double, double, double,
- * double, int) bracket(function, initial, lowerBound, upperBound, q, r, maximumIterations)},
+ * + * Note: 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.
* * @param function Function. @@ -244,11 +246,11 @@ public class UnivariateSolverUtils { * The algorithm stops when one of the following happens:* 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.