TVec::CopyMtx Method

Overload List

#SignatureDescription
1void CopyMtx(TMtx *Mtx);Copy values from matrix.
2TVec *CopyMtx(TMtx *Mtx, int Index, int Row, int Col, int Len);Desc Copy Mtx elements Values1D[Row*fCols+Col]..Values1D[Row*fCols+Col+Len] in the calling vector elements [Index]..[Index+Len-1].

Overload 1: void CopyMtx(TMtx *Mtx);

Copy values from matrix.

#NameTypeDescription
1MtxTMtx *
Remarks:

Copy each of Mtx TMtx elements to the calling vector. The TVec::Length and TVec::Complex properties of the calling vector are set implicitly to match Mtx matrix. The same can be achieved by calling the TVec::Copy method.

Examples
#include "MtxVec.h"
#include "Units.MtxVec.h"

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

void Example()
{
    TVec *b, *c;
    TMtx* A;

    CreateIt(b, c);
    CreateIt(A);
    A->SetIt(2, 2, false, DewArray<double>{1, 2, 3, 4});
    b->CopyMtx(A); // b = [1,2,3,4]
    FreeIt(A);
    FreeIt(b, c);
}
See Also: TVec::Copy, TVec::Copy
Declared in Dew::Math::TVec · Dew.Math/MtxVec.h · Cross-compiler

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

Desc Copy Mtx elements Values1D[Row*fCols+Col]..Values1D[Row*fCols+Col+Len] in the calling vector elements [Index]..[Index+Len-1].

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

The TVec::Length and TVec::Complex properties must be set explicitly. An exception is raised if TVec::ConditionCheck is True and array borders are overrun or underrun. The same can be achieved by calling the Copy method.

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