clVector.Product Method

Overload List

#SignatureDescription
1Double ProductElements product.
└ indexed: Double Product(Int32 Index, Int32 Len)
2void Product(ref TCplx X)Calculate the product of all calling object complex elements.
└ indexed: void Product(ref TCplx X, Int32 Index, Int32 Len)
3void Product(ref Double X)Calculate the product of all calling object elements.
└ indexed: void Product(ref Double X, Int32 Index, Int32 Len)

Overload 1: Double Product

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 Dew.Math.clVector.Complex property is true.

Examples
using Dew.Math;
using Dew.Math.Units;

namespace Dew.Examples
{
    void Example()
    {
        TOpenCLVector a;
        clMtxVec.CreateIt(out a);
        try
        {
            a.CopyFromArray(new double[] {1,2,3,4});
            double c = a.Product(); // c= 24
        }
        finally
        {
            clMtxVec.FreeIt(ref a);
        }
    }
}
See Also: clVector.Productc

Indexed: Double Product(Int32 Index, Int32 Len)

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

#NameTypeDescription
1IndexInt32start index
2LenInt32element count

Returns: Double

Remarks:

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

Overload 2: void Product(ref TCplx X)

Calculate the product of all calling object complex elements.

#NameTypeDescription
1XTCplx (ref)output

Result: stored in self (calling object)

Remarks:

Store the result in complex variable X.

Indexed: void Product(ref TCplx X, Int32 Index, Int32 Len)

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

#NameTypeDescription
1XTCplx (ref)output
2IndexInt32start index
3LenInt32element 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: void Product(ref Double X)

Calculate the product of all calling object elements.

#NameTypeDescription
1XDouble (ref)output

Result: stored in self (calling object)

Remarks:

Store the result in real variable X.

Indexed: void Product(ref Double X, Int32 Index, Int32 Len)

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

#NameTypeDescription
1XDouble (ref)output
2IndexInt32start index
3LenInt32element 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.