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



CopyColToVec


Unit:SDL_matrix
Class: TMatrix, TIntMatrix
Declaration: [1] procedure CopyColToVec (DestVec: TVector; Col, FirstRow, LastRow: integer); { class TMatrix }
[2] procedure CopyColToVec (DestVec: TVector; Col, FirstRow, LastRow, DestElem: integer); { class TMatrix }
[3] procedure CopyColToVec (DestVec: TIntVector; Col, FirstRow, LastRow: integer); { class TIntMatrix }
[4] procedure CopyColToVec (DestVec: TIntVector; Col, FirstRow, LastRow, DestElem: integer); { class TIntMatrix }

The method CopyColToVec copies part of a column of the matrix into the vector DestVec. The parameter Col specifies the column to be copied, the parameters FirstRow, and LastRow define the range of the column to be copied to the vector. The matrix element with address [Col,FirstRow] is copied to the first element of the vector, the element [Col,FirstRow+1] is copied to the second vector element, and so on, until the cell at [Col,LastRow] 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: -(LastRow-FirstRow-1)...DestVec.NrOfElems).

Hint: Setting both FirstRow and LastRow to zero values forces the method to use all rows.

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



Last Update: 2023-Feb-06