TOpenCLVector.Product Method

Overload List

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

Overload 1: function Product: Double;

Elements product.

Returns: Double - the product of all calling object elements

Remarks:
X=k=0V.Length1V[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: Integer; Len: Integer): Double;

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.

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

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

Calculate the product of all calling object complex elements.

#NameTypeDescription
1XTCplx

Result: stored in self (calling object)

Remarks:

Store the result in complex variable X.

Indexed: procedure Product(out X: TCplx; Index: Integer; Len: Integer);

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

#NameTypeDescription
1XTCplx
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);

Calculate the product of all calling object elements.

#NameTypeDescription
1XDouble

Result: stored in self (calling object)

Remarks:

Store the result in real variable X.

Indexed: procedure Product(out X: Double; Index: Integer; Len: Integer);

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

#NameTypeDescription
1XDouble
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.