Overload List
Overload 1: TMtxVec *MulAndDiv(TMtxVec *X, TMtxVec *Y, TMtxVec *Z) const;
Compute X * Y / Z
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * |
Examples
#include "MtxExpr.h"
#include "Units.Math387.h"
#include "Units.MtxExpr.h"
#include "Units.MtxVec.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;
using namespace Dew::Math::Units::MtxExpr;
using namespace Dew::Math::Units::MtxVec;
void Example()
{
Vector X, Y, Z, A1, A2, A3;
double xyScale;
xyScale = 1.5;
X = {2, 4, 6, 8};
Y = {1, 1, 1, 1};
Z = {2, 2, 2, 2};
A1 = (X * Y * xyScale) / Z;
A2 = MulAndDiv(X, Y, xyScale, Z);
A3.MulAndDiv(X, Y, xyScale, Z);
if (!A2.IsEqual(A1))
ERaise("Problem");
if (!A3.IsEqual(A1))
ERaise("Problem");
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler
Overload 2: TMtxVec *MulAndDiv(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, TMtxVec *Z, int zIndex, int Index, int Len) const;
Compute X * Y / Z on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | Z | TMtxVec * | |
| 6 | zIndex | int | |
| 7 | Index | int | |
| 8 | Len | int |
Examples
#include "MtxExpr.h"
#include "Units.Math387.h"
#include "Units.MtxExpr.h"
#include "Units.MtxVec.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;
using namespace Dew::Math::Units::MtxExpr;
using namespace Dew::Math::Units::MtxVec;
void Example()
{
Vector X, Y, A1, A2, A3;
double zScalar;
zScalar = 2.0;
X = {3, 6, 9, 12};
Y = {1, 2, 3, 4};
A1 = (X * Y) / zScalar;
A2 = MulAndDiv(X, Y, zScalar);
A3.MulAndDiv(X, Y, zScalar);
if (!A2.IsEqual(A1))
ERaise("Problem");
if (!A3.IsEqual(A1))
ERaise("Problem");
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler
Overload 3: TMtxVec *MulAndDiv(TMtxVec *X, TMtxVec *Y, const double xyScale, TMtxVec *Z) const;
Compute X Y xyScale / Z
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | xyScale | const double | |
| 4 | Z | TMtxVec * |
Remarks:
The following expression would also run at the same or higher speed, when passing X also for the Y parameter:
X^2 * xyScale/ Z
Examples
#include "MtxExpr.h"
#include "Units.Math387.h"
#include "Units.MtxExpr.h"
#include "Units.MtxVec.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;
using namespace Dew::Math::Units::MtxExpr;
using namespace Dew::Math::Units::MtxVec;
void Example()
{
Vector X, Y, Z, A1, A2, A3;
// Example: compute (X*Y)/Z element-wise.
X = {4, 8, 12, 16};
Y = {2, 2, 2, 2};
Z = {2, 4, 6, 8};
A1 = (X * Y) / Z;
A2 = MulAndDiv(X, Y, Z);
A3.MulAndDiv(X, Y, Z);
if (!A2.IsEqual(A1))
ERaise("Problem");
if (!A3.IsEqual(A1))
ERaise("Problem");
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler
Overload 4: TMtxVec *MulAndDiv(TMtxVec *X, TMtxVec *Y, const TCplx &xyScale, TMtxVec *Z) const;
Compute X Y xyScale / Z
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | xyScale | const TCplx & | |
| 4 | Z | TMtxVec * |
Remarks:
The following expression would also run at the same or higher speed, when passing X also for the Y parameter:
X^2 * xyScale/ Z
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler
Overload 5: TMtxVec *MulAndDiv(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double xyScale, TMtxVec *Z, int zIndex, int Index, int Len) const;
Compute X Y xyScale / Z on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | xyScale | const double | |
| 6 | Z | TMtxVec * | |
| 7 | zIndex | int | |
| 8 | Index | int | |
| 9 | Len | int |
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler
Overload 6: TMtxVec *MulAndDiv(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &xyScale, TMtxVec *Z, int zIndex, int Index, int Len) const;
Compute X Y xyScale / Z on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | xyScale | const TCplx & | |
| 6 | Z | TMtxVec * | |
| 7 | zIndex | int | |
| 8 | Index | int | |
| 9 | Len | int |
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler
Overload 7: TMtxVec *MulAndDiv(TMtxVec *X, TMtxVec *Y, const double Z) const;
Compute X * Y / zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | const double |
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler
Overload 8: TMtxVec *MulAndDiv(TMtxVec *X, TMtxVec *Y, const TCplx &Z) const;
Compute X * Y / zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | const TCplx & |
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler
Overload 9: TMtxVec *MulAndDiv(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double Z, int Index, int Len) const;
Compute X * Y / zScalar on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | Z | const double | |
| 6 | Index | int | |
| 7 | Len | int |
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler
Overload 10: TMtxVec *MulAndDiv(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &Z, int Index, int Len) const;
Compute X * Y / zScalar on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | Z | const TCplx & | |
| 6 | Index | int | |
| 7 | Len | int |
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler