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