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....



Find


Unit:SDL_matrix
Class: TMatrix, TIntMatrix, TMat3D
Declaration: procedure Find (LowCol, HighCol, LowRow, HighRow: integer; Value: double; var ColIx, RowIx: integer); { class TMatrix }
procedure Find (LowCol, HighCol, LowRow, HighRow: integer; Value: integer; var ColIx, RowIx: integer); { class TIntMatrix }
procedure Find (LowCol, HighCol, LowRow, HighRow, LowLayer, HighLayer: integer; Value: double; var ColIx, RowIx, LayerIx: integer); { class TMat3D }

The method Find searches the matrix element which is closest to Value and returns the index of the found element in the variable parameters ColIx, and RowIx (and LayerIx in the case of TMat3D). The search range is specified by the parameters LowCol, HighCol, LowRow and HighRow (and LowLayer and HighLayer in the case of TMat3D).

Hint: Setting both the low and high parameter of a dimension (i.e. LowCol and HighCol) to zero values forces a search through all elements of that dimension. For example, the call of Matrix1.Find (2,3,0,0,2.31,ix,iy); searches all rows of columns 2 and 3 of the matrix Matrix1 for the closest value to 2.31 and returns the address of the found cell in the variables ix and iy.



Last Update: 2023-Feb-06