WebCab Functions Web Services for .NET v2.0

Interpolation.HuntBisectionLocate Method 

This is a utility function which searches an ordered monotonic sequence and returns the relative position within the sequence using a method which combines the hunt and Bisection method.

public int HuntBisectionLocate(
   double[] monotonicSequence,
   double valueBeingOrdered
);

Parameters

monotonicSequence
An array of monotonic values (increasing or decreasing).
valueBeingOrdered
Value to the point which is being given a relative ordering.

Remarks

This method first finds (or hunts for) two elements of a sequence of monotonic real numbers (i.e. sequentially increasing or decreasing) which bracket the desired value and then applies in bisection searching algorithm.

This method attempts to bracket the valueBeingOrdered parameter between two consecutive elements of the array and return the lower bound. Several special cases are treated separately as follows:

Exceptions

Exception TypeCondition
InterpolationExceptionThrown when the array is null.

See Also

Interpolation Class | Interpolation Namespace