MatrixInt.Size Method

Overload List

#SignatureDescription
1TMtxInt Size(TMtxVecBase Src)Size the object.
2TMtxInt Size(TMtxVecBase Src, TIntPrecision aPrecision)Size the object.
3TMtxInt Size(Int32 ARows, Int32 ACols)Specifies size of an integer matrix.
4TMtxInt Size(Int32 ARows, Int32 ACols, TIntPrecision aPrecision)Sets the size of matrix.

Overload 1: TMtxInt Size(TMtxVecBase Src)

Size the object.

#NameTypeDescription
1SrcTMtxVecBasesource TVec, TMtx, TVecInt or TMtxInt

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

Remarks:

Assigns the size of the Src object to the calling object. If both objects have a matching Dew.Math.MatrixInt.Length, Dew.Math.MatrixInt.Rows, Dew.Math.MatrixInt.Cols properties, only the Dew.Math.MatrixInt.IntPrecision property of the calling object will changed, while all other properties describing the size of the object will be preserved.

Overload 2: TMtxInt Size(TMtxVecBase Src, TIntPrecision aPrecision)

Size the object.

#NameTypeDescription
1SrcTMtxVecBasesource TVec, TMtx, TVecInt or TMtxInt
2aPrecisionTIntPrecision

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

Remarks:

Assigns the size of the Src object to the calling object and changes the IntPrecision to new value.

Overload 3: TMtxInt Size(Int32 ARows, Int32 ACols)

Specifies size of an integer matrix.

#NameTypeDescription
1ARowsInt32
2AColsInt32

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

Remarks:

The Value of IntPrecision property is preserved.

Overload 4: TMtxInt Size(Int32 ARows, Int32 ACols, TIntPrecision aPrecision)

Sets the size of matrix.

#NameTypeDescription
1ARowsInt32
2AColsInt32
3aPrecisionTIntPrecision

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

Remarks:

Set the calling matrix properties:

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
Examples
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);
    }
See Also: MatrixInt.Rows, MatrixInt.Cols, TMtxVecInt.IntPrecision