TMtxInt.Resize Method

Overload List

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

Overload 1: function Resize(const Src: TMtxInt; NewRows: Integer; NewCols: Integer): TMtxInt;

Performs resize of the calling matrix to NewRows and NewCols.

#NameTypeDescription
1SrcTMtxInt
2NewRowsInteger
3NewColsInteger

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

Remarks:

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

Overload 2: function Resize(NewRows: Integer; NewCols: Integer): TMtxInt;

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

#NameTypeDescription
1NewRowsInteger
2NewColsInteger

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

Remarks:

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

Examples
var  A,B: TMtxInt;
begin
    CreateIt(A,B);
    try
        A.SetIt(2,2,[1,3,
            2,4]);
        B.Resize(A,3,2,True);
        // B becomes:
        // [1,2,0,
        //  3,4,0]);
    finally
        FreeIt(A,B);
    end;
end;
See Also: TMtxInt.Size