Vector.SetIt Method

Overload List

#SignatureDescription
1function SetIt(AComplex: Boolean; const A: TDoubleArray): TVec;Sets vector values.
2function SetIt(const A: TDoubleArray): TVec;Does not change the Vector.Length or Vector.Complex properties of the calling vector.
└ indexed: function SetIt(Index: Integer; AIndex: Integer; Len: Integer; const A: TDoubleArray): TMtxVec;
3function SetIt(Index: Integer; const A: TDoubleArray): TMtxVec;Sets object values.

Overload 1: function SetIt(AComplex: Boolean; const A: TDoubleArray): TVec;

Sets vector values.

#NameTypeDescription
1AComplexBoolean
2ATDoubleArray

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

Remarks:

SetIt makes the use of open array construction, to set the values of the calling vector. It gives you the possibility to pass large arrays of elements without having to declare constant arrays.

Sets the Vector.Length property of the calling vector to (High(A)+1) and the Vector.Complex property to AComplex. The elements of A array are copied to the calling vector. If AComplex is True then real parts of complex numbers are on even (0,2,4..)and imaginary parts on odd indexes.(1,3,5,..)

Examples
var a: Vector;
begin
    a.SetIt(False,[1,2,3,4]); // a = [1,2,3,4]
end;
See Also: Vector.SetCplx, Vector.SetDouble, Vector.SetSingle, Vector.SetInteger

Overload 2: function SetIt(const A: TDoubleArray): TVec;

Does not change the Vector.Length or Vector.Complex properties of the calling vector.

#NameTypeDescription
1ATDoubleArray

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

Remarks:

It does check for array overrun. The elements of A array are copied to the calling vector, starting at Index 0. If the calling vector is complex then real parts of complex numbers are on even (0,2,4..)and imaginary parts on odd indexes.(1,3,5,..)

Indexed: function SetIt(Index: Integer; AIndex: Integer; Len: Integer; const A: TDoubleArray): TMtxVec;

The elements of A array, starting at aIndex, are copied to the calling object elements, starting at Index.

#NameTypeDescription
1IndexIntegerstart index
2AIndexIntegerstart index
3LenIntegerelement count
4ATDoubleArray

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

Remarks:

If the calling object is complex, then real parts of complex numbers in the A array are on even (0,2,4..) and imaginary parts on odd indexes.(1,3,5,..).

Overload 3: function SetIt(Index: Integer; const A: TDoubleArray): TMtxVec;

Sets object values.

#NameTypeDescription
1IndexIntegerstart index
2ATDoubleArray

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

Remarks:

Set object values. Method call does not change object's size or Vector.Complex property, but it does check for array overrun. The elements of A array are copied to the calling object elements, starting at Index. If the calling object is complex, then real parts of complex numbers are on even (0,2,4..) and imaginary parts on odd indexes.(1,3,5,..).