Click or drag to resize

MathUtil.GetIndeces Method (Double, MathUtil.IDataToInterpolate, Int32, Int32, Boolean)

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.

Namespace:  DHI.Mike1D.Generic
Assembly:  DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public static void GetIndeces(
	double arg,
	MathUtil.IDataToInterpolate data,
	ref int iLow,
	ref int iHigh,
	bool xIncreasing
)

Parameters

arg
Type: System.Double
Value to look up in table
data
Type: DHI.Mike1D.Generic.MathUtil.IDataToInterpolate
Accessor to data
iLow
Type: System.Int32
The low index, the index to the lowest vector value
iHigh
Type: System.Int32
The high index, the index to the highest vector value
xIncreasing
Type: System.Boolean
Increasing or decreasing vector values
See Also