MatrixInt::Resize Method

Overload List

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

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

Sizes the calling matrix to NewRows and NewCols.

#NameTypeDescription
1SrcTMtxInt *
2NewRowsint
3NewColsint
Remarks:

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

Examples
#include "MtxExprInt.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    MatrixInt A, B;

    A = {{1, 3}, {2, 4}};
    B.Resize(A, 3, 2);
    // B becomes:
    // [1,2,0,
    //  3,4,0]);
}
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler

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

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

#NameTypeDescription
1NewRowsint
2NewColsint
Remarks:

Sets the MatrixInt::Rows property to NewRows, MatrixInt::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,2,0,
    //  3,4,0]);
    FreeIt(A, B);
}
See Also: MatrixInt::Size
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler