Overload List
| # | Signature | Description |
|---|---|---|
| 1 | TMtxInt *Resize(TMtxInt *Src, int NewRows, int NewCols) const; | Sizes the calling matrix to NewRows and NewCols. |
| 2 | TMtxInt *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.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxInt * | |
| 2 | NewRows | int | |
| 3 | NewCols | int |
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.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | NewRows | int | |
| 2 | NewCols | int |
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