Interface BoundCurveInterpolator
-
- All Known Implementing Classes:
AbstractBoundCurveInterpolator
public interface BoundCurveInterpolatorA curve interpolator that has been bound to a specific curve.A bound interpolator is created from a
CurveInterpolator. The bind process takes the definition of the interpolator and combines it with the x-y values. This allows implementations to optimize interpolation calculations.A bound interpolator is typically linked to two extrapolators. If an attempt is made to interpolate an x-value outside the range defined by the first and last nodes, the appropriate extrapolator will be used.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BoundCurveInterpolatorbind(BoundCurveExtrapolator extrapolatorLeft, BoundCurveExtrapolator extrapolatorRight)Binds this interpolator to the specified extrapolators.doublefirstDerivative(double x)Computes the first derivative of the y-value for the specified x-value.doubleinterpolate(double x)Computes the y-value for the specified x-value by interpolation.DoubleArrayparameterSensitivity(double x)Computes the sensitivity of the y-value with respect to the curve parameters.
-
-
-
Method Detail
-
interpolate
double interpolate(double x)
Computes the y-value for the specified x-value by interpolation.- Parameters:
x- the x-value to find the y-value for- Returns:
- the value at the x-value
- Throws:
RuntimeException- if the y-value cannot be calculated
-
firstDerivative
double firstDerivative(double x)
Computes the first derivative of the y-value for the specified x-value.The first derivative is
dy/dx.- Parameters:
x- the x-value at which the derivative is taken- Returns:
- the first derivative
- Throws:
RuntimeException- if the derivative cannot be calculated
-
parameterSensitivity
DoubleArray parameterSensitivity(double x)
Computes the sensitivity of the y-value with respect to the curve parameters.This returns an array with one element for each parameter of the curve. The array contains the sensitivity of the y-value at the specified x-value to each parameter.
- Parameters:
x- the x-value at which the parameter sensitivity is computed- Returns:
- the sensitivity
- Throws:
RuntimeException- if the sensitivity cannot be calculated
-
bind
BoundCurveInterpolator bind(BoundCurveExtrapolator extrapolatorLeft, BoundCurveExtrapolator extrapolatorRight)
Binds this interpolator to the specified extrapolators.The bound interpolator provides methods to interpolate the y-value for a x-value. If an attempt is made to interpolate an x-value outside the range defined by the first and last nodes, the appropriate extrapolator will be used.
This method is intended to be called from within
CurveInterpolator.bind(DoubleArray, DoubleArray, CurveExtrapolator, CurveExtrapolator).- Parameters:
extrapolatorLeft- the extrapolator for x-values on the leftextrapolatorRight- the extrapolator for x-values on the right- Returns:
- the bound interpolator
-
-