TMtx.Size Method

Overload List

#SignatureDescription
1TMtx Size(Int32 ARows, Int32 ACols)Sets the size of matrix.
2TMtx Size(Int32 ARows, Int32 ACols, TMtxFloatPrecision aFloatPrecision)Sets the size of matrix.
3TMtx Size(Int32 ARows, Int32 ACols, Boolean AComplex)Sets the size of matrix.
4TMtx Size(Int32 ARows, Int32 ACols, Boolean AComplex, Boolean aIsDouble)Sets the size of matrix.
5TMtxVec Size(TMtxVecBase Src)Size the object.
6TMtxVec Size(TMtxVecBase Src, TMtxFloatPrecision aFloatPrecision)Allows the floatPrecision and complex properties of the calling object to become of aFloatPrecision value instead of Src.FloatPrecision and Src.Complex value.
7TMtxVec Size(TMtxVecBase Src, Boolean AComplex)Allows the complex property of the calling object to become of AComplex value instead of Src.Complex value.
8TMtx Size(Int32 ARows, Int32 ACols, TMtxVec FloatPrecisionRef)Sets the size of matrix.

Overload 1: TMtx Size(Int32 ARows, Int32 ACols)

Sets the size of matrix.

#NameTypeDescription
1ARowsInt32
2AColsInt32

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.

The existing floating point precision is preserved.

See Also: TMtx.Rows, TMtx.Cols, TMtxVec.Complex

Overload 2: TMtx Size(Int32 ARows, Int32 ACols, TMtxFloatPrecision aFloatPrecision)

Sets the size of matrix.

#NameTypeDescription
1ARowsInt32
2AColsInt32
3aFloatPrecisionTMtxFloatPrecision

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

Remarks:

Set the calling matrix properties:

If the aFloatPrecision parameter is omitted, the default value mvDouble is used. 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.

Overload 3: TMtx Size(Int32 ARows, Int32 ACols, Boolean AComplex)

Sets the size of matrix.

#NameTypeDescription
1ARowsInt32
2AColsInt32
3AComplexBoolean

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.

The existing floating point precision is preserved.

See Also: TMtx.Rows, TMtx.Cols, TMtxVec.Complex

Overload 4: TMtx Size(Int32 ARows, Int32 ACols, Boolean AComplex, Boolean aIsDouble)

Sets the size of matrix.

#NameTypeDescription
1ARowsInt32
2AColsInt32
3AComplexBoolean
4aIsDoubleBoolean

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
TMtx A;
MtxVec.CreateIt(out A);
try
    {
        A.Size(2,1,true, mvDouble); // 2x1 complex matrix
        A.SetZero;
        // A becomes:
        // [0,0]
        // [0,0]
    }
finally
    {
        MtxVec.FreeIt(ref A);
    }
See Also: TMtx.Rows, TMtx.Cols, TMtxVec.Complex

Overload 5: TMtxVec Size(TMtxVecBase Src)

Size the object.

#NameTypeDescription
1SrcTMtxVecBasesource TVec, TMtx, TVecInt or TMtxInt

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

Remarks:

Assignes the size of the Src object to the calling object. If the calling object is a TVec object then the Src can be of any type, otherwise TMtx can only obtain size from a TMtx object and TSparseMtx can only obtain size from a TSparseMtx object.

If the calling object and Src are of different types, the complex property can be different, if both objects have a matching Dew.Math.TMtxVecBase.Length property. In this case only the Complex property of the calling object will changed, while all other properties describing the size of the object (rows, cols, length, nonZeros) will be preserved. This is different from simply setting the Complex property. Changing the Complex property directly would also change the Length, Cols and NonZeros properties.

Overload 6: TMtxVec Size(TMtxVecBase Src, TMtxFloatPrecision aFloatPrecision)

Allows the floatPrecision and complex properties of the calling object to become of aFloatPrecision value instead of Src.FloatPrecision and Src.Complex value.

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

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

Remarks:

It is also possible to pass the calling object as the Src with a different aFloatPrecision value. The value of the FloatPrecision property can be changed without knowing the actual type of the object (matrix of vector).

Overload 7: TMtxVec Size(TMtxVecBase Src, Boolean AComplex)

Allows the complex property of the calling object to become of AComplex value instead of Src.Complex value.

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

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

Remarks:

It is also possible to pass the calling object as the Src with a different AComplex value. The value of the complex property can be changed without knowing the actual type of the object.

Overload 8: TMtx Size(Int32 ARows, Int32 ACols, TMtxVec FloatPrecisionRef)

Sets the size of matrix.

#NameTypeDescription
1ARowsInt32
2AColsInt32
3FloatPrecisionRefTMtxVecsource TVec or TMtx

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

Remarks:

Set the calling matrix properties: