MathUtilGetIndeces(DateTime, DateTime, Int32, Int32, Boolean) Method

Finds the two indexes in a mononton vector using bisection search. This can handle as well increasing as decreasing vectors, as long as they are monotone. The indexes corresponds to the points neighbouring the argument, arg. In case of an exact match the two indexes will be identical. If the argument is outside the valid interval either the lower or the upper interval boundary is returned depending on wheter the argument is lower or higher than the lower or upper boundary, respectively.

Definition

Namespace: DHI.Mike1D.Generic
Assembly: DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public static void GetIndeces(
	DateTime arg,
	DateTime[] vector,
	ref int iLow,
	ref int iHigh,
	bool xIncreasing
)

Parameters

arg  DateTime
Value to look up in table
vector  DateTime
Vector, must be monoton
iLow  Int32
The low index, the index to the lowest vector value
iHigh  Int32
The high index, the index to the highest vector value
xIncreasing  Boolean
Increasing or decreasing vector values

See Also