Top Description Fields Constructors Methods
org.apache.commons.math3.analysis.interpolation

public Class FieldHermiteInterpolator<T extends FieldElement<T>>

extends Object
Class Inheritance
Type Parameters
<T>
Type of the field elements.
Imports
java.util.ArrayList, .List, org.apache.commons.math3.FieldElement, org.apache.commons.math3.exception.DimensionMismatchException, .MathArithmeticException, .NoDataException, .NullArgumentException, .ZeroException, org.apache.commons.math3.exception.util.LocalizedFormats, org.apache.commons.math3.util.MathArrays, .MathUtils

Polynomial interpolator using both sample values and sample derivatives.

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.

Since
3.2

Field Summary

Modifier and TypeField and Description
private final List<T>
abscissae

Sample abscissae.

private final List<T[]>
bottomDiagonal

Bottom diagonal of the divided differences array.

private final List<T[]>
topDiagonal

Top diagonal of the divided differences array.

Constructor Summary

AccessConstructor and Description
public
FieldHermiteInterpolator()

Create an empty interpolator.

Method Summary

Modifier and TypeMethod and Description
public void
addSamplePoint(final T
abscissa of the sample point
x
,
final T[]...
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)
value
)

Add a sample point.

public T[][]

Returns:

interpolated value and derivatives (value in row 0, 1st derivative in row 1, ... nth derivative in row n)
derivatives
(T
interpolation abscissa
x
,
int
maximum derivation order
order
)

Interpolate value and first derivatives at a specified abscissa.

public T[]

Returns:

interpolated value
value
(T
interpolation abscissa
x
)

Interpolate value at a specified abscissa.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

abscissaeback to summary
private final List<T> abscissae

Sample abscissae.

bottomDiagonalback to summary
private final List<T[]> bottomDiagonal

Bottom diagonal of the divided differences array.

topDiagonalback to summary
private final List<T[]> topDiagonal

Top diagonal of the divided differences array.

Constructor Detail

FieldHermiteInterpolatorback to summary
public FieldHermiteInterpolator()

Create an empty interpolator.

Method Detail

addSamplePointback to summary
public void addSamplePoint(final T x, final T[]... value) throws ZeroException, MathArithmeticException, DimensionMismatchException, 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:T

abscissa of the sample point

value:T[][]

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)

Exceptions
ZeroException:
if the abscissa difference between added point and a previous point is zero (i.e. the two points are at same abscissa)
MathArithmeticException:
if the number of derivatives is larger than 20, which prevents computation of a factorial
DimensionMismatchException:
if derivative structures are inconsistent
NullArgumentException:
if x is null
derivativesback to summary
public T[][] derivatives(T x, int order) throws NoDataException, NullArgumentException

Interpolate value and first derivatives at a specified abscissa.

Parameters
x:T

interpolation abscissa

order:int

maximum derivation order

Returns:T[][]

interpolated value and derivatives (value in row 0, 1st derivative in row 1, ... nth derivative in row n)

Exceptions
NoDataException:
if sample is empty
NullArgumentException:
if x is null
valueback to summary
public T[] value(T x) throws NoDataException, NullArgumentException

Interpolate value at a specified abscissa.

Parameters
x:T

interpolation abscissa

Returns:T[]

interpolated value

Exceptions
NoDataException:
if sample is empty
NullArgumentException:
if x is null