TMtxSmallInt::Resize Method

Overload List

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

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

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

#NameTypeDescription
1NewRowsint
2NewColsint
Remarks:

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

Examples
#include "MtxVecInt.h"
#include "Units.MtxVecInt.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVecInt;

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

    CreateIt(A, B);
    A->SetIt(2, 2, DewArray<int>{1, 3,
        2, 4});
    B->Resize(A, 3, 2);
    // B becomes:
    // [1,3,
    //  2,4,
    //  ?,?]  (Resize does not set the values of the new row)
    FreeIt(A, B);
}
See Also: TMtxSmallInt::Size
Declared in Dew::Math::TMtxInt · Dew.Math/MtxVecInt.h · Cross-compiler

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

Performs resize of the calling matrix to NewRows and NewCols.

#NameTypeDescription
1SrcTMtxInt *
2NewRowsint
3NewColsint
Remarks:

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

Declared in Dew::Math::TMtxInt · Dew.Math/MtxVecInt.h · Cross-compiler