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



MeanVarArray


Unit: SDL_openarrays
Class: None
Declaration: [1] function MeanVarArray (Arr: TIntArray; FirstIx, LastIx: integer; var Mean, Vari: double): integer;
[2] function MeanVarArray (Arr: TInt2DArray; LowCol, LowRow, HighCol, HighRow: integer; var Mean, Vari: double): integer;
[3] function MeanVarArray (Arr: TDoubleArray; FirstIx, LastIx: integer; var Mean, Vari: double): integer;
[4] function MeanVarArray (Arr: TDouble2DArray; LowCol, LowRow, HighCol, HighRow: integer; var Mean, Vari: double): integer;

The function MeanVarArray returns the mean and the variance of an array in the variable parameters Mean and Vari. The function is available in two overloaded variants: versions [1] and [3] accept a one-dimensional open array of double precision values, versions [2] and [4] operate on a two-dimensional open array (parameter Data).

The parameters FirstIx and LastIx defines the search range for versions [1] and [3], the parameters LowCol, LowRow, HighCol and HighRow specify the search range of versions [2] and [4].

The function returns a zero value if everything is OK and the Mean and Vari parameters contain the mean and the variance.

The function returns the following error codes:

 0 ... everything is OK, the returned value is valid
-1 ... the array has zero size
-2 ... FirstIx and/or LastIx is out of range (versions [1] and [3]), or LowCol, HighCol, LowRow or HighRow is out of range (versions [2] and [4])


Last Update: 2023-Dec-10