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



CopyRowToVec


Unit:SDL_matrix
Class: TMatrix, TIntMatrix
Declaration: [1] procedure CopyRowToVec (DestVec: TVector; Row, FirstCol, LastCol: integer); { class TMatrix }
[2] procedure CopyRowToVec (DestVec: TVector; Row, FirstCol, LastCol, DestElem: integer); { class TMatrix }
[3] procedure CopyRowToVec (DestVec: TIntVector; Row, FirstCol, LastCol: integer); { class TIntMatrix }
[4] procedure CopyRowToVec (DestVec: TIntVector; Row, FirstCol, LastCol, DestElem: integer); { class TIntMatrix }

The method CopyRowToVec copies part of a row of the matrix into the vector DestVec. The parameter Row specifies the row to be copied, the parameters FirstCol, and LastCol define the range of the row to be copied to the vector. The matrix element with address [FirstCol,Row] is copied to the first element of the vector, the element [FirstCol+1,Row] is copied to the second vector element, and so on, until the cell at [LastCol,Row] has been copied.

If the destination vector is larger than the specified range, the remaining cells are set to zero values. If the vector is smaller, only the first n elements (n = size of the vector) are copied.

The versions [2] and [4] allow to specify a destination cell DestElem which is the first cell of the destination vector. All values are copied to this cell and the subsequent ones. DestElem can be negative as well (valid range: -(LastCol-FirstCol-1)...DestVec.NrOfElems).

Hint: Setting both FirstCol and LastCol to zero values forces the method to use all columns.

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): kohmap



Last Update: 2023-Feb-06