Matrix.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 and store the result in real variable X.
└ 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:

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

Examples
var a: Matrix;
    c: double;
begin
    a.SetIt(1,4,False,[1,2,3,4]);
    c := a.Product; // c= 24
end;
var
    a: Matrix;
    result: double;
begin
    a := [[1.0, 2.0], [3.0, 4.0]];
    result := a.Product;
    if Abs(result - 24.0) > 1e-10 then
        raise Exception.Create('Matrix.Product: expected 24.0, got ' + result.ToString);
end;
See Also: Matrix.Productc

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.

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 and store the result in real variable X.

#NameTypeDescription
1XDouble

Result: stored in self (calling object)

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

Calculate the product for calling object elements [Index]..[Index+Len-1] and store the result in real variable X.

#NameTypeDescription
1XDouble
2IndexIntegerstart index
3LenIntegerelement count

Result: stored in self (calling object)

Remarks:

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