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


Unit: SDL_math1
Class: None
Declaration: [1] function MinMaxOfArray (Data: TDoubleArray; FirstIx, LastIx: integer; var Mini, Maxi: double; var MinIx, MaxIx: integer): integer;
[2] function MinMaxOfArray (Data: TDouble2DArray; LowCol, LowRow, HighCol, HighRow: integer; var Mini, Maxi: double; var MinCol, MinRow, MaxCol, MaxRow: integer): integer;

The function MinMaxOfArray returns the minimum and the maximum values of an array in the variable parameters Mini and Maxi. The function is available in two overloaded variants: version [1] accepts a one-dimensional open array of double precision values, version [2] operates on a two-dimensional open array (parameter Data).

The parameters FirstIx and LastIx defined the search range for version [1], the parameters LowCol, LowRow, HighCol and HighRow specify the search range of version [2]. The variable parameters MinIx and MaxIx (version [1]) and MinCol, MinRow, MaxCol, MaxRow (version [2]) return the indices of the found minimum and maximum.

The function returns a zero value if everything is OK and the Mini and Maxi parameters contain the minimum and maximum. If any of the range parameters is invalid (i.e. negative or greater than size of the array) a -1 value is returned. In this case the Mini and Maxi parameters are invalid.

Last Update: 2016-Aug-02