VectorInt.GetCol Method

Overload List

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

Overload 1: TVecInt GetCol(TMtxInt Mtx, Int32 Col)

Copies a column from matrix.

#NameTypeDescription
1MtxTMtxIntsource TMtxInt
2ColInt32

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

Remarks:

Copies the Col-th column from Mtx matrix to calling vector. The Dew.Math.TMtxVecBase.Length and Dew.Math.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
TVecInt a;
TMtxInt b;
MtxVec.CreateIt(out a);
MtxVec.CreateIt(out b);
try
    {
        b.SetIt(2,2,[1,2,
        3,4]);
        a.GetCol(b,0); // a now contains new double[] {1,3}
    }
finally
    {
        MtxVec.FreeIt(ref a);
        MtxVec.FreeIt(ref b);
    }
See Also: VectorInt.GetRow, TMtx.SetCol

Overload 2: TVecInt GetCol(TMtxInt Mtx, Int32 Row, Int32 Col, Int32 Len)

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

#NameTypeDescription
1MtxTMtxIntsource TMtxInt
2RowInt32
3ColInt32
4LenInt32element count

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

Remarks:

The Dew.Math.TMtxVecBase.Length and Dew.Math.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: TVecInt GetCol(TMtxInt Mtx, Int32 Row, Int32 Col, Int32 Index, Int32 Len)

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

#NameTypeDescription
1MtxTMtxIntsource TMtxInt
2RowInt32
3ColInt32
4IndexInt32start index
5LenInt32element count

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

Remarks:

The Dew.Math.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.