TMtx::Resize Method

Overload List

#SignatureDescription
1TMtx *Resize(int NewRows, int NewCols);Resizes the matrix, while preserving the values in already allocated memory.
2TMtx *Resize(TMtx *Src, int NewRows, int NewCols);Performs resize of the calling matrix to NewRows and NewCols.

Overload 1: TMtx *Resize(int NewRows, int NewCols);

Resizes the matrix, while preserving the values in already allocated memory.

#NameTypeDescription
1NewRowsint
2NewColsint
Remarks:

Sets the TMtx::Rows property to NewRows, TMtx::Cols property to NewCols, while preserving the values in already allocated memory.

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

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

void Example()
{
    TMtx *A, *B;

    CreateIt(A, B);
    A->SetIt(2, 2, false, DewArray<double>{1, 3,
        2, 4});
    B->Resize(A, 3, 2);
    // B becomes:
    // [1,3,
    //  2,4,
    //  undef,undef]
    FreeIt(A, B);
}
See Also: TMtx::Size
Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler

Overload 2: TMtx *Resize(TMtx *Src, int NewRows, int NewCols);

Performs resize of the calling matrix to NewRows and NewCols.

#NameTypeDescription
1SrcTMtx *
2NewRowsint
3NewColsint
Remarks:

Copies the Src matrix values to the calling matrix. The elements outside the newly created matrix size are not referenced.

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