MathUtilGetIndeces(Double, MathUtilIDataToInterpolate, 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.
Namespace: DHI.Mike1D.GenericAssembly: DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 24.0.0.0 (11.1.1.1111)
public static void GetIndeces(
double arg,
MathUtilIDataToInterpolate data,
ref int iLow,
ref int iHigh,
bool xIncreasing
)
Parameters
- arg Double
- Value to look up in table
- data MathUtilIDataToInterpolate
- Accessor to data
- 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