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.CalcAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntaxpublic static double? GetFirstFractionalIndexOfXInUnorderedArray(
ReadOnlySpan<double> xArray,
double x
)
Parameters
- xArray ReadOnlySpanDouble
- The x array.
- x Double
- The searched x value.
Return Value
NullableDoubleThe 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