public class PolynomialsUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
PolynomialsUtils.JacobiKey
Inner class for Jacobi polynomials keys.
|
private static interface |
PolynomialsUtils.RecurrenceCoefficientsGenerator
Interface for recurrence coefficients generation.
|
| Modifier and Type | Field and Description |
|---|---|
private static java.util.List<BigFraction> |
CHEBYSHEV_COEFFICIENTS
Coefficients for Chebyshev polynomials.
|
private static java.util.List<BigFraction> |
HERMITE_COEFFICIENTS
Coefficients for Hermite polynomials.
|
private static java.util.Map<PolynomialsUtils.JacobiKey,java.util.List<BigFraction>> |
JACOBI_COEFFICIENTS
Coefficients for Jacobi polynomials.
|
private static java.util.List<BigFraction> |
LAGUERRE_COEFFICIENTS
Coefficients for Laguerre polynomials.
|
private static java.util.List<BigFraction> |
LEGENDRE_COEFFICIENTS
Coefficients for Legendre polynomials.
|
| Modifier | Constructor and Description |
|---|---|
private |
PolynomialsUtils()
Private constructor, to prevent instantiation.
|
| Modifier and Type | Method and Description |
|---|---|
private static PolynomialFunction |
buildPolynomial(int degree,
java.util.List<BigFraction> coefficients,
PolynomialsUtils.RecurrenceCoefficientsGenerator generator)
Get the coefficients array for a given degree.
|
private static void |
computeUpToDegree(int degree,
int maxDegree,
PolynomialsUtils.RecurrenceCoefficientsGenerator generator,
java.util.List<BigFraction> coefficients)
Compute polynomial coefficients up to a given degree.
|
static PolynomialFunction |
createChebyshevPolynomial(int degree)
Create a Chebyshev polynomial of the first kind.
|
static PolynomialFunction |
createHermitePolynomial(int degree)
Create a Hermite polynomial.
|
static PolynomialFunction |
createJacobiPolynomial(int degree,
int v,
int w)
Create a Jacobi polynomial.
|
static PolynomialFunction |
createLaguerrePolynomial(int degree)
Create a Laguerre polynomial.
|
static PolynomialFunction |
createLegendrePolynomial(int degree)
Create a Legendre polynomial.
|
static double[] |
shift(double[] coefficients,
double shift)
Compute the coefficients of the polynomial \(P_s(x)\)
whose values at point
x will be the same as the those from the
original polynomial \(P(x)\) when computed at x + shift. |
private static final java.util.List<BigFraction> CHEBYSHEV_COEFFICIENTS
private static final java.util.List<BigFraction> HERMITE_COEFFICIENTS
private static final java.util.List<BigFraction> LAGUERRE_COEFFICIENTS
private static final java.util.List<BigFraction> LEGENDRE_COEFFICIENTS
private static final java.util.Map<PolynomialsUtils.JacobiKey,java.util.List<BigFraction>> JACOBI_COEFFICIENTS
private PolynomialsUtils()
public static PolynomialFunction createChebyshevPolynomial(int degree)
Chebyshev polynomials of the first kind are orthogonal polynomials. They can be defined by the following recurrence relations:
\( T_0(x) = 1 \\ T_1(x) = x \\ T_{k+1}(x) = 2x T_k(x) - T_{k-1}(x) \)
degree - degree of the polynomialpublic static PolynomialFunction createHermitePolynomial(int degree)
Hermite polynomials are orthogonal polynomials. They can be defined by the following recurrence relations:
\( H_0(x) = 1 \\ H_1(x) = 2x \\ H_{k+1}(x) = 2x H_k(X) - 2k H_{k-1}(x) \)
degree - degree of the polynomialpublic static PolynomialFunction createLaguerrePolynomial(int degree)
Laguerre polynomials are orthogonal polynomials. They can be defined by the following recurrence relations:
\( 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) \)
degree - degree of the polynomialpublic static PolynomialFunction createLegendrePolynomial(int degree)
Legendre polynomials are orthogonal polynomials. They can be defined by the following recurrence relations:
\( 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) \)
degree - degree of the polynomialpublic static PolynomialFunction createJacobiPolynomial(int degree, int v, int w)
Jacobi polynomials are orthogonal polynomials. They can be defined by the following recurrence relations:
\( 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) \)
degree - degree of the polynomialv - first exponentw - second exponentpublic static double[] shift(double[] coefficients,
double shift)
x will be the same as the those from the
original polynomial \(P(x)\) when computed at x + shift.
More precisely, let \(\Delta = \) 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\).
coefficients - Coefficients of the original polynomial.shift - Shift value.private static PolynomialFunction buildPolynomial(int degree, java.util.List<BigFraction> coefficients, PolynomialsUtils.RecurrenceCoefficientsGenerator generator)
degree - degree of the polynomialcoefficients - list where the computed coefficients are storedgenerator - recurrence coefficients generatorprivate static void computeUpToDegree(int degree,
int maxDegree,
PolynomialsUtils.RecurrenceCoefficientsGenerator generator,
java.util.List<BigFraction> coefficients)
degree - maximal degreemaxDegree - current maximal degreegenerator - recurrence coefficients generatorcoefficients - list where the computed coefficients should be appendedCopyright (c) 2003-2017 Apache Software Foundation