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



CopyFromVec


Unit: SDL_matrix
Class: TMatrix
Declaration: [1] procedure CopyFromVec (Src: TVector; FirstElem, LastElem, DestCol, DestRow: integer);
[2] procedure CopyFromVec (Dim: TDims; Src: TVector; FirstElem, LastElem, DestCol, DestRow: integer);
[3] procedure CopyFromVec (Src: TVector; FirstElem, LastElem, DestCol, DestRow: integer; AsColumn: boolean);

The method CopyFromVec copies a part of the external vector Src into its own data area (self ). The source vector is an instance of class TVector. The elements to be copied are specified by the the parameters FirstElem, and LastElem.

While version [1] always copies column vectors, versions [2] and [3] of the method allows to specify the orientation of the vector to be copied. For version [2] the parameter Dim may assume either dimX (row vector) or dimY (column vector), other values are ignored. For version [3] the parameter AsColumn controls the orientation (see figure below).

The destination position is defined by the parameters DestCol and DestRow. The element [DestCol, DestRow ] is filled by the value of the source vector at address [FirstElem, LastElem ] and all other elements are copied to higher addresses accordingly.

Hint: FirstElem needs not to be lower than LastElem since the method CopyFromVec automatically allows for the correct copying sequence.


Last Update: 2023-Feb-06