TMtx.Resize Method

Overload List

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

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

Performs resize of the calling matrix to NewRows and NewCols.

#NameTypeDescription
1SrcTMtxsource TMtx
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: TMtx 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.TMtx.Rows property to NewRows, Dew.Math.TMtx.Cols property to NewCols, while preserving the values in already allocated memory.

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