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



CopyToArray


Unit: SDL_matrix
Class: TMatrix, TIntMatrix
Declaration: [1] function CopyToArray (var Dest: TDouble2DArray; SrcColLo, SrcRowLo, SrcColHi, SrcRowHi, DestCol, DestRow: integer): integer; { class TMatrix }
[2] function CopyToArray (var Dest: TInt2DArray; SrcColLo, SrcRowLo, SrcColHi, SrcRowHi, DestCol, DestRow: integer): integer; { class TMatrix }
[3] function CopyToArray (var Dest: TDouble2DArray; SrcColLo, SrcRowLo, SrcColHi, SrcRowHi, DestCol, DestRow: integer): integer; { class TIntMatrix }
[4] function CopyToArray (var Dest: TInt2DArray; SrcColLo, SrcRowLo, SrcColHi, SrcRowHi, DestCol, DestRow: integer): integer; { class TIntMatrix }

The method CopyToArray copies the cells of the matrix in the range from [SrcColLo,SrcRowLo] to [SrcColHi,SrcRowHi] to the position [DestCol, DestRow] of the dynamic array Dest. If any of the cells to be copied fall outside of the destination range these cells are ignored.

Please note that the version [2] rounds the values before copying them.

The function returns the following error codes:
 0 ... everything is OK
-1 ... the destination array has zero size
-2 ... SrcColLo and/or SrcColHi are out of range (valid range: 1 to NrOfColumns)
-3 ... SrcRowLo and/or SrcRowHi are out of range (valid range: 1 to NrOfRows)
-4 ... DestCol and/or DestRow are out of range (valid ranges: 0 ≤ DestCol < length(Dest), and 0 ≤ DestRow < length(Dest[0])

 

Hint: As a shortcut, setting both the ...Lo and the ...Hi parameters to zero is equal to processing the entire range of available source columns or rows.



Last Update: 2023-Feb-06