Vector::MulAndAdd Method

Overload List

#SignatureDescription
1TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, TMtxVec *Z) const;Compute X*Y + Z
2TMtxVec *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
3TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const double xyScale, TMtxVec *Z) const;Compute X*Y*xyScale + Z
4TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const TCplx &xyScale, TMtxVec *Z) const;Compute X*Y*xyScale + Z
5TMtxVec *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
6TMtxVec *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
7TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, TMtxVec *Z, const double zScale) const;Compute X*Y + Z*zScale
8TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, TMtxVec *Z, const TCplx &zScale) const;Compute X*Y + Z*zScale
9TMtxVec *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
10TMtxVec *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
11TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const double Z) const;Compute X*Y + zScalar
12TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const TCplx &Z) const;Compute X*Y + zScalar
13TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double Z, int Index, int Len) const;Compute X*Y + zScalar on sub array
14TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &Z, int Index, int Len) const;Compute X*Y + zScalar on sub array
15TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const double xyScale, TMtxVec *Z, const double zScale) const;Compute (X*Y)*xyScale + Z*zScale
16TMtxVec *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
17TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const TCplx &xyScale, TMtxVec *Z, const TCplx &zScale) const;Compute (X*Y)*xyScale + Z*zScale
18TMtxVec *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
19TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const double xyScale, const double Z) const;Compute (X*Y)*xyScale + zScalar
20TMtxVec *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
21TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const TCplx &xyScale, const TCplx &Z) const;Compute (X*Y)*xyScale + zScalar
22TMtxVec *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
23TMtxVec *MulAndAdd(TMtxVec *X, const double Y, const double Z) const;Compute (X*yScalar) + zScalar
24TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, const double Y, const double Z, int Index, int Len) const;Compute (X*yScalar) + zScalar
25TMtxVec *MulAndAdd(TMtxVec *X, const TCplx &Y, const TCplx &Z) const;Compute (X*yScalar) + zScalar
26TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, const TCplx &Y, const TCplx &Z, int Index, int Len) const;Compute (X*yScalar) + zScalar

Overload 1: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, TMtxVec *Z) const;

Compute X*Y + Z

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3ZTMtxVec *
Examples
#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");
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5ZTMtxVec *
6zIndexint
7Indexint
8Lenint
Examples
#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");
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 3: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const double xyScale, TMtxVec *Z) const;

Compute X*Y*xyScale + Z

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3xyScaleconst double
4ZTMtxVec *
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, 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");
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 4: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const TCplx &xyScale, TMtxVec *Z) const;

Compute X*Y*xyScale + Z

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3xyScaleconst TCplx &
4ZTMtxVec *
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5xyScaleconst double
6ZTMtxVec *
7zIndexint
8Indexint
9Lenint
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5xyScaleconst TCplx &
6ZTMtxVec *
7zIndexint
8Indexint
9Lenint
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 7: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, TMtxVec *Z, const double zScale) const;

Compute X*Y + Z*zScale

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3ZTMtxVec *
4zScaleconst double
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 8: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, TMtxVec *Z, const TCplx &zScale) const;

Compute X*Y + Z*zScale

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3ZTMtxVec *
4zScaleconst TCplx &
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5ZTMtxVec *
6zIndexint
7zScaleconst double
8Indexint
9Lenint
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5ZTMtxVec *
6zIndexint
7zScaleconst TCplx &
8Indexint
9Lenint
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 11: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const double Z) const;

Compute X*Y + zScalar

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3Zconst double
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 12: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const TCplx &Z) const;

Compute X*Y + zScalar

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3Zconst TCplx &
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5Zconst double
6Indexint
7Lenint
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5Zconst TCplx &
6Indexint
7Lenint
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 15: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const double xyScale, TMtxVec *Z, const double zScale) const;

Compute (X*Y)*xyScale + Z*zScale

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3xyScaleconst double
4ZTMtxVec *
5zScaleconst double
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*zScale

Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5xyScaleconst double
6ZTMtxVec *
7zIndexint
8zScaleconst double
9Indexint
10Lenint
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 17: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const TCplx &xyScale, TMtxVec *Z, const TCplx &zScale) const;

Compute (X*Y)*xyScale + Z*zScale

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3xyScaleconst TCplx &
4ZTMtxVec *
5zScaleconst TCplx &
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*zScale

Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5xyScaleconst TCplx &
6ZTMtxVec *
7zIndexint
8zScaleconst TCplx &
9Indexint
10Lenint
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 19: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const double xyScale, const double Z) const;

Compute (X*Y)*xyScale + zScalar

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3xyScaleconst double
4Zconst double
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5xyScaleconst double
6Zconst double
7Indexint
8Lenint
Remarks:

The following expression would also run at the same or higher speed, when passing X also for the Y parameter:

X^2*xyScale + zScale

Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 21: TMtxVec *MulAndAdd(TMtxVec *X, TMtxVec *Y, const TCplx &xyScale, const TCplx &Z) const;

Compute (X*Y)*xyScale + zScalar

#NameTypeDescription
1XTMtxVec *
2YTMtxVec *
3xyScaleconst TCplx &
4Zconst TCplx &
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5xyScaleconst TCplx &
6Zconst TCplx &
7Indexint
8Lenint
Remarks:

The following expression would also run at the same or higher speed, when passing X also for the Y parameter:

X^2*xyScale + zScale

Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 23: TMtxVec *MulAndAdd(TMtxVec *X, const double Y, const double Z) const;

Compute (X*yScalar) + zScalar

#NameTypeDescription
1XTMtxVec *
2Yconst double
3Zconst double
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 24: TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, const double Y, const double Z, int Index, int Len) const;

Compute (X*yScalar) + zScalar

#NameTypeDescription
1XTMtxVec *
2XIndexint
3Yconst double
4Zconst double
5Indexint
6Lenint
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 25: TMtxVec *MulAndAdd(TMtxVec *X, const TCplx &Y, const TCplx &Z) const;

Compute (X*yScalar) + zScalar

#NameTypeDescription
1XTMtxVec *
2Yconst TCplx &
3Zconst TCplx &
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 26: TMtxVec *MulAndAdd(TMtxVec *X, int XIndex, const TCplx &Y, const TCplx &Z, int Index, int Len) const;

Compute (X*yScalar) + zScalar

#NameTypeDescription
1XTMtxVec *
2XIndexint
3Yconst TCplx &
4Zconst TCplx &
5Indexint
6Lenint
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler