Finds the key nearest to the specified value in the index.
Namespace:
Extreme.DataAnalysis
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public int LookupNearest(
T key,
Direction direction
)
Public Function LookupNearest (
key As T,
direction As Direction
) As Integer
public:
int LookupNearest(
T key,
Direction direction
)
member LookupNearest :
key : 'T *
direction : Direction -> int
Parameters
- key
- Type: T
The key to locate. - direction
- Type: Extreme.DataAnalysisDirection
The direction to look for the key if an exact match is not found.
Return Value
Type:
Int32If a key was found, the zero-based position of
the key closest to
key in the direction specified
by
direction; otherwise -1.
This operation is only allowed on sorted indexes.
The only situation where a lookup can fail is if key
is smaller than the first key (if direction is Forward)
or greater than the last key (if direction is Backward).
Reference