TVecSmallInt.GetCol Method

Overload List

#SignatureDescription
1function GetCol(const Mtx: TMtxInt; Col: Integer): TVecInt;Copies a column from matrix.
2function GetCol(const Mtx: TMtxInt; Row: Integer; Col: Integer; Len: Integer): TVecInt;Copy the Col-th column elements [Row]..[Row+Len-1] to calling vector.
3function GetCol(const Mtx: TMtxInt; Row: Integer; Col: Integer; Index: Integer; Len: Integer): TVecInt;Copy the Col-th column elements [Row]..[Row+Len-1] to calling vector elements [Index]..[Index+Len-1].

Overload 1: function GetCol(const Mtx: TMtxInt; Col: Integer): TVecInt;

Copies a column from matrix.

#NameTypeDescription
1MtxTMtxIntsource TMtxInt
2ColInteger

Result: stored in self (calling object), returns self for chaining

Remarks:

Copies the Col-th column from Mtx matrix to calling vector. The TMtxVecBase.Length and TMtxVecInt.IntPrecision properties of calling vector are adjusted automatically. An exception is raised if condition checking is enabled and Col is greater than Mtx.Cols-1.

Examples
var a: TVecInt;
    b: TMtxInt;
begin
    CreateIt(a);
    CreateIt(b);
    try
        b.SetIt(2,2,[1,2,
            3,4]);
        a.GetCol(b,0); // a now contains [1,3]
    finally
        FreeIt(a);
        FreeIt(b);
    end;
end;

Overload 2: function GetCol(const Mtx: TMtxInt; Row: Integer; Col: Integer; Len: Integer): TVecInt;

Copy the Col-th column elements [Row]..[Row+Len-1] to calling vector.

#NameTypeDescription
1MtxTMtxIntsource TMtxInt
2RowInteger
3ColInteger
4LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Remarks:

The TMtxVecBase.Length and TMtxVecInt.IntPrecision properties of calling vector are adjusted automatically. An exception is raised if condition checking is enabled and column array borders are overrun.

Overload 3: function GetCol(const Mtx: TMtxInt; Row: Integer; Col: Integer; Index: Integer; Len: Integer): TVecInt;

Copy the Col-th column elements [Row]..[Row+Len-1] to calling vector elements [Index]..[Index+Len-1].

#NameTypeDescription
1MtxTMtxIntsource TMtxInt
2RowInteger
3ColInteger
4IndexIntegerstart index
5LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Remarks:

The TMtxVecInt.IntPrecision property of calling vector must be set explicitly. An exception is raised if condition checking is enabled and column array borders are overrun.