Vector.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:

Formula:

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.Vector.Complex property is true.

Examples
Vector a = new Vector();
a.SetIt(new double[] { 1.0, 2.0, 3.0, 4.0 });
double result = a.Product();
if (Math.Abs(result - 24.0) > 1e-10)
    throw new Exception("Vector.Product: expected 24.0, got " + result);
Vector a;
double c;
a.SetIt(false,new double[] {1,2,3,4});
c = a.Product; // c= 24
See Also: Vector.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.