Class FieldHermiteInterpolator<T extends FieldElement<T>>
- Type Parameters:
T
- Type of the field elements.
The interpolation polynomials match all sample points, including both values and provided derivatives. There is one polynomial for each component of the values vector. All polynomials have the same degree. The degree of the polynomials depends on the number of points and number of derivatives at each point. For example the interpolation polynomials for n sample points without any derivatives all have degree n-1. The interpolation polynomials for n sample points with the two extreme points having value and first derivative and the remaining points having value only all have degree n+1. The interpolation polynomial for n sample points with value, first and second derivative for all points all have degree 3n-1.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
addSamplePoint
(T x, T[]... value) Add a sample point.T[][]
derivatives
(T x, int order) Interpolate value and first derivatives at a specified abscissa.T[]
Interpolate value at a specified abscissa.
-
Constructor Details
-
FieldHermiteInterpolator
public FieldHermiteInterpolator()Create an empty interpolator.
-
-
Method Details
-
addSamplePoint
@SafeVarargs public final void addSamplePoint(T x, T[]... value) throws MathIllegalArgumentException, MathRuntimeException, NullArgumentException Add a sample point.This method must be called once for each sample point. It is allowed to mix some calls with values only with calls with values and first derivatives.
The point abscissae for all calls must be different.
- Parameters:
x
- abscissa of the sample pointvalue
- value and derivatives of the sample point (if only one row is passed, it is the value, if two rows are passed the first one is the value and the second the derivative and so on)- Throws:
MathIllegalArgumentException
- if the abscissa difference between added point and a previous point is zero (i.e. the two points are at same abscissa)MathRuntimeException
- if the number of derivatives is larger than 20, which prevents computation of a factorialMathIllegalArgumentException
- if derivative structures are inconsistentNullArgumentException
- if x is null
-
value
Interpolate value at a specified abscissa.- Parameters:
x
- interpolation abscissa- Returns:
- interpolated value
- Throws:
MathIllegalArgumentException
- if sample is emptyNullArgumentException
- if x is null
-
derivatives
Interpolate value and first derivatives at a specified abscissa.- Parameters:
x
- interpolation abscissaorder
- maximum derivation order- Returns:
- interpolated value and derivatives (value in row 0, 1st derivative in row 1, ... nth derivative in row n)
- Throws:
MathIllegalArgumentException
- if sample is emptyNullArgumentException
- if x is null
-