TOpenCLVector.Product Method

Overload List

#SignatureDescription
1function Product: double; overload;Elements product.
└ indexed: function Product(Index,Len: integer): double; overload;
2procedure Product(out X: TCplx); overload;Calculate the product of all calling object complex elements.
└ indexed: procedure Product(out X: TCplx; Index,Len: integer); overload;
3procedure Product(out X: double); overload;Calculate the product of all calling object elements.
└ indexed: procedure Product(out X: double; Index,Len: integer); overload;

Overload 1: function Product: double; overload;

Elements product.

Returns: double - the product of all calling object elements

Remarks:
X=∏k=0V.Length−1V[k]X = \prod _{k=0} ^{\text{V.Length}-1} \text{V}[k]

An exception is raised if calling object TOpenCLBase.Complex property is true.

Examples
var a: clVector;
    c: double;
begin
    a.CopyFromArray(TDoubleArray.Create(1,2,3,4));
    c := a.Product; // c= 24
end;

Indexed: function Product(Index,Len: integer): double; overload;

Returns the product for calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1Indexintegerstart index
2Lenintegerelement count

Returns: double

Remarks:

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

Overload 2: procedure Product(out X: TCplx); overload;

Calculate the product of all calling object complex elements.

#NameTypeDescription
1XTCplxscalar

Result: stored in self (calling object)

Remarks:

Store the result in complex variable X.

Indexed: procedure Product(out X: TCplx; Index,Len: integer); overload;

Calculate the product for calling object complex elements [Index]..[Index+Len-1].

#NameTypeDescription
1XTCplxscalar
2Indexintegerstart index
3Lenintegerelement count

Result: stored in self (calling object)

Remarks:

Store the result in complex variable X. An exception is raised if array borders are overrun or underrun.

Overload 3: procedure Product(out X: double); overload;

Calculate the product of all calling object elements.

#NameTypeDescription
1Xdoublescalar

Result: stored in self (calling object)

Remarks:

Store the result in real variable X.

Indexed: procedure Product(out X: double; Index,Len: integer); overload;

Calculate the product for calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1Xdoublescalar
2Indexintegerstart index
3Lenintegerelement count

Result: stored in self (calling object)

Remarks:

Store the result in real variable X. An exception is raised if array borders are overrun or underrun.