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


Class: TMatrix, TIntMatrix, TMat3D
Declaration: [1] procedure CopyFrom (MatSource: TMatrix; SourceColLo, SourceRowLo, SourceColHi, SourceRowHi, DestCol, DestRow: integer); { class TMatrix }
[2] procedure CopyFrom (MatSource: TIntMatrix; SourceColLo, SourceRowLo, SourceColHi, SourceRowHi, DestCol, DestRow: integer); { class TIntMatrix }
[3] procedure CopyFrom (MatSource: TMat3D; SourceColLo, SourceRowLo, SourceColHi, SourceRowHi, SourceLayer, DestCol, DestRow: integer); { class TMat3D }

The method CopyFrom copies a part of the matrix MatSource into its own data area (self). TMatrix can copy values from TMatrix, TIntMatrix and TMat3D classes (overloaded versions [1] to [3]).

The region to be copied is specified by the the parameters SourceColLo, SourceRowLo, SourceColHi, and SourceRowHi (see figure below). In the case of a three-dimensional source matrix, the layer has to specified as well (parameter SourceLayer).

The destination area is defined by the parameters DestCol and DestRow. The element [DestCol,DestRow ] is filled by the value of the source matrix at address [SourceColLo,SourceRowLo ] and all other elements are copied to appropriate higher addresses. The figure below shows the copy process.

Hint: SourceColLo (or SourceRowLo, resp.) needs not to be lower than SourceColHi (or SourceRowHi ), since the method CopyFrom automatically allows for the correct copying sequence.

Example: The statement MD.CopyFrom (MS, 10,10,12,12,1,5); copies the elements [10,10] to [12,12] of the matrix to the area [1,5] to [3,7] in the destination matrix .

Last Update: 2023-Feb-06