Overload List
| # | Signature | Description |
|---|---|---|
| 1 | constructor Create(const Src: TVec); | Uses TVec object as internal storage. |
| 2 | constructor Create(FromObjectCache: Boolean); | Constructor of the record. |
| 3 | constructor Create(const ALength: Integer; const aFloatPrecision: TMtxFloatPrecision); | Internally creates TVec object without using object cache. |
| 4 | constructor Create(const ALength: Integer; const aIsComplex: Boolean; const aIsDouble: Boolean); | Constructor of the record. |
Overload 1: constructor Create(const Src: TVec);
Uses TVec object as internal storage.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec |
Result: stored in self (calling object)
The resulting Vector will own Src object of TVec type and will release it once Vector gets out of scope.
Overload 2: constructor Create(FromObjectCache: Boolean);
Constructor of the record.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | FromObjectCache | Boolean |
Result: stored in self (calling object)
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: constructor Create(const ALength: Integer; const aFloatPrecision: TMtxFloatPrecision);
Internally creates TVec object without using object cache.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ALength | Integer | |
| 2 | aFloatPrecision | TMtxFloatPrecision |
Result: stored in self (calling object)
Creates TVec object without using object cache. Suitable for declaring global variables.
Overload 4: constructor Create(const ALength: Integer; const aIsComplex: Boolean; const aIsDouble: Boolean);
Constructor of the record.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ALength | Integer | |
| 2 | aIsComplex | Boolean | |
| 3 | aIsDouble | Boolean |
Result: stored in self (calling object)
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.
var a,b: Vector;
bvec: TVec;
begin
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
end;
end;