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



DichotomizeArray


Unit:SDL_openarrays
Class: none
Declaration: [1] function DichotomizeArray (Arr: TDouble2DArray; Threshold: double; var Res: TBool2DArray): integer;
[2] function DichotomizeArray (Arr: TDouble2DArray; Thresh1, Thresh2: double; var Res: TBool2DArray): integer;
[3] function DichotomizeArray (Arr: TInt2DArray; Threshold: integer; var Res: TBool2DArray): integer;
[4] function DichotomizeArray (Arr: TInt2DArray; Thresh1, Thresh2: integer; var Res: TBool2DArray): integer;
[5] function DichotomizeArray (Arr: TIntArray; Threshold: integer; var Res: TBoolArray): integer;
[6] function DichotomizeArray (Arr: TIntArray; Thresh1, Thresh2: integer; var Res: TBoolArray): integer;

The function DichotomizeArray compares the values of the array Arr to the threshold Threshold and fills the array Res with the result of the comparison. TRUE values will be stored in Res for all array cells whose values exceed the threshold (versions [1], [3] and [5]). Versions [2], [4] and [6] allow to define an interval instead of a threshold. All values which fall into the interval specified by the parameters Thresh1 and Thresh2 result in TRUE values in the Res array.

The size of the array Res will be automatically adjusted to fit the size of the array.

The function returns the following error codes:

 0 ... everything is OK
-1 ... Arr is empty



Last Update: 2023-Mar-26