Overload List
| # | Signature | Description |
|---|---|---|
| 1 | double Product(); | Elements product. |
| 2 | double Product(int Index, int Len); | Returns the product for calling object elements [Index]..[Index+Len-1]. |
| 3 | void Product(TCplx &X); | Calculate the product of all calling object complex elements. |
| 4 | void Product(TCplx &X, int Index, int Len); | Calculate the product for calling object complex elements [Index]..[Index+Len-1]. |
| 5 | void Product(double &X); | Calculate the product of all calling object elements. |
| 6 | void Product(double &X, int Index, int Len); | Calculate the product for calling object elements [Index]..[Index+Len-1]. |
Overload 1: double Product();
Elements product.
Returns: the product of all calling object elements
An exception is raised if calling object TSparseMtx::Complex property is true.
#include "MtxVec.h"
#include "Units.MtxVec.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;
void Example()
{
TVec* a;
CreateIt(a);
a->SetIt(false, DewArray<double>{1, 2, 3, 4});
double c = a->Product(); // c= 24
FreeIt(a);
}
#include "MtxExpr.h"
#include "Units.Math387.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;
void Example()
{
Vector a;
a.SetIt(DewArray<double>{ 1.0, 2.0, 3.0, 4.0 });
double result = a.Product();
if (Abs(result - 24.0) > 1e-10)
throw tException(DewString("Vector.Product: expected 24.0, got ") + SampleToStr(result));
}
Overload 2: double Product(int Index, int Len);
Returns the product for calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | int | |
| 2 | Len | int |
An exception is raised if array borders are overrun or underrun.
Overload 3: void Product(TCplx &X);
Calculate the product of all calling object complex elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TCplx & |
Store the result in complex variable X.
Overload 4: void Product(TCplx &X, int Index, int Len);
Calculate the product for calling object complex elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TCplx & | |
| 2 | Index | int | |
| 3 | Len | int |
Store the result in complex variable X. An exception is raised if array borders are overrun or underrun.
Overload 5: void Product(double &X);
Calculate the product of all calling object elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | double & |
Store the result in real variable X.
Overload 6: void Product(double &X, int Index, int Len);
Calculate the product for calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | double & | |
| 2 | Index | int | |
| 3 | Len | int |
Store the result in real variable X. An exception is raised if array borders are overrun or underrun.