MathUtilGetIndeces Method (Double, Double, 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,
double[] vector,
ref int iLow,
ref int iHigh,
bool xIncreasing
)
Public Shared Sub GetIndeces (
arg As Double,
vector As Double(),
ByRef iLow As Integer,
ByRef iHigh As Integer,
xIncreasing As Boolean
)
public:
static void GetIndeces(
double arg,
array<double>^ vector,
int% iLow,
int% iHigh,
bool xIncreasing
)
Parameters
- arg
- Type: SystemDouble
Value to look up in table - vector
- Type: SystemDouble
Vector, must be monoton - iLow
- Type: SystemInt32
The low index, the index to the lowest vector value - iHigh
- Type: SystemInt32
The high index, the index to the highest vector value - xIncreasing
- Type: SystemBoolean
Increasing or decreasing vector values
See Also