Overload List
Overload 1: Vector MulAndSub(TVec *X, const double Y, TMtxVec *Z, const double zScale);
Compute X*yScalar - Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec * | |
| 2 | Y | const double | |
| 3 | Z | TMtxVec * | |
| 4 | zScale | const double |
Computes the result of multiplying X by a scalar yScalar and then subtracting Z multiplied by zScale, without creating temporary objects.
#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()
{
double yScalar = 2.0, zScale = 3.0;
Vector X = { 3, 6, 9, 12 };
Vector Z = { 1, 1, 1, 1 };
Vector A1 = (X * yScalar) - (Z * zScale);
Vector A2 = MulAndSub(X, yScalar, Z, zScale);
Vector A3;
A3.MulAndSub(X, yScalar, Z, zScale);
if (!A2.IsEqual(A1)) ERaise("Problem");
if (!A3.IsEqual(A1)) ERaise("Problem");
}
Overload 2: Matrix MulAndSub(TMtx *X, const double Y, TMtxVec *Z, const double zScale);
Compute X*yScalar - Z*zScale, where X is a Matrix
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtx * | |
| 2 | Y | const double | |
| 3 | Z | TMtxVec * | |
| 4 | zScale | const double |
Overload 3: Vector MulAndSub(TVec *X, const TCplx &Y, TMtxVec *Z, const TCplx &zScale);
Compute X*yScalar - Z*zScale
Overload 4: Matrix MulAndSub(TMtx *X, const TCplx &Y, TMtxVec *Z, const TCplx &zScale);
Compute X*yScalar - Z*zScale, where X is a Matrix
Overload 5: Vector MulAndSub(TVec *X, TMtxVec *Y, TMtxVec *Z);
Compute X*Y - Z
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * |
Computes the element-wise product of X and Y, then subtracts Z, without creating temporary objects.
#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 = { 3, 6, 9, 12 };
Vector Y = { 1, 2, 3, 4 };
Vector Z = { 2, 2, 2, 2 };
Vector A1 = (X * Y) - Z;
Vector A2 = MulAndSub(X, Y, Z);
Vector A3;
A3.MulAndSub(X, Y, Z);
if (!A2.IsEqual(A1)) ERaise("Problem");
if (!A3.IsEqual(A1)) ERaise("Problem");
}
Overload 6: Matrix MulAndSub(TMtx *X, TMtxVec *Y, TMtxVec *Z);
Compute X*Y - Z, where X is a Matrix
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtx * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * |
The operation does only per-element math.
Overload 7: Vector MulAndSub(TVec *X, TMtxVec *Y, const double xyScale, TMtxVec *Z);
Compute X*Y*xyScale - Z
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec * | |
| 2 | Y | TMtxVec * | |
| 3 | xyScale | const double | |
| 4 | Z | TMtxVec * |
Computes the element-wise product of X and Y scaled by xyScale, then subtracts Z, without creating temporary objects.
#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()
{
double xyScale = 1.5;
Vector X = { 3, 6, 9, 12 };
Vector Y = { 1, 2, 3, 4 };
Vector Z = { 2, 2, 2, 2 };
Vector A1 = (X * Y * xyScale) - Z;
Vector A2 = MulAndSub(X, Y, xyScale, Z);
Vector A3;
A3.MulAndSub(X, Y, xyScale, Z);
if (!A2.IsEqual(A1)) ERaise("Problem");
if (!A3.IsEqual(A1)) ERaise("Problem");
}
Overload 8: Matrix MulAndSub(TMtx *X, TMtxVec *Y, const double xyScale, TMtxVec *Z);
Compute X*Y*xyScale - Z, where X is a Matrix
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtx * | |
| 2 | Y | TMtxVec * | |
| 3 | xyScale | const double | |
| 4 | Z | TMtxVec * |
The operation does only per-element math.
Overload 9: Vector MulAndSub(TVec *X, TMtxVec *Y, TMtxVec *Z, const double zScale);
Compute X*Y - Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * | |
| 4 | zScale | const double |
Computes the element-wise product of X and Y, then subtracts (Z multiplied by zScale), without creating temporary objects.
#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()
{
double zScale = 2.0;
Vector X = { 3, 6, 9, 12 };
Vector Y = { 1, 2, 3, 4 };
Vector Z = { 2, 2, 2, 2 };
Vector A1 = (X * Y) - (Z * zScale);
Vector A2 = MulAndSub(X, Y, Z, zScale);
Vector A3;
A3.MulAndSub(X, Y, Z, zScale);
if (!A2.IsEqual(A1)) ERaise("Problem");
if (!A3.IsEqual(A1)) ERaise("Problem");
}
Overload 10: Matrix MulAndSub(TMtx *X, TMtxVec *Y, TMtxVec *Z, const double zScale);
Compute X*Y - Z*zScale, where X is a Matrix
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtx * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * | |
| 4 | zScale | const double |
The operation does only per-element math.
Overload 11: Vector MulAndSub(TVec *X, TMtxVec *Y, const double Z);
Compute X*Y - zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | const double |
Computes the element-wise product of X and Y, then subtracts a scalar zScalar, without creating temporary objects.
#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()
{
double zScalar = 2.0;
Vector X = { 3, 6, 9, 12 };
Vector Y = { 1, 2, 3, 4 };
Vector A1 = (X * Y) - zScalar;
Vector A2 = MulAndSub(X, Y, zScalar);
Vector A3;
A3.MulAndSub(X, Y, zScalar);
if (!A2.IsEqual(A1)) ERaise("Problem");
if (!A3.IsEqual(A1)) ERaise("Problem");
}
Overload 12: Matrix MulAndSub(TMtx *X, TMtxVec *Y, const double Z);
Compute X*Y - zScalar, where X is a Matrix
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtx * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | const double |
The operation does only per-element math.
Overload 13: Vector MulAndSub(TVec *X, TMtxVec *Y, const TCplx &xyScale, TMtxVec *Z);
Compute X*Y*xyScale - Z
Overload 14: Matrix MulAndSub(TMtx *X, TMtxVec *Y, const TCplx &xyScale, TMtxVec *Z);
Compute X*Y*xyScale - Z, where X is a Matrix
Overload 15: Vector MulAndSub(TVec *X, TMtxVec *Y, TMtxVec *Z, const TCplx &zScale);
Compute X*Y - Z*zScale
Overload 16: Matrix MulAndSub(TMtx *X, TMtxVec *Y, TMtxVec *Z, const TCplx &zScale);
Compute X*Y - Z*zScale, where X is a Matrix
Overload 17: Vector MulAndSub(TVec *X, TMtxVec *Y, const TCplx &Z);
Compute X*Y - zScalar