Vector<T>.Get Nearest<K> Method
Gets the value in the vector whose key in the index is nearest
to the specified key.
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
The value with key key.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
public T GetNearest<K>(
K key,
Direction direction
)
Parameters
- key K
- The key to look up.
- direction Direction
- The direction to look for the key if an exact match is not found.
Type Parameters
- K
- The element type of the vector's index.
Return Value
TThe value with key key.
Exceptions
Invalid | The vector does not have an index. |
Invalid | The element type of the vector's index is not K. |
Key | key was not found in the vector's index. |