TVec::GetCol Method

Overload List

#SignatureDescription
1TVec *GetCol(TMtx *Mtx, int Col);Copies a column from matrix.
2TVec *GetCol(TMtx *Mtx, int Row, int Col, int Index, int Len);Copy the Col-th column elements [Row]..[Row+Len-1] to calling vector elements [Index]..[Index+Len-1].
3TVec *GetCol(TMtx *Mtx, int Row, int Col, int Len);Copy the Col-th column elements [Row]..[Row+Len-1] to calling vector.

Overload 1: TVec *GetCol(TMtx *Mtx, int Col);

Copies a column from matrix.

#NameTypeDescription
1MtxTMtx *
2Colint
Remarks:

Copies the Col-th column from Mtx matrix to calling vector. The TVec::Length and TVec::Complex 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
#include "MtxVec.h"
#include "Units.MtxVec.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;

void Example()
{
    TVec* a;
    TMtx* b;

    CreateIt(a);
    CreateIt(b);
    b->SetIt(2, 2, false, DewArray<double>{1, 2, 3, 4});
    a->GetCol(b, 0); // a now contains [1,3]
    FreeIt(a);
    FreeIt(b);
}
See Also: TVec::GetRow, TMtx::SetCol
Declared in Dew::Math::TVec · Dew.Math/MtxVec.h · Cross-compiler

Overload 2: TVec *GetCol(TMtx *Mtx, int Row, int Col, int Index, int Len);

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

#NameTypeDescription
1MtxTMtx *
2Rowint
3Colint
4Indexint
5Lenint
Remarks:

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

Declared in Dew::Math::TVec · Dew.Math/MtxVec.h · Cross-compiler

Overload 3: TVec *GetCol(TMtx *Mtx, int Row, int Col, int Len);

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

#NameTypeDescription
1MtxTMtx *
2Rowint
3Colint
4Lenint
Remarks:

The TVec::Length and TVec::Complex properties of calling vector are adjusted automatically. An exception is raised if condition checking is enabled and column array borders are overrun.

Declared in Dew::Math::TVec · Dew.Math/MtxVec.h · Cross-compiler