Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Size(const Src: TMtxVecBase): TMtxInt; | Size the object. |
| 2 | function Size(const Src: TMtxVecBase; const aPrecision: TIntPrecision): TMtxInt; | Size the object. |
| 3 | function Size(const ARows: Integer; const ACols: Integer): TMtxInt; | Specifies size of an integer matrix. |
| 4 | function Size(const ARows: Integer; const ACols: Integer; const aPrecision: TIntPrecision): TMtxInt; | Sets the size of matrix. |
Overload 1: function Size(const Src: TMtxVecBase): TMtxInt;
Size the object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxVecBase |
Result: stored in self (calling object), returns self for chaining
Assigns the size of the Src object to the calling object. If both objects have a matching MatrixInt.Length, MatrixInt.Rows, MatrixInt.Cols properties, only the MatrixInt.IntPrecision property of the calling object will changed, while all other properties describing the size of the object will be preserved.
Overload 2: function Size(const Src: TMtxVecBase; const aPrecision: TIntPrecision): TMtxInt;
Size the object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxVecBase | |
| 2 | aPrecision | TIntPrecision |
Result: stored in self (calling object), returns self for chaining
Assigns the size of the Src object to the calling object and changes the IntPrecision to new value.
Overload 3: function Size(const ARows: Integer; const ACols: Integer): TMtxInt;
Specifies size of an integer matrix.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ARows | Integer | |
| 2 | ACols | Integer |
Result: stored in self (calling object), returns self for chaining
The Value of IntPrecision property is preserved.
Overload 4: function Size(const ARows: Integer; const ACols: Integer; const aPrecision: TIntPrecision): TMtxInt;
Sets the size of matrix.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ARows | Integer | |
| 2 | ACols | Integer | |
| 3 | aPrecision | TIntPrecision |
Result: stored in self (calling object), returns self for chaining
Set the calling matrix properties:
- MatrixInt.Rows = ARows,
- MatrixInt.Cols = ACols
Calling the Size method does not preserve the contents of the matrix. Use the Resize method, if you want to preserve existing values.
Note
The Size method performs an out-of-memory safe resize, if the matrix already has memory allocated. This prevents out of memory message for example when redefining the size of the matrix from single column to single row:
A.Rows := 10000; // matrix size = 0 A.Cols := 1; // matrix size = 10000 // ... A.Cols := 10000; // matrix size = 100 000 000 (problems here) A.Rows := 1; // matrix size = 10 000
var A: TMtxInt;
begin
CreateIt(A);
try
A.Size(2,1); // 2x1 integer matrix
A.SetZero;
// A becomes:
// [0]
// [0]
finally
FreeIt(A);
end;
end;