TVec.Size Method

Overload List

#SignatureDescription
1TMtxVec Size(TMtxVecBase Src, TMtxFloatPrecision aFloatPrecision)Sets vector size.
2TMtxVec Size(TMtxVecBase Src, Boolean AComplex)Sets vector size.
3TVec Size(Int32 ALength)Sizes the vector.
4TVec Size(Int32 ALength, TMtxFloatPrecision aFloatPrecision)Sets the size of the vector.
5TVec Size(Int32 ALength, TMtxVec FloatRef)Sets the size of the vector.
6TVec Size(Int32 ALength, Boolean AComplex)Sets the size of the vector.
7TVec Size(Int32 ALength, Boolean AComplex, Boolean aIsDouble)Sets the size of the vector.
8TMtxVec Size(TMtxVecBase Src)Size the object.

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

Sets vector size.

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

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

Remarks:

Length is set to Src.Length and precision is set to aFloatPrecision.

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

Sets vector size.

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

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

Remarks:

Length is set to Src.Length and Complex property to AComplex. Floating point precision is obtained from Src. If Src is integer type (TVecInt, TMtxInt), the existing floating point precision is preserved.

Overload 3: TVec Size(Int32 ALength)

Sizes the vector.

#NameTypeDescription
1ALengthInt32

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

Remarks:

Sets the following properties:

Length := ALength; Complex := false;

Existing floating point precision is preserved.

Calling the Size method does not preserve the contents of the vector. Use the Resize method, if you want to preserve existing values.

Overload 4: TVec Size(Int32 ALength, TMtxFloatPrecision aFloatPrecision)

Sets the size of the vector.

#NameTypeDescription
1ALengthInt32
2aFloatPrecisionTMtxFloatPrecision

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

Remarks:

Same as the following code:

Vec.FloatPrecision := aFloatPrecision; Vec.Length := ALength;

Calling the Size method does not preserve the contents of the vector. Use the Resize method, if you want to preserve existing values.

Overload 5: TVec Size(Int32 ALength, TMtxVec FloatRef)

Sets the size of the vector.

#NameTypeDescription
1ALengthInt32
2FloatRefTMtxVecsource TVec or TMtx

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

Remarks:

Same as the following code:

Vec.FloatPrecision := FloatRef.FloatPrecision; Vec.Length := ALength;

Calling the Size method does not preserve the contents of the vector. Use the Resize method, if you want to preserve existing values.

Overload 6: TVec Size(Int32 ALength, Boolean AComplex)

Sets the size of the vector.

#NameTypeDescription
1ALengthInt32
2AComplexBoolean

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

Remarks:

Same as the following code:

Vec.Length := ALength; Vec.Complex := AComplex;

Calling the Size method does not preserve the contents of the vector. Use the Resize method, if you want to preserve existing values.

Existing floating point precision is preserved.

Overload 7: TVec Size(Int32 ALength, Boolean AComplex, Boolean aIsDouble)

Sets the size of the vector.

#NameTypeDescription
1ALengthInt32
2AComplexBoolean
3aIsDoubleBoolean

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

Remarks:

Same as the following code:

if aIsDouble then begin if aComplex then Size(aLength, mvDoubleComplex) else Size(aLength, mvDouble); end else begin if aComplex then Size(aLength, mvSingleComplex) else Size(aLength, mvSingle); end;

Calling the Size method does not preserve the contents of the vector. Use the Resize method, if you want to preserve existing values.

Overload 8: 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.