MathUtilGetInterval Method |
Name | Description | |
---|---|---|
GetInterval(Double, Double, Double) | Finds the interval in a vector where the argument lays in between. Assumes that the vector has at least two elements. The vector must increase strictly monotonically. If argument is below the first value, 0 is returned. If argument is above last value, the length of the vector is returned. The result is the interval number, one based, meaning that the arg fullfills: (vector[res-1] < arg && arg <= vector[res]) Also the scale factor for interpolating is returned. For linear interpolation arg = vector[res-1] + fraction*(vector[res]-vector[res-1]) arg = (1-fraction)*vector[res-1] + fraction*vector[res] If arg exists in vector, the result is such that arg = vector[res] | |
GetInterval(DateTime, IReadOnlyListDateTime, Double, Int32) | GetInterval(Double, Double, Double, Int32) for DateTimes.
This has an IReadOnlyListT DateTime as argument instead of a DateTime[].
which is slower than a DateTime[] version
| |
GetInterval(Double, MathUtilIDataForSearching, Double, Int32) | GetInterval(Double, Double, Double, Int32) for details.
This has an MathUtilIDataForSearching as argument instead of a double[].
This version is slower than the double[] version.
| |
GetInterval(Double, IListDouble, Double, Int32) | GetInterval(Double, Double, Double, Int32) for details.
This has an IListT as argument instead of a double[].
This version is slower than the double[] version.
| |
GetInterval(Double, ListDouble, Double, Int32) | GetInterval(Double, Double, Double, Int32) for details.
This has an ListT as argument instead of a double[].
This version is slower than the double[] version
| |
GetInterval(Double, Double, Double, Int32) |
Finds the interval in a vector where the argument lays in between. Searches
the last interval first. It is assumed that the input vector has at least two elements.
This uses binary search techniques for efficiency.
The vector must increase strictly monotonically. If argument is below the first value, 0
is returned. If argument is above last value, the length of the vector is returned.
The result is the interval number, one based, meaning that the arg fullfills:
(vector[res-1] < arg && arg <= vector[res]) arg = vector[res-1] + fraction*(vector[res]-vector[res-1]) arg = (1-fraction)*vector[res-1] + fraction*vector[res] arg = vector[res] | |
GetInterval(Double, Int32, FuncInt32, Double, Double) | Finds the interval in a vector where the argument lays in between. Assumes that the vector has at least two elements. The vector must increase strictly monotonically. If argument is below the first value, 0 is returned. If argument is above last value, the length of the vector is returned. The result is the interval number, one based, meaning that the arg fullfills: (vector[res-1] < arg && arg <= vector[res]) Also the scale factor for interpolating is returned. For linear interpolation arg = vector[res-1] + fraction*(vector[res]-vector[res-1]) arg = (1-fraction)*vector[res-1] + fraction*vector[res] If arg exists in vector, the result is such that arg = vector[res] | |
GetIntervalT(Double, T, FuncT, Double, Double) | Finds the interval in a vector where the argument lays in between. Assumes that the vector has at least two elements. The vector must increase strictly monotonically. If argument is below the first value, 0 is returned. If argument is above last value, the length of the vector is returned. The result is the interval number, one based, meaning that the arg fullfills: (vector[res-1] < arg && arg <= vector[res]) Also the scale factor for interpolating is returned. For linear interpolation arg = vector[res-1] + fraction*(vector[res]-vector[res-1]) arg = (1-fraction)*vector[res-1] + fraction*vector[res] If arg exists in vector, the result is such that arg = vector[res] | |
GetIntervalT(T, MathUtilIDataForSearchingT, Double, Int32) | GetInterval(Double, Double, Double, Int32) for details.
This has an MathUtilIDataForSearchingT as argument instead of a double[].
This version is slower than an array version.
| |
GetInterval(Double, Int32, FuncInt32, Double, Double, Int32) | Finds the interval in a vector where the argument lays in between. Assumes that the vector has at least two elements. The vector is represented by the vectorValue function, which must return vector values in strictly increasing order. The vector must increase strictly monotonically. If argument is below the first value, 0 is returned. If argument is above last value, the length of the vector is returned. The result is the interval number, one based, meaning that the arg fullfills: (vector[res-1] < arg && arg <= vector[res]) Also the scale factor for interpolating is returned. For linear interpolation arg = vector[res-1] + fraction*(vector[res]-vector[res-1]) arg = (1-fraction)*vector[res-1] + fraction*vector[res] If arg exists in vector, the result is such that arg = vector[res] |