The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Class: TMatrix, TIntMatrix
Declaration: function FindInSortedColumn (Col: integer; ColIsAscending: boolean; Value: double): integer; { class TMatrix }
function FindInSortedColumn (Col: integer; ColIsAscending: boolean; Value: integer): integer; { class TIntMatrix }

The function FindInSortedColumn searches the sorted column Col for the matrix element which is closest to Value and returns the index of the found element as the function value. The parameter ColIsAscending indicates the sort order of the column elements (TRUE = ascending, FALSE = descending).

Hint: As opposed to Find, the search algorithm in FindInSortedColumn is based on a binary search, which is considerably faster, but which requires the column Col to be sorted. If the column elements are not sorted or not sorted according to the parameter ColIsAscending, the search will not succeed, even if there is a matching cell in the array.

Last Update: 2019-Jan-22