ILNumerics Ultimate VS

Interpolationspline Method (InArraySingle, NullableSingle, InArraySingle, InArraySingle, InArraySingle, InArraySingle)

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
One dimensional cubic spline interpolation.

[ILNumerics Interpolation Toolbox]

Namespace:  ILNumerics.Toolboxes
Assembly:  ILNumerics.Toolboxes.Interpolation (in ILNumerics.Toolboxes.Interpolation.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax

public static RetArray<float> spline(
	InArray<float> V,
	Nullable<float> outOfRangeValue,
	InArray<float> X = null,
	InArray<float> Xn = null,
	InArray<float> lbDeriv = null,
	InArray<float> ubDeriv = null
)

Parameters

V
Type: ILNumericsInArraySingle
Sampled values as columns of a matrix or n-dimensional array. Size [n x m], n: number of points per sample set (column length), m: number of measurements.
outOfRangeValue
Type: SystemNullableSingle
Scalar value to get assigned to all new query points laying outside of the specified domain of V. Null: extrapolate.
X (Optional)
Type: ILNumericsInArraySingle
[Optional] Vector with positions for values in V. Default: (null) assumes spacing of 1.0 between row elements in V.
Xn (Optional)
Type: ILNumericsInArraySingle
[Optional] Vector of length k with new query points to interpolate. Default: (null) create new points by subdividing the ranges from X once.
lbDeriv (Optional)
Type: ILNumericsInArraySingle
[Optional] Vector of length m with first derivative(s) at the lower end of each sample set. Default (null): not-a-knot spline.
ubDeriv (Optional)
Type: ILNumericsInArraySingle
[Optional] Vector of length m with first derivative(s) at the upper end of each sample set. Default (null): not-a-knot spline.

Return Value

Type: RetArraySingle
Array of the same size as V, having the working dimension replaced with Xn.Length interpolated values.
Remarks

Each column in V is treated as an independent set of sampled values. A piecewise cubic spline interpolation is performed for each column individually.

V can be a n-dimensional array in which case the interpolation is done on a reshaped version of V = V[":;:"]. However, all dimensions of the original V are retained and considered for the return value (shape preserving).

While the rows of V hold the ensemble of measurements for each sample position, X holds the coordinates of these positions. If X is provided it must be a vector of length n with strictly monotonically increasing values, without any duplicates. If X is not provided (null) unit spacing of the row elements in V is assumed: 0..1..2..n-1.

The parameters lbDeriv and ubDeriv control the derivatives at the lower bound and at the upper bound of the sampled domain. The default values null compute so called 'not-a-knot' splines, i.e. the 1st, 2nd and 3rd derivatives at these ends are considered equal to the corresponding derivatives at their next available inner sampled values. This corresponds to simply extending the spline function at the first and last inner samples to the end points, hence the name 'not-a-knot'.

For other options for end point derivatives see the documentation for SplineInterpolatorSingle.

The spline(InArraySingle, NullableSingle, InArraySingle, InArraySingle, InArraySingle, InArraySingle) function serves as a wrapper for the SplineInterpolatorSingle object for syntactic convenience. Subsequent calls of spline() on the same data will recreate all temporary information necessary for the interpolation. Consider using the SplineInterpolatorSingle object directly if optimal performance for multiple interpolations based on the same dataset V is required.

Support for NaN values: spline interpolation performs interpolation by taking all values of V into account. What enables best smoothness properties on the other hand implies that any NaN value in V populate to all elements of the output. Therefore, one must ensure that no NaN values exist in V. Use cubic polynomial interpolation in interpn(InArraySingle, InCell, InCell, InterpolationMethod) for an alternative on data with NaN values.

[ILNumerics Interpolation Toolbox]

See Also

Reference

InterpolationInternal.splinepath(InArraySingle, InArraySingle, InArraySingle, InArraySingle, Int32)
InterpolationInternal.interp1(InArraySingle, NullableSingle, InArraySingle, InArraySingle, Int32, InterpolationMethod)
InterpolationInternal.interpn(InArraySingle, NullableSingle, InCell, InCell, InterpolationMethod)