Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Resize(const Src: TMtxInt; NewRows: Integer; NewCols: Integer): TMtxInt; | Sizes the calling matrix to NewRows and NewCols. |
| 2 | function 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;
Sizes the calling matrix to NewRows and NewCols.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxInt | |
| 2 | NewRows | Integer | |
| 3 | NewCols | Integer |
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: function Resize(NewRows: Integer; NewCols: Integer): TMtxInt;
Resizes the matrix, while preserving the values in already allocated memory.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | NewRows | Integer | |
| 2 | NewCols | Integer |
Result: stored in self (calling object), returns self for chaining
Remarks:
Sets the MatrixInt.Rows property to NewRows, MatrixInt.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);
// B becomes:
// [1,2,0,
// 3,4,0]);
finally
FreeIt(A,B);
end;
end;
See Also: MatrixInt.Size