Vector.Vector Constructor

Overload List

#SignatureDescription
1Vector(TVec Src)Uses TVec object as internal storage.
2Vector(Boolean FromObjectCache)Constructor of the record.
3Vector(Int32 ALength, TMtxFloatPrecision aFloatPrecision)Internally creates TVec object without using object cache.
4Vector(Int32 ALength, Boolean aIsComplex, Boolean aIsDouble)Constructor of the record.

Overload 1: Vector(TVec Src)

Uses TVec object as internal storage.

#NameTypeDescription
1SrcTVecsource TVec

Result: stored in self (calling object)

Remarks:

The resulting Vector will own Src object of TVec type and will release it once Vector gets out of scope.

Overload 2: Vector(Boolean FromObjectCache)

Constructor of the record.

#NameTypeDescription
1FromObjectCacheBoolean

Result: stored in self (calling object)

Remarks:

Returns a Vector with internal TVec object created from object cache (CreateIt), if FromObjectCache is True. Pass false to the constructor, if the variable is a global variable. Object cache has limited size and is to be used only for local variables.

Overload 3: Vector(Int32 ALength, TMtxFloatPrecision aFloatPrecision)

Internally creates TVec object without using object cache.

#NameTypeDescription
1ALengthInt32
2aFloatPrecisionTMtxFloatPrecision

Result: stored in self (calling object)

Remarks:

Creates TVec object without using object cache. Suitable for declaring global variables.

Overload 4: Vector(Int32 ALength, Boolean aIsComplex, Boolean aIsDouble)

Constructor of the record.

#NameTypeDescription
1ALengthInt32
2aIsComplexBoolean
3aIsDoubleBoolean

Result: stored in self (calling object)

Remarks:

Returns a Vector with internal TVec object created explicitely with Length property set to aLength and Complex property set to IsComplex. Call this constructor, if the Vector type variable is a global variable with a long life span.

Examples
Vector a;
Vector b;
TVec bvec;
a = Vector.Create(true); //create from object cache via CreateIt

//this constructor can be omitted, because it is implictely called
//the first time that the variable is used.
//However:

b = Vector.Create(10);

//Similar to

bvec = TVec.Create;
try
    {
        bvec.Size(10);
    }
finally
    {
        bvec.Free;  //b is freed on the exit from the procedure
    }
See Also: TVec.Equal, TMtxVec.IsEqual