Overload List
Overload 1: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, TMtxVec *Z) const;
Compute X*Y + Z
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * |
#include "MtxExpr.h"
#include "Units.Math387.h"
#include "Units.MtxExpr.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;
using namespace Dew::Math::Units::MtxExpr;
void Example()
{
Vector X, Y, Z, A1, A2, A3;
double xyScale, zScale;
xyScale = 1.5;
zScale = 2.0;
X = {2, 4, 6, 8};
Y = {1, 1, 1, 1};
Z = {3, 4, 5, 6};
A1 = (X * Y * xyScale) + (Z * zScale);
A2 = MulAndAdd(X, Y, xyScale, Z, zScale); // Note: Overload uses given scales
A3.MulAndAdd(X, Y, xyScale, Z, zScale);
if (!A2.IsEqual(A1)) ERaise("Problem");
if (!A3.IsEqual(A1)) ERaise("Problem");
}
Overload 2: TMtxVec *MulAndAdd(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 |
#include "MtxExpr.h"
#include "Units.Math387.h"
#include "Units.MtxExpr.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;
using namespace Dew::Math::Units::MtxExpr;
void Example()
{
Vector X, Y, A1, A2, A3;
double xyScale, zScalar;
xyScale = 1.5;
zScalar = 2.0;
X = {2, 4, 6, 8};
Y = {1, 1, 1, 1};
A1 = (X * Y * xyScale) + zScalar;
A2 = MulAndAdd(X, Y, xyScale, zScalar);
A3.MulAndAdd(X, Y, xyScale, zScalar);
if (!A2.IsEqual(A1)) ERaise("Problem");
if (!A3.IsEqual(A1)) ERaise("Problem");
}
Overload 3: TMtxVec *MulAndAdd(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 * |
#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, A1, A2, A3;
double yScalar, zScalar;
yScalar = 2.0;
zScalar = 3.0;
X = {2, 4, 6, 8};
A1 = (X * yScalar) + zScalar;
A2 = MulAndAdd(X, yScalar, zScalar);
A3.MulAndAdd(X, yScalar, zScalar);
if (!A2.IsEqual(A1))
ERaise("Problem");
if (!A3.IsEqual(A1))
ERaise("Problem");
}
Overload 4: TMtxVec *MulAndAdd(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 * |
Overload 5: TMtxVec *MulAndAdd(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 |
Overload 6: TMtxVec *MulAndAdd(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 |
Overload 7: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, TMtxVec *Z, const double zScale) const;
Compute X*Y + Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * | |
| 4 | zScale | const double |
Overload 8: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, TMtxVec *Z, const TCplx &zScale) const;
Compute X*Y + Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * | |
| 4 | zScale | const TCplx & |
Overload 9: TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, TMtxVec *Z, int zIndex, const double zScale, int Index, int Len) const;
Compute X*Y + Z*zScale 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 | zScale | const double | |
| 8 | Index | int | |
| 9 | Len | int |
Overload 10: TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, TMtxVec *Z, int zIndex, const TCplx &zScale, int Index, int Len) const;
Compute X*Y + Z*zScale 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 | zScale | const TCplx & | |
| 8 | Index | int | |
| 9 | Len | int |
Overload 11: TMtxVec *MulAndAdd(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 |
Overload 12: TMtxVec *MulAndAdd(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 & |
Overload 13: TMtxVec *MulAndAdd(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 |
Overload 14: TMtxVec *MulAndAdd(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 |
Overload 15: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const double xyScale, TMtxVec *Z, const double zScale) const;
Compute (X*Y)*xyScale + Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | xyScale | const double | |
| 4 | Z | TMtxVec * | |
| 5 | zScale | const double |
The following expression would also run at the same or higher speed, when passing X also for the Y parameter:
X^2*xyScale + Z*zScale
Overload 16: TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double xyScale, TMtxVec *Z, int zIndex, const double zScale, int Index, int Len) const;
Compute (X*Y)*xyScale + Z*zScale 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 | zScale | const double | |
| 9 | Index | int | |
| 10 | Len | int |
Overload 17: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const TCplx &xyScale, TMtxVec *Z, const TCplx &zScale) const;
Compute (X*Y)*xyScale + Z*zScale
The following expression would also run at the same or higher speed, when passing X also for the Y parameter:
X^2*xyScale + Z*zScale
Overload 18: TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &xyScale, TMtxVec *Z, int zIndex, const TCplx &zScale, int Index, int Len) const;
Compute (X*Y)*xyScale + Z*zScale 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 | zScale | const TCplx & | |
| 9 | Index | int | |
| 10 | Len | int |
Overload 19: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const double xyScale, const double Z) const;
Compute (X*Y)*xyScale + zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | xyScale | const double | |
| 4 | Z | const double |
Overload 20: TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double xyScale, const double Z, int Index, int Len) const;
Compute (X*Y)*xyScale + zScalar on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | xyScale | const double | |
| 6 | Z | const double | |
| 7 | Index | int | |
| 8 | Len | int |
The following expression would also run at the same or higher speed, when passing X also for the Y parameter:
X^2*xyScale + zScale
Overload 21: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const TCplx &xyScale, const TCplx &Z) const;
Compute (X*Y)*xyScale + zScalar
Overload 22: TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &xyScale, const TCplx &Z, int Index, int Len) const;
Compute (X*Y)*xyScale + zScalar on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | xyScale | const TCplx & | |
| 6 | Z | const TCplx & | |
| 7 | Index | int | |
| 8 | Len | int |
The following expression would also run at the same or higher speed, when passing X also for the Y parameter:
X^2*xyScale + zScale
Overload 23: TMtxVec *MulAndAdd(TMtxVec *X, const double Y, const double Z) const;
Compute (X*yScalar) + zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | const double | |
| 3 | Z | const double |
Overload 24: TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, const double Y, const double Z, int Index, int Len) const;
Compute (X*yScalar) + zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | const double | |
| 4 | Z | const double | |
| 5 | Index | int | |
| 6 | Len | int |
Overload 25: TMtxVec *MulAndAdd(TMtxVec *X, const TCplx &Y, const TCplx &Z) const;
Compute (X*yScalar) + zScalar