Click or drag to resize

RMathGetFirstFractionalIndexOfXInUnorderedArray Method

Searches for x in the array and returns the first index where x is found. If x is not found, but is inbetween two consecutive elements of the array, a fractional index is returned, which is calculated by linear interpolation between the two indices.

Namespace: Altaxo.Calc
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntax
C#
public static double? GetFirstFractionalIndexOfXInUnorderedArray(
	ReadOnlySpan<double> xArray,
	double x
)

Parameters

xArray  ReadOnlySpanDouble
The x array.
x  Double
The searched x value.

Return Value

NullableDouble
The fractional index of x in the array. If x is outside the elements of the array, null is returned.
Remarks
The array does not need to be sorted. The cost is O(n).
See Also