TOpenCLVector.Sign Method

Overload List

#SignatureDescription
1function Sign: TOpenCLMtxVec; overload;Changes elements sign.
└ indexed: function Sign(Index,Len: integer): TOpenCLMtxVec; overload;
2function Sign(const X: TOpenCLMtxVec): TOpenCLMtxVec; overload;Change all X object elements sign.
└ indexed: function Sign(const X: TOpenCLMtxVec; XIndex,Index,Len: integer): TOpenCLMtxVec; overload;

Overload 1: function Sign: TOpenCLMtxVec; overload;

Changes elements sign.

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

Remarks:

Changes all calling object elements sign (v -> -v) in-place.

Examples
var a: clVector;
begin
    a.CopyFromArray(TSingleArray.Create(1,2,-3,4));
    a.Sign; // a = [-1,-2,3,-4]
end;

Indexed: function Sign(Index,Len: integer): TOpenCLMtxVec; overload;

Change calling object elements [Index]..[Index+Len-1] sign in-place.

#NameTypeDescription
1Indexintegerstart index
2Lenintegerelement count

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

Remarks:

An exception is raised if array borders are overrun or underrun.

Overload 2: function Sign(const X: TOpenCLMtxVec): TOpenCLMtxVec; overload;

Change all X object elements sign.

#NameTypeDescription
1XTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix

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

Remarks:

Store the results in calling object. Size and TOpenCLBase.Complex properties of calling object are adjusted automatically.

Indexed: function Sign(const X: TOpenCLMtxVec; XIndex,Index,Len: integer): TOpenCLMtxVec; overload;

Change X object elements [XIndex]..[XIndex+Len-1] sign.

#NameTypeDescription
1XTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2XIndexintegerX start index
3Indexintegerstart index
4Lenintegerelement count

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

Remarks:

Store the results in callingobject elements [Index]..[Index+Len-1]. An exception is raised if array borders are overrun or underrun.