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_vector
Class: TVector, TIntVector
Declaration: [1] procedure CopyToArray (var DestArray: TDoubleArray; LowElem, HighElem, DestElem: integer); { class TVector }
[2] procedure CopyToArray (var DestArray: TIntArray; LowElem, HighElem, DestElem: integer); { class TIntVector }
[3] procedure CopyToArray (var DestArray: TDouble2DArray; LowElem, HighElem, DestCol, DestRow: integer; AsColumn: boolean); { class TVector }
[4] procedure CopyToArray (var DestArray: TInt2DArray; LowElem, HighElem, DestCol, DestRow: integer; AsColumn: boolean); { class TIntVector }

The method CopyToArray comes in two different overlaid versions. Versions [1] and [2] copy the cells of the vector in the range from [LowElem] to [HighElem] to the dynamic array DestArray, starting with the cell DestElem. The size of the destination array is automatically adjusted to the size of the specified range plus DestElem.

Versions [3] and [4] copy the cells of the vector from [LowElem] to [HighElem] to the two-dimensional array DestArray at the position [DestCol,DestRow]. The parameter AsColumn determines whether the data are copied into a column or a row of the array. The size of the destination array is not adjusted to the size of the specified range plus DestElem, thus you have to resize the destination array before copying the data.

Hint: Setting both LowElem and HighElem to zero values is a shortcut for copying all cells of the vector.



Last Update: 2023-Feb-06