T
- the type of the field elementspublic class FieldPolynomialSplineFunction<T extends CalculusFieldElement<T>> extends Object implements CalculusFieldUnivariateFunction<T>
A polynomial spline function consists of a set of
interpolating polynomials and an ascending array of domain
knot points, determining the intervals over which the spline function
is defined by the constituent polynomials. The polynomials are assumed to
have been computed to match the values of another function at the knot
points. The value consistency constraints are not currently enforced by
PolynomialSplineFunction
itself, but are assumed to hold among
the polynomials and knot points passed to the constructor.
N.B.: The polynomials in the polynomials
property must be
centered on the knot points to compute the spline function values.
See below.
The domain of the polynomial spline function is
[smallest knot, largest knot]
. Attempts to evaluate the
function at values outside of this range generate IllegalArgumentExceptions.
The value of the polynomial spline function for an argument x
is computed as follows:
x
belongs. If x
is less than the smallest knot point or greater
than the largest one, an IllegalArgumentException
is thrown.j
be the index of the largest knot point that is less
than or equal to x
. The value returned is
polynomials[j](x - knot[j])
Constructor and Description |
---|
FieldPolynomialSplineFunction(T[] knots,
FieldPolynomialFunction<T>[] polynomials)
Construct a polynomial spline function with the given segment delimiters
and interpolating polynomials.
|
Modifier and Type | Method and Description |
---|---|
Field<T> |
getField()
Get the
Field to which the instance belongs. |
T[] |
getKnots()
Get an array copy of the knot points.
|
int |
getN()
Get the number of spline segments.
|
FieldPolynomialFunction<T>[] |
getPolynomials()
Get a copy of the interpolating polynomials array.
|
boolean |
isValidPoint(T x)
Indicates whether a point is within the interpolation range.
|
FieldPolynomialSplineFunction<T> |
polynomialSplineDerivative()
Get the derivative of the polynomial spline function.
|
T |
value(double v)
Compute the value for the function.
|
T |
value(T v)
Compute the value for the function.
|
public FieldPolynomialSplineFunction(T[] knots, FieldPolynomialFunction<T>[] polynomials) throws MathIllegalArgumentException, NullArgumentException
knots
- Spline segment interval delimiters.polynomials
- Polynomial functions that make up the spline.NullArgumentException
- if either of the input arrays is null
.MathIllegalArgumentException
- if knots has length less than 2.MathIllegalArgumentException
- if polynomials.length != knots.length - 1
.MathIllegalArgumentException
- if the knots
array is not strictly increasing.public Field<T> getField()
Field
to which the instance belongs.Field
to which the instance belongspublic T value(double v)
FieldPolynomialSplineFunction
for details on the algorithm for
computing the value of the function.v
- Point for which the function value should be computed.MathIllegalArgumentException
- if v
is outside of the domain of the
spline function (smaller than the smallest knot point or larger than the
largest knot point).public T value(T v)
FieldPolynomialSplineFunction
for details on the algorithm for
computing the value of the function.value
in interface CalculusFieldUnivariateFunction<T extends CalculusFieldElement<T>>
v
- Point for which the function value should be computed.MathIllegalArgumentException
- if v
is outside of the domain of the
spline function (smaller than the smallest knot point or larger than the
largest knot point).public int getN()
public FieldPolynomialFunction<T>[] getPolynomials()
public T[] getKnots()
public boolean isValidPoint(T x)
x
- Point.true
if x
is a valid point.public FieldPolynomialSplineFunction<T> polynomialSplineDerivative()
Copyright © 2016-2021 CS GROUP. All rights reserved.