TOpenCLVector.Rem Method

Overload List

#SignatureDescription
1function Rem(const X: TOpenCLMtxVec; const Y: TOpenCLMtxVec): TOpenCLMtxVec;The Reminder after division X/Y.
└ indexed: function Rem(const X: TOpenCLMtxVec; const Y: TOpenCLMtxVec; XIndex: Integer; YIndex: Integer; Index: Integer; Len: Integer): TOpenCLMtxVec;
2function Rem(const X: TOpenCLMtxVec; const Y: Double): TOpenCLMtxVec;Calculates reminder after division X/Y.
└ indexed: function Rem(const X: TOpenCLMtxVec; const Y: Double; XIndex: Integer; Index: Integer; Len: Integer): TOpenCLMtxVec;

Overload 1: function Rem(const X: TOpenCLMtxVec; const Y: TOpenCLMtxVec): TOpenCLMtxVec;

The Reminder after division X/Y.

#NameTypeDescription
1XTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2YTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix

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

Remarks:

Calculates reminder after division according to formula:

x[i]-y[i]*Trunc(x[i]/y[i]).

The results will be saved to the calling vector. X and Y must be a real and have the same length. Size and TOpenCLBase.Complex properties of the calling vector are set implicitly to match the X object.

Examples
var a,b,c: clVector;
begin
    a.CopyFromArray(TSingleArray.Create(0,1,10,-1,-10)); // a = [0, 1, 10,    -1, -10];
    b.CopyFromArray(TSingleArray.Create(0,1,PI,-1,-PI)); // b = [0, 1, PI,    -1, -PI];
    c.Rem(a,b);                     // c = [0, 0, 0.5752, 0, -0.5752]
end;

Indexed: function Rem(const X: TOpenCLMtxVec; const Y: TOpenCLMtxVec; XIndex: Integer; YIndex: Integer; Index: Integer; Len: Integer): TOpenCLMtxVec;

Calculates reminder after division X/Y.

#NameTypeDescription
1XTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2YTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
3XIndexIntegerX start index
4YIndexIntegerY start index
5IndexIntegerstart index
6LenIntegerelement count

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

Remarks:

Calculation uses the following formula:

z[i] = x[xi]-y[yi]*Trunc(x[xi]/y[yi]),

where i in [Index..Index+Len], xi in [XIndex..XIndex+Len], yi in [YIndex..YIndex+Len]. The results will be saved to the calling vector. X must be a real. An exception will be raised if array borders are overrun.

Overload 2: function Rem(const X: TOpenCLMtxVec; const Y: Double): TOpenCLMtxVec;

Calculates reminder after division X/Y.

#NameTypeDescription
1XTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2YDoublescalar

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

Remarks:

Reminder is calculated by using the following formula:

x[i]-y*Trunc(x[i]/y).

X must be a real. The results will be saved to the calling vector. Size and TOpenCLBase.Complex properties of the calling vector are set implicitly to match the X object.

Indexed: function Rem(const X: TOpenCLMtxVec; const Y: Double; XIndex: Integer; Index: Integer; Len: Integer): TOpenCLMtxVec;

Calculates reminder after division X/Y.

#NameTypeDescription
1XTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2YDoublescalar
3XIndexIntegerX start index
4IndexIntegerstart index
5LenIntegerelement count

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

Remarks:

Reminder is calculated by using the following formula:

x[i]-y*Trunc(x[i]/y).

X must be a real. The results will be saved to the calling vector. An exception will be raised if array borders are overrun.