ILNumerics Ultimate VS

CubicInterpolatorDouble Constructor

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Creates a cubic interpolator object, using specified values in V at positions in X.

[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 CubicInterpolatorDouble(
	InArray<double> V,
	InArray<double> X,
	Nullable<double> outOfRangeValues = null
)

Parameters

V
Type: ILNumericsInArrayDouble
Vector of length m or n-dimensional array of size [m, l1, l2, ..., ln-1].
X
Type: ILNumericsInArrayDouble
Strictly monotonically increasing coordinates. Vector or n-dimensional array with m elements.
outOfRangeValues (Optional)
Type: SystemNullableDouble
[Optional] Value to be assigned to interpolation results outside of the range specified by X. Default: (null) value outside of the X range are extrapolated.
Exceptions

ExceptionCondition
ArgumentExceptionIf X/ V have less than 4 elements, if values in X are not strictly monotonically increasing, if X or V have more than 2 dimensions, or if the number of elements in X does not match the length of the working dimension in V.
ArgumentNullExceptionIf any of input parameters are NULL
ArgumentExceptionIf arguments X or V have different size.
Remarks

For an input vector V, CubicInterpolatorDouble prepares a 1-dimensional, cubic interpolator object, for the given set of m measured values. The new interpolator can be used to compute multiple new interpolated values efficiently. See: Apply(InArrayDouble, InCell).

If V is a matrix or a n-dimensional array the columns of V are considered n individual sets of measurements, all providing individual values at the same coordinates X. Each element requested in Apply(InArrayDouble, InCell) will be interpolated regarding all respective columns of V. In this case n becomes: V.S.NumberOfElements / m, with m=V.S[0].

Alternatively, V can be defined as vector (row or column vector) of length m.

After all values have been acquired, the object should be released in order to free its resources. Commonly, in .NET, the utiliziation of CubicInterpolatorDouble inside of a using directive is recommended.

[ILNumerics Interpolation Toolbox]

Examples

// Define some sample points as a function: f(x) = sin(x);
Array<double> X = linspace<double>(-pi, pi, 10);
Array<double> V = sin(X);

// Create Interpolator Object
using (var interp = new CubicInterpolatorDouble(V, X)) 
{ 
    // Get some random scalar values
    double val1 = (double)interp.Apply(0.024);
    double val2 = (double)interp.Apply(-0.21);

    // Get 10 linear spaced values defined on range (-0.5, 1.25)
    Array<double> valRange = interp.Apply(linspace<double>(-0.5, 1.25, 10));

    // Get 30 interpolated values using Xn query points defined as array[3 x 2 x 5]
    Array<double> Xn = counter(0.0, 0.1, 3, 2, 5);
    Array<double> Vn = interp.Apply(Xn);
}

See Also

Reference