Click or drag to resize

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.Interpolation
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
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

Int32
The 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