Overload List
| # | Signature | Description |
|---|---|---|
| 1 | TMtxInt Size(Int32 ARows, Int32 ACols) | Specifies size of an integer matrix. |
| 2 | TMtxInt Size(Int32 ARows, Int32 ACols, TIntPrecision aPrecision) | Sets the size of matrix. |
| 3 | TMtxVecInt Size(TMtxVecBase Src) | Size the object. |
| 4 | TMtxVecInt Size(TMtxVecBase Src, TIntPrecision aPrecision) | Allows the IntPrecision property of the calling object to become of aPrecision value instead of Src.IntPrecision value. |
Overload 1: TMtxInt Size(Int32 ARows, Int32 ACols)
Specifies size of an integer matrix.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ARows | Int32 | |
| 2 | ACols | Int32 |
Result: stored in self (calling object), returns self for chaining
The Value of IntPrecision property is preserved.
Overload 2: TMtxInt Size(Int32 ARows, Int32 ACols, TIntPrecision aPrecision)
Sets the size of matrix.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ARows | Int32 | |
| 2 | ACols | Int32 | |
| 3 | aPrecision | TIntPrecision |
Result: stored in self (calling object), returns self for chaining
Set the calling matrix properties:
- Dew.Math.TMtxInt.Rows = ARows,
- Dew.Math.TMtxInt.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
TMtxInt A;
MtxVec.CreateIt(out A);
try
{
A.Size(2,1); // 2x1 integer matrix
A.SetZero;
// A becomes:
// [0]
// [0]
}
finally
{
MtxVec.FreeIt(ref A);
}
Overload 3: TMtxVecInt Size(TMtxVecBase Src)
Size the object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxVecBase | source TVec, TMtx, TVecInt or TMtxInt |
Result: stored in self (calling object), returns self for chaining
Assignes the size of the Src object to the calling object. If the calling object is a TVecInt object then the Src can be of any type, otherwise TMtxInt can only obtain size from a TMtxInt object and TSparseMtx can only obtain size from a TSparseMtx object.
If the calling object and Src are of different types and both objects have a matching Dew.Math.TMtxVecBase.Length property only the IntPrecision property of the calling object will changed, while all other properties describing the size of the object (rows, cols, length) will be preserved.
Overload 4: TMtxVecInt Size(TMtxVecBase Src, TIntPrecision aPrecision)
Allows the IntPrecision property of the calling object to become of aPrecision value instead of Src.IntPrecision value.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxVecBase | source TVec, TMtx, TVecInt or TMtxInt |
| 2 | aPrecision | TIntPrecision |
Result: stored in self (calling object), returns self for chaining
It is also possible to pass the calling object as the Src with a different IntPrecision value. The value of the IntPrecision property can be changed without knowing the actual type of the object.