MatrixInt.Resize Method

Overload List

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

Overload 1: TMtxInt Resize(TMtxInt Src, Int32 NewRows, Int32 NewCols)

Sizes the calling matrix to NewRows and NewCols.

#NameTypeDescription
1SrcTMtxIntsource TMtxInt
2NewRowsInt32
3NewColsInt32

Result: stored in self (calling object), returns self for chaining

Remarks:

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

Overload 2: TMtxInt Resize(Int32 NewRows, Int32 NewCols)

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

#NameTypeDescription
1NewRowsInt32
2NewColsInt32

Result: stored in self (calling object), returns self for chaining

Remarks:

Sets the Dew.Math.MatrixInt.Rows property to NewRows, Dew.Math.MatrixInt.Cols property to NewCols, while preserving the values in already allocated memory.

Examples
TMtxInt A;
TMtxInt B;
MtxVec.CreateIt(out A, out B);
try
    {
        A.SetIt(2,2,[1,3,
        2,4]);
        B.Resize(A,3,2);
        // B becomes:
        // [1,2,0,
        //  3,4,0]);
    }
finally
    {
        MtxVec.FreeIt(ref A, ref B);
    }
See Also: MatrixInt.Size