CurveBaseFindInterval Method |
Find index of largest element in the increasingly ordered vector x,
which is smaller than u. If u is smaller than the smallest value in
the vector then the lowest index minus one is returned.
Namespace: Altaxo.Calc.InterpolationAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax public static int FindInterval(
double u,
IReadOnlyList<double> x
)
Parameters
- u Double
- The value to search for.
- x IReadOnlyListDouble
- Vector of (strictly increasing) x values.
Return Value
Int32The index i so that x[i]<u<=x[i+1]. If u is smaller than x[0] then -1 is returned.
Remarks
A fast binary search is performed.
Note, that the vector must be strictly increasing.
See Also