[ILNumerics Interpolation Toolbox]
Namespace: ILNumerics.Toolboxes
Assembly: ILNumerics.Toolboxes.Interpolation (in ILNumerics.Toolboxes.Interpolation.dll) Version: 5.5.0.0 (5.5.7503.3146)
public CubicInterpolatorSingle( InArray<float> V, InArray<float> X, Nullable<float> outOfRangeValues = null )
Parameters
- V
- Type: ILNumericsInArraySingle
Vector of length m or n-dimensional array of size [m, l1, l2, ..., ln-1]. - X
- Type: ILNumericsInArraySingle
Strictly monotonically increasing coordinates. Vector or n-dimensional array with m elements. - outOfRangeValues (Optional)
- Type: SystemNullableSingle
[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.
Exception | Condition |
---|---|
ArgumentException | If 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. |
ArgumentNullException | If any of input parameters are NULL |
ArgumentException | If arguments X or V have different size. |
For an input vector V, CubicInterpolatorSingle 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(InArraySingle, 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(InArraySingle, 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 CubicInterpolatorSingle inside of a using directive is recommended.
[ILNumerics Interpolation Toolbox]
// Define some sample points as a function: f(x) = sin(x); Array<float> X = linspace<float>(-pi, pi, 10); Array<float> V = sin(X); // Create Interpolator Object using (var interp = new CubicInterpolatorSingle(V, X)) { // Get some random scalar values float val1 = (float)interp.Apply(0.024); float val2 = (float)interp.Apply(-0.21); // Get 10 linear spaced values defined on range (-0.5, 1.25) Array<float> valRange = interp.Apply(linspace<float>(-0.5, 1.25, 10)); // Get 30 interpolated values using Xn query points defined as array[3 x 2 x 5] Array<float> Xn = counter(0.0, 0.1, 3, 2, 5); Array<float> Vn = interp.Apply(Xn); }