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



Resample2DArray


Unit:SDL_openarrays
Class: none
Declaration: function Resample2DArray (SrcMat: TDouble2DArray; var DstMat: TDouble2DArray; colpct, rowpct: double; BootStrap: boolean; var RndColIx, RndRowIx: TIntArray): integer;

The function Resample2DArray resamples data from the array SrcMat and stores the results in array DstMat. The parameters colpct and rowpct control how many of the columns and rows are randomly selected for transferring the corresponding cells to the destination matrix DstMat. colpct and rowpct have to be specified in percent. The actual number of columns/rows is rounded towards the closest integer value representing this percentage.

The parameter BootStrap controls whether the rows are selected with (=TRUE) or without (=FALSE) replacement. It has no effect on the selection of the columns (they are always selected without replacement). The variable arrays RndColIx and RndRowIx return the indices of the selected columns and rows, respectively.

The function returns the following error codes:

 0 ... everything is OK
-1 ... colpct is invalid or leads to zero new columns
-2 ... rowpct is invalid or leads to zero new rows
-3 ... SrcMat is nil
-4 ... DstMat is nil
-5 ... RndColIx and/or RndRowIx is nil



Last Update: 2023-Feb-06