Finds the key nearest to the specified value in the index.
Namespace: Extreme.DataAnalysisAssembly: Extreme.Numerics.Net40 (in Extreme.Numerics.Net40.dll) Version: 6.0.16073.0 (6.0.17114.0)
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).
Numerical Libraries
Supported in: 6.0
Reference