Repository: commons-math Updated Branches: refs/heads/MATH_3_X 74c643b89 -> 9f51a3b8c
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/9f51a3b8 Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/9f51a3b8 Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/9f51a3b8 Branch: refs/heads/MATH_3_X Commit: 9f51a3b8cd7a2193db1c8b4c0fdaea63ab01cb12 Parents: 74c643b Author: Phil Steitz <phil.ste...@gmail.com> Authored: Mon Dec 28 07:40:55 2015 -0700 Committer: Phil Steitz <phil.ste...@gmail.com> Committed: Mon Dec 28 07:40:55 2015 -0700 ---------------------------------------------------------------------- .../interpolation/LoessInterpolator.java | 30 +++--- .../interpolation/SplineInterpolator.java | 12 +-- .../TricubicInterpolatingFunction.java | 10 +- .../TricubicSplineInterpolatingFunction.java | 10 +- .../TricubicSplineInterpolator.java | 2 +- .../polynomials/PolynomialFunction.java | 18 ++-- .../polynomials/PolynomialSplineFunction.java | 12 +-- .../analysis/polynomials/PolynomialsUtils.java | 100 +++++++++---------- 8 files changed, 96 insertions(+), 98 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/9f51a3b8/src/main/java/org/apache/commons/math3/analysis/interpolation/LoessInterpolator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/interpolation/LoessInterpolator.java b/src/main/java/org/apache/commons/math3/analysis/interpolation/LoessInterpolator.java index 7f0788d..1c24edc 100644 --- a/src/main/java/org/apache/commons/math3/analysis/interpolation/LoessInterpolator.java +++ b/src/main/java/org/apache/commons/math3/analysis/interpolation/LoessInterpolator.java @@ -20,28 +20,28 @@ import java.io.Serializable; import java.util.Arrays; import org.apache.commons.math3.analysis.polynomials.PolynomialSplineFunction; -import org.apache.commons.math3.exception.NotPositiveException; -import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.exception.DimensionMismatchException; import org.apache.commons.math3.exception.NoDataException; -import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.exception.NonMonotonicSequenceException; import org.apache.commons.math3.exception.NotFiniteNumberException; +import org.apache.commons.math3.exception.NotPositiveException; +import org.apache.commons.math3.exception.NumberIsTooSmallException; +import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.util.FastMath; -import org.apache.commons.math3.util.MathUtils; import org.apache.commons.math3.util.MathArrays; +import org.apache.commons.math3.util.MathUtils; /** * Implements the <a href="http://en.wikipedia.org/wiki/Local_regression"> * Local Regression Algorithm</a> (also Loess, Lowess) for interpolation of * real univariate functions. - * <p/> + * <p> * For reference, see - * <a href="http://www.math.tau.ac.il/~yekutiel/MA seminar/Cleveland 1979.pdf"> + * <a href="http://www.stat.washington.edu/courses/stat527/s13/readings/Cleveland_JASA_1979.pdf"> * William S. Cleveland - Robust Locally Weighted Regression and Smoothing * Scatterplots</a> - * <p/> + * </p> * This class implements both the loess method and serves as an interpolation * adapter to it, allowing one to build a spline on the obtained loess fit. * @@ -65,16 +65,16 @@ public class LoessInterpolator * a particular point, this fraction of source points closest * to the current point is taken into account for computing * a least-squares regression. - * <p/> - * A sensible value is usually 0.25 to 0.5. + * <p> + * A sensible value is usually 0.25 to 0.5.</p> */ private final double bandwidth; /** * The number of robustness iterations parameter: this many * robustness iterations are done. - * <p/> + * <p> * A sensible value is usually 0 (just the initial fit without any - * robustness iterations) to 4. + * robustness iterations) to 4.</p> */ private final int robustnessIters; /** @@ -109,10 +109,10 @@ public class LoessInterpolator * @param bandwidth when computing the loess fit at * a particular point, this fraction of source points closest * to the current point is taken into account for computing - * a least-squares regression.</br> + * a least-squares regression. * A sensible value is usually 0.25 to 0.5, the default value is * {@link #DEFAULT_BANDWIDTH}. - * @param robustnessIters This many robustness iterations are done.</br> + * @param robustnessIters This many robustness iterations are done. * A sensible value is usually 0 (just the initial fit without any * robustness iterations) to 4, the default value is * {@link #DEFAULT_ROBUSTNESS_ITERS}. @@ -130,10 +130,10 @@ public class LoessInterpolator * @param bandwidth when computing the loess fit at * a particular point, this fraction of source points closest * to the current point is taken into account for computing - * a least-squares regression.</br> + * a least-squares regression. * A sensible value is usually 0.25 to 0.5, the default value is * {@link #DEFAULT_BANDWIDTH}. - * @param robustnessIters This many robustness iterations are done.</br> + * @param robustnessIters This many robustness iterations are done. * A sensible value is usually 0 (just the initial fit without any * robustness iterations) to 4, the default value is * {@link #DEFAULT_ROBUSTNESS_ITERS}. http://git-wip-us.apache.org/repos/asf/commons-math/blob/9f51a3b8/src/main/java/org/apache/commons/math3/analysis/interpolation/SplineInterpolator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/interpolation/SplineInterpolator.java b/src/main/java/org/apache/commons/math3/analysis/interpolation/SplineInterpolator.java index a9ca862..f37e1b1 100644 --- a/src/main/java/org/apache/commons/math3/analysis/interpolation/SplineInterpolator.java +++ b/src/main/java/org/apache/commons/math3/analysis/interpolation/SplineInterpolator.java @@ -16,12 +16,12 @@ */ package org.apache.commons.math3.analysis.interpolation; -import org.apache.commons.math3.exception.DimensionMismatchException; -import org.apache.commons.math3.exception.util.LocalizedFormats; -import org.apache.commons.math3.exception.NumberIsTooSmallException; -import org.apache.commons.math3.exception.NonMonotonicSequenceException; import org.apache.commons.math3.analysis.polynomials.PolynomialFunction; import org.apache.commons.math3.analysis.polynomials.PolynomialSplineFunction; +import org.apache.commons.math3.exception.DimensionMismatchException; +import org.apache.commons.math3.exception.NonMonotonicSequenceException; +import org.apache.commons.math3.exception.NumberIsTooSmallException; +import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.util.MathArrays; /** @@ -29,7 +29,7 @@ import org.apache.commons.math3.util.MathArrays; * <p> * 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."</p> + * {@code x[0] < x[i] ... < x[n].} The x values are referred to as "knot points." * <p> * 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 @@ -42,7 +42,7 @@ import org.apache.commons.math3.util.MathArrays; * corresponding y value.</li> * <li>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).</li> - * </ol></p> + * </ol> * <p> * The cubic spline interpolation algorithm implemented is as described in R.L. Burden, J.D. Faires, * <u>Numerical Analysis</u>, 4th Ed., 1989, PWS-Kent, ISBN 0-53491-585-X, pp 126-131. http://git-wip-us.apache.org/repos/asf/commons-math/blob/9f51a3b8/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicInterpolatingFunction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicInterpolatingFunction.java b/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicInterpolatingFunction.java index 11b66d6..27e9a65 100644 --- a/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicInterpolatingFunction.java +++ b/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicInterpolatingFunction.java @@ -19,8 +19,8 @@ package org.apache.commons.math3.analysis.interpolation; import org.apache.commons.math3.analysis.TrivariateFunction; import org.apache.commons.math3.exception.DimensionMismatchException; import org.apache.commons.math3.exception.NoDataException; -import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.exception.NonMonotonicSequenceException; +import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.util.MathArrays; /** @@ -28,9 +28,9 @@ import org.apache.commons.math3.util.MathArrays; * <a href="http://en.wikipedia.org/wiki/Tricubic_interpolation"> * tricubic spline interpolation</a>, as proposed in * <blockquote> - * Tricubic interpolation in three dimensions<br> - * F. Lekien and J. Marsden<br> - * <em>Int. J. Numer. Meth. Eng</em> 2005; <b>63</b>:455-471<br> + * Tricubic interpolation in three dimensions, + * F. Lekien and J. Marsden, + * <em>Int. J. Numer. Meth. Eng</em> 2005; <b>63</b>:455-471 * </blockquote> * * @since 3.4. @@ -114,7 +114,7 @@ public class TricubicInterpolatingFunction private final double[] yval; /** Samples z-coordinates */ private final double[] zval; - /** Set of cubic splines pacthing the whole data grid */ + /** Set of cubic splines patching the whole data grid */ private final TricubicFunction[][][] splines; /** http://git-wip-us.apache.org/repos/asf/commons-math/blob/9f51a3b8/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicSplineInterpolatingFunction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicSplineInterpolatingFunction.java b/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicSplineInterpolatingFunction.java index 755d771..96aebd3 100644 --- a/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicSplineInterpolatingFunction.java +++ b/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicSplineInterpolatingFunction.java @@ -19,19 +19,19 @@ package org.apache.commons.math3.analysis.interpolation; import org.apache.commons.math3.analysis.TrivariateFunction; import org.apache.commons.math3.exception.DimensionMismatchException; import org.apache.commons.math3.exception.NoDataException; -import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.exception.NonMonotonicSequenceException; +import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.util.MathArrays; /** * Function that implements the * <a href="http://en.wikipedia.org/wiki/Tricubic_interpolation"> * tricubic spline interpolation</a>, as proposed in - * <quote> - * Tricubic interpolation in three dimensions<br/> - * F. Lekien and J. Marsden<br/> + * <blockquote> + * Tricubic interpolation in three dimensions, + * F. Lekien and J. Marsden, * <em>Int. J. Numer. Meth. Engng</em> 2005; <b>63</b>:455-471 - * </quote> + * </blockquote> * * @since 2.2 * @deprecated To be removed in 4.0 (see MATH-1166). http://git-wip-us.apache.org/repos/asf/commons-math/blob/9f51a3b8/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicSplineInterpolator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicSplineInterpolator.java b/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicSplineInterpolator.java index da19986..7f43e6f 100644 --- a/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicSplineInterpolator.java +++ b/src/main/java/org/apache/commons/math3/analysis/interpolation/TricubicSplineInterpolator.java @@ -177,7 +177,7 @@ public class TricubicSplineInterpolator /** * Compute the next index of an array, clipping if necessary. - * It is assumed (but not checked) that {@code i} is larger than or equal to 0}. + * It is assumed (but not checked) that {@code i} is larger than or equal to 0. * * @param i Index * @param max Upper limit of the array http://git-wip-us.apache.org/repos/asf/commons-math/blob/9f51a3b8/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialFunction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialFunction.java b/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialFunction.java index d424a88..69be04a 100644 --- a/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialFunction.java +++ b/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialFunction.java @@ -19,14 +19,14 @@ package org.apache.commons.math3.analysis.polynomials; import java.io.Serializable; import java.util.Arrays; -import org.apache.commons.math3.exception.util.LocalizedFormats; -import org.apache.commons.math3.exception.NoDataException; -import org.apache.commons.math3.exception.NullArgumentException; import org.apache.commons.math3.analysis.DifferentiableUnivariateFunction; -import org.apache.commons.math3.analysis.UnivariateFunction; import org.apache.commons.math3.analysis.ParametricUnivariateFunction; +import org.apache.commons.math3.analysis.UnivariateFunction; import org.apache.commons.math3.analysis.differentiation.DerivativeStructure; import org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction; +import org.apache.commons.math3.exception.NoDataException; +import org.apache.commons.math3.exception.NullArgumentException; +import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.util.FastMath; import org.apache.commons.math3.util.MathUtils; @@ -81,8 +81,8 @@ public class PolynomialFunction implements UnivariateDifferentiableFunction, Dif /** * Compute the value of the function for the given argument. * <p> - * The value returned is <br/> - * <code>coefficients[n] * x^n + ... + coefficients[1] * x + coefficients[0]</code> + * The value returned is </p><p> + * {@code coefficients[n] * x^n + ... + coefficients[1] * x + coefficients[0]} * </p> * * @param x Argument for which the function value should be computed. @@ -188,7 +188,7 @@ public class PolynomialFunction implements UnivariateDifferentiableFunction, Dif * Subtract a polynomial from the instance. * * @param p Polynomial to subtract. - * @return a new polynomial which is the difference the instance minus {@code p}. + * @return a new polynomial which is the instance minus {@code p}. */ public PolynomialFunction subtract(final PolynomialFunction p) { // identify the lowest degree polynomial @@ -215,7 +215,7 @@ public class PolynomialFunction implements UnivariateDifferentiableFunction, Dif /** * Negate the instance. * - * @return a new polynomial. + * @return a new polynomial with all coefficients negated */ public PolynomialFunction negate() { double[] newCoefficients = new double[coefficients.length]; @@ -229,7 +229,7 @@ public class PolynomialFunction implements UnivariateDifferentiableFunction, Dif * Multiply the instance by a polynomial. * * @param p Polynomial to multiply by. - * @return a new polynomial. + * @return a new polynomial equal to this times {@code p} */ public PolynomialFunction multiply(final PolynomialFunction p) { double[] newCoefficients = new double[coefficients.length + p.coefficients.length - 1]; http://git-wip-us.apache.org/repos/asf/commons-math/blob/9f51a3b8/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialSplineFunction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialSplineFunction.java b/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialSplineFunction.java index 7b402e5..ed5a4f9 100644 --- a/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialSplineFunction.java +++ b/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialSplineFunction.java @@ -18,17 +18,17 @@ package org.apache.commons.math3.analysis.polynomials; import java.util.Arrays; -import org.apache.commons.math3.util.MathArrays; import org.apache.commons.math3.analysis.DifferentiableUnivariateFunction; import org.apache.commons.math3.analysis.UnivariateFunction; import org.apache.commons.math3.analysis.differentiation.DerivativeStructure; import org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction; -import org.apache.commons.math3.exception.NonMonotonicSequenceException; -import org.apache.commons.math3.exception.OutOfRangeException; -import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.exception.DimensionMismatchException; +import org.apache.commons.math3.exception.NonMonotonicSequenceException; import org.apache.commons.math3.exception.NullArgumentException; +import org.apache.commons.math3.exception.NumberIsTooSmallException; +import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.exception.util.LocalizedFormats; +import org.apache.commons.math3.util.MathArrays; /** * Represents a polynomial spline function. @@ -59,8 +59,8 @@ import org.apache.commons.math3.exception.util.LocalizedFormats; * than the largest one, an <code>IllegalArgumentException</code> * is thrown.</li> * <li> Let <code>j</code> be the index of the largest knot point that is less - * than or equal to <code>x</code>. The value returned is <br> - * <code>polynomials[j](x - knot[j])</code></li></ol></p> + * than or equal to <code>x</code>. The value returned is + * {@code polynomials[j](x - knot[j])}</li></ol> * */ public class PolynomialSplineFunction implements UnivariateDifferentiableFunction, DifferentiableUnivariateFunction { http://git-wip-us.apache.org/repos/asf/commons-math/blob/9f51a3b8/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialsUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialsUtils.java b/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialsUtils.java index 2efa07d..d606433 100644 --- a/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialsUtils.java +++ b/src/main/java/org/apache/commons/math3/analysis/polynomials/PolynomialsUtils.java @@ -90,14 +90,15 @@ public class PolynomialsUtils { /** * Create a Chebyshev polynomial of the first kind. - * <p><a href="http://mathworld.wolfram.com/ChebyshevPolynomialoftheFirstKind.html">Chebyshev + * <p><a href="https://en.wikipedia.org/wiki/Chebyshev_polynomials">Chebyshev * polynomials of the first kind</a> are orthogonal polynomials. - * They can be defined by the following recurrence relations: - * <pre> - * T<sub>0</sub>(X) = 1 - * T<sub>1</sub>(X) = X - * T<sub>k+1</sub>(X) = 2X T<sub>k</sub>(X) - T<sub>k-1</sub>(X) - * </pre></p> + * They can be defined by the following recurrence relations:</p><p> + * \( + * T_0(x) = 1 \\ + * T_1(x) = x \\ + * T_{k+1}(x) = 2x T_k(x) - T_{k-1}(x) + * \) + * </p> * @param degree degree of the polynomial * @return Chebyshev polynomial of specified degree */ @@ -118,12 +119,13 @@ public class PolynomialsUtils { * Create a Hermite polynomial. * <p><a href="http://mathworld.wolfram.com/HermitePolynomial.html">Hermite * polynomials</a> are orthogonal polynomials. - * They can be defined by the following recurrence relations: - * <pre> - * H<sub>0</sub>(X) = 1 - * H<sub>1</sub>(X) = 2X - * H<sub>k+1</sub>(X) = 2X H<sub>k</sub>(X) - 2k H<sub>k-1</sub>(X) - * </pre></p> + * They can be defined by the following recurrence relations:</p><p> + * \( + * H_0(x) = 1 \\ + * H_1(x) = 2x \\ + * H_{k+1}(x) = 2x H_k(X) - 2k H_{k-1}(x) + * \) + * </p> * @param degree degree of the polynomial * @return Hermite polynomial of specified degree @@ -146,12 +148,13 @@ public class PolynomialsUtils { * Create a Laguerre polynomial. * <p><a href="http://mathworld.wolfram.com/LaguerrePolynomial.html">Laguerre * polynomials</a> are orthogonal polynomials. - * They can be defined by the following recurrence relations: - * <pre> - * L<sub>0</sub>(X) = 1 - * L<sub>1</sub>(X) = 1 - X - * (k+1) L<sub>k+1</sub>(X) = (2k + 1 - X) L<sub>k</sub>(X) - k L<sub>k-1</sub>(X) - * </pre></p> + * They can be defined by the following recurrence relations:</p><p> + * \( + * L_0(x) = 1 \\ + * L_1(x) = 1 - x \\ + * (k+1) L_{k+1}(x) = (2k + 1 - x) L_k(x) - k L_{k-1}(x) + * \) + * </p> * @param degree degree of the polynomial * @return Laguerre polynomial of specified degree */ @@ -174,12 +177,13 @@ public class PolynomialsUtils { * Create a Legendre polynomial. * <p><a href="http://mathworld.wolfram.com/LegendrePolynomial.html">Legendre * polynomials</a> are orthogonal polynomials. - * They can be defined by the following recurrence relations: - * <pre> - * P<sub>0</sub>(X) = 1 - * P<sub>1</sub>(X) = X - * (k+1) P<sub>k+1</sub>(X) = (2k+1) X P<sub>k</sub>(X) - k P<sub>k-1</sub>(X) - * </pre></p> + * They can be defined by the following recurrence relations:</p><p> + * \( + * P_0(x) = 1 \\ + * P_1(x) = x \\ + * (k+1) P_{k+1}(x) = (2k+1) x P_k(x) - k P_{k-1}(x) + * \) + * </p> * @param degree degree of the polynomial * @return Legendre polynomial of specified degree */ @@ -202,14 +206,15 @@ public class PolynomialsUtils { * Create a Jacobi polynomial. * <p><a href="http://mathworld.wolfram.com/JacobiPolynomial.html">Jacobi * polynomials</a> are orthogonal polynomials. - * They can be defined by the following recurrence relations: - * <pre> - * P<sub>0</sub><sup>vw</sup>(X) = 1 - * P<sub>-1</sub><sup>vw</sup>(X) = 0 - * 2k(k + v + w)(2k + v + w - 2) P<sub>k</sub><sup>vw</sup>(X) = - * (2k + v + w - 1)[(2k + v + w)(2k + v + w - 2) X + v<sup>2</sup> - w<sup>2</sup>] P<sub>k-1</sub><sup>vw</sup>(X) - * - 2(k + v - 1)(k + w - 1)(2k + v + w) P<sub>k-2</sub><sup>vw</sup>(X) - * </pre></p> + * They can be defined by the following recurrence relations:</p><p> + * \( + * P_0^{vw}(x) = 1 \\ + * P_{-1}^{vw}(x) = 0 \\ + * 2k(k + v + w)(2k + v + w - 2) P_k^{vw}(x) = \\ + * (2k + v + w - 1)[(2k + v + w)(2k + v + w - 2) x + v^2 - w^2] P_{k-1}^{vw}(x) \\ + * - 2(k + v - 1)(k + w - 1)(2k + v + w) P_{k-2}^{vw}(x) + * \) + * </p> * @param degree degree of the polynomial * @param v first exponent * @param w second exponent @@ -301,27 +306,20 @@ public class PolynomialsUtils { } /** - * Compute the coefficients of the polynomial <code>P<sub>s</sub>(x)</code> + * Compute the coefficients of the polynomial \(P_s(x)\) * whose values at point {@code x} will be the same as the those from the - * original polynomial <code>P(x)</code> when computed at {@code x + shift}. - * Thus, if <code>P(x) = Σ<sub>i</sub> a<sub>i</sub> x<sup>i</sup></code>, - * then - * <pre> - * <table> - * <tr> - * <td><code>P<sub>s</sub>(x)</td> - * <td>= Σ<sub>i</sub> b<sub>i</sub> x<sup>i</sup></code></td> - * </tr> - * <tr> - * <td></td> - * <td>= Σ<sub>i</sub> a<sub>i</sub> (x + shift)<sup>i</sup></code></td> - * </tr> - * </table> - * </pre> + * original polynomial \(P(x)\) when computed at {@code x + shift}. + * <p> + * More precisely, let \(\Delta = \) {@code shift} and let + * \(P_s(x) = P(x + \Delta)\). The returned array + * consists of the coefficients of \(P_s\). So if \(a_0, ..., a_{n-1}\) + * are the coefficients of \(P\), then the returned array + * \(b_0, ..., b_{n-1}\) satisfies the identity + * \(\sum_{i=0}^{n-1} b_i x^i = \sum_{i=0}^{n-1} a_i (x + \Delta)^i\) for all \(x\). * * @param coefficients Coefficients of the original polynomial. * @param shift Shift value. - * @return the coefficients <code>b<sub>i</sub></code> of the shifted + * @return the coefficients \(b_i\) of the shifted * polynomial. */ public static double[] shift(final double[] coefficients, @@ -443,7 +441,7 @@ public class PolynomialsUtils { * Generate recurrence coefficients. * @param k highest degree of the polynomials used in the recurrence * @return an array of three coefficients such that - * P<sub>k+1</sub>(X) = (a[0] + a[1] X) P<sub>k</sub>(X) - a[2] P<sub>k-1</sub>(X) + * \( P_{k+1}(x) = (a[0] + a[1] x) P_k(x) - a[2] P_{k-1}(x) \) */ BigFraction[] generate(int k); }