NetworkExtensionsBinarySearch Method (IListIReach, ILocation, Double) |
Find the reach that includes the given location. Assuming the reaches are sorted.
Location comparisons are case insensitive, and chainage comparisons uses the tolerance,
i.e., the location can be tolerance outside the span and still be accepted. tolerance may
be negative (it location has to be somewhat inside span).
Namespace:
DHI.Mike1D.NetworkDataAccess
Assembly:
DHI.Mike1D.NetworkDataAccess (in DHI.Mike1D.NetworkDataAccess.dll) Version: 16.0.0.0 (11.1.1.1111)
Syntax public static int BinarySearch(
this IList<IReach> reaches,
ILocation location,
double tolerance
)
Parameters
- reaches
- Type: System.Collections.GenericIListIReach
List of reaches to search in - location
- Type: DHI.Mike1D.GenericILocation
Location to find - tolerance
- Type: SystemDouble
Tolerance when comparing chainages
Return Value
Type:
Int32The zero-based index of item in the sorted
IListT, if item is found;
otherwise, a negative number that is the bitwise complement
of the index of the next element that is larger than item or,
if there is no larger element, the bitwise complement of Count.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IListIReach. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also