Class PolynomialsUtils


  • public final class PolynomialsUtils
    extends Object
    A collection of static methods that operate on or return polynomials.
    Since:
    2.0
    • Method Detail

      • createChebyshevPolynomial

        public static PolynomialFunction createChebyshevPolynomial​(int degree)
        Create a Chebyshev polynomial of the first kind.

        Chebyshev polynomials of the first kind are orthogonal polynomials. They can be defined by the following recurrence relations:

        T0(x)=1T1(x)=xTk+1(x)=2xTk(x)Tk1(x)

        Parameters:
        degree - degree of the polynomial
        Returns:
        Chebyshev polynomial of specified degree
      • createHermitePolynomial

        public static PolynomialFunction createHermitePolynomial​(int degree)
        Create a Hermite polynomial.

        Hermite polynomials are orthogonal polynomials. They can be defined by the following recurrence relations:

        H0(x)=1H1(x)=2xHk+1(x)=2xHk(X)2kHk1(x)

        Parameters:
        degree - degree of the polynomial
        Returns:
        Hermite polynomial of specified degree
      • createLaguerrePolynomial

        public static PolynomialFunction createLaguerrePolynomial​(int degree)
        Create a Laguerre polynomial.

        Laguerre polynomials are orthogonal polynomials. They can be defined by the following recurrence relations:

        L0(x)=1L1(x)=1x(k+1)Lk+1(x)=(2k+1x)Lk(x)kLk1(x)

        Parameters:
        degree - degree of the polynomial
        Returns:
        Laguerre polynomial of specified degree
      • createLegendrePolynomial

        public static PolynomialFunction createLegendrePolynomial​(int degree)
        Create a Legendre polynomial.

        Legendre polynomials are orthogonal polynomials. They can be defined by the following recurrence relations:

        P0(x)=1P1(x)=x(k+1)Pk+1(x)=(2k+1)xPk(x)kPk1(x)

        Parameters:
        degree - degree of the polynomial
        Returns:
        Legendre polynomial of specified degree
      • createJacobiPolynomial

        public static PolynomialFunction createJacobiPolynomial​(int degree,
                                                                int v,
                                                                int w)
        Create a Jacobi polynomial.

        Jacobi polynomials are orthogonal polynomials. They can be defined by the following recurrence relations:

        P0vw(x)=1P1vw(x)=02k(k+v+w)(2k+v+w2)Pkvw(x)=(2k+v+w1)[(2k+v+w)(2k+v+w2)x+v2w2]Pk1vw(x)2(k+v1)(k+w1)(2k+v+w)Pk2vw(x)

        Parameters:
        degree - degree of the polynomial
        v - first exponent
        w - second exponent
        Returns:
        Jacobi polynomial of specified degree
      • shift

        public static double[] shift​(double[] coefficients,
                                     double shift)
        Compute the coefficients of the polynomial Ps(x) whose values at point x will be the same as the those from the original polynomial P(x) when computed at x + shift.

        More precisely, let Δ= shift and let Ps(x)=P(x+Δ). The returned array consists of the coefficients of Ps. So if a0,...,an1 are the coefficients of P, then the returned array b0,...,bn1 satisfies the identity i=0n1bixi=i=0n1ai(x+Δ)i for all x.

        Parameters:
        coefficients - Coefficients of the original polynomial.
        shift - Shift value.
        Returns:
        the coefficients bi of the shifted polynomial.