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
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 . |
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:
T0(X) = 1 T1(X) = X Tk+1(X) = 2X Tk(X) - Tk-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:
H0(X) = 1 H1(X) = 2X Hk+1(X) = 2X Hk(X) - 2k Hk-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:
L0(X) = 1 L1(X) = 1 - X (k+1) Lk+1(X) = (2k + 1 - X) Lk(X) - k Lk-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:
P0(X) = 1 P1(X) = X (k+1) Pk+1(X) = (2k+1) X Pk(X) - k Pk-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:
P0vw(X) = 1 P-1vw(X) = 0 2k(k + v + w)(2k + v + w - 2) Pkvw(X) = (2k + v + w - 1)[(2k + v + w)(2k + v + w - 2) X + v2 - w2] Pk-1vw(X) - 2(k + v - 1)(k + w - 1)(2k + v + w) Pk-2vw(X)
degree
- degree of the polynomialv
- first exponentw
- second exponentpublic static double[] shift(double[] coefficients, double shift)
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
.
Thus, if P(x) = Σi ai xi
,
then
Ps(x) |
= Σi bi xi |
= Σi ai (x + shift)i |
coefficients
- Coefficients of the original polynomial.shift
- Shift value.bi
of the shifted
polynomial.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-2014 Apache Software Foundation