Vector.Copy Method

Overload List

#SignatureDescription
1function Copy(const Vec: TMtxVec): TMtxVec; overload;Copy object values.
└ indexed: function Copy(const Vec: TMtxVec; VecIndex, Index, Len: integer): TMtxVec; overload;
2function Copy(const Src: TMtxVec; const dstFloatPrecision: TMtxFloatPrecision): TMtxVec; overload;Copy object values.
3function Copy(const Vec1,Vec2: TMtxVec): TVec; overload;Copies values from Vec1 and Vec2 (concatenate).
4function Copy(const Src: TVecInt):TMtxVec; overload;Copy and convert values from TVecInt.
└ indexed: function Copy(const Src: TVecInt; SrcIndex, Index, Len: integer):TMtxVec; overload;
5function Copy(const Src: TVecInt; const dstFloatPrecision: TMtxFloatPrecision):TMtxVec; overload;Copy and convert values from TVecInt.

Overload 1: function Copy(const Vec: TMtxVec): TMtxVec; overload;

Copy object values.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx

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

Remarks:

Copy each of Vec elements to the calling object. Size and Vector.Complex properties of the calling object are set implicitly to match Vec object.

Examples
var a,b,c: Vector;
begin
    a := [Cplx(1,2),Cplx(3,4)];  // a = [1,2,3,4]
    b.Copy(a);                // b = [1,2,3,4]
    c.Copy(a,b);  //concatenate a and b and store in c = [1,2,3,4,1,2,3,4]
end;
See Also: Vector.Assign

Indexed: function Copy(const Vec: TMtxVec; VecIndex, Index, Len: integer): TMtxVec; overload;

Copy Vec elements [VecIndex]..[VecIndex+Len-1] in the calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2VecIndexinteger
3Indexintegerstart index
4Lenintegerelement count

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

Remarks:

Size and Vector.Complex properties must be set explicitly. An exception is raised if Vector.ConditionCheck is True and array borders are overrun or underrun.

Overload 2: function Copy(const Src: TMtxVec; const dstFloatPrecision: TMtxFloatPrecision): TMtxVec; overload;

Copy object values.

#NameTypeDescription
1SrcTMtxVecsource TVec or TMtx
2dstFloatPrecisionTMtxFloatPrecision

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

Remarks:

Copy each of Src elements to the calling object. Size and Vector.Complex properties of the calling object are set implicitly to match Src object.

Examples
var a,b,c: Vector;
begin
    a := [Cplx(1,2),Cplx(3,4)];  // a = [1,2,3,4]
    b.Copy(a, mvSingle);               // convert to single precision
end;
See Also: Vector.Assign

Overload 3: function Copy(const Vec1,Vec2: TMtxVec): TVec; overload;

Copies values from Vec1 and Vec2 (concatenate).

#NameTypeDescription
1Vec1TMtxVecsource TVec or TMtx
2Vec2TMtxVecsource TVec or TMtx

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

Remarks:

Copy each of Vec1 and Vec2 elements to the calling vector (concatenate). The Vector.Length and Vector.Complex properties of the calling vector are set implicitly to match Vec1 and Vec2 vector.

Examples
var a,b,c: Vector;
begin
    a := [Cplx(1,2),Cplx(3,4)];
    b.Copy(a);
    c.Copy(a,b);  //concatenate a and b and store in c
    // c = [1,2,3,4,1,2,3,4]
end;
See Also: Vector.Assign

Overload 4: function Copy(const Src: TVecInt):TMtxVec; overload;

Copy and convert values from TVecInt.

#NameTypeDescription
1SrcTVecIntsource TVecInt

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

Remarks:

Applies appropriate conversion and copy data from TVecInt. Existing value of FloatPrecision is preserved.

Indexed: function Copy(const Src: TVecInt; SrcIndex, Index, Len: integer):TMtxVec; overload;

Copy and convert values from TVecInt at indexes [SrcIndex]...[SrcIndex+Len-1].

#NameTypeDescription
1SrcTVecIntsource TVecInt
2SrcIndexintegersource start index
3Indexintegerstart index
4Lenintegerelement count

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

Remarks:

Applies appropriate conversion and copy data from TVecInt. The results are stored in calling object elements [Index]...[Index+Len-1]. Size and Vector.Complex properties of the calling object must be set explicitly. An exception is raised if array borders are overrun.

Overload 5: function Copy(const Src: TVecInt; const dstFloatPrecision: TMtxFloatPrecision):TMtxVec; overload;

Copy and convert values from TVecInt.

#NameTypeDescription
1SrcTVecIntsource TVecInt
2dstFloatPrecisionTMtxFloatPrecision

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

Remarks:

Applies appropriate conversion and copy data from TVecInt.