Vector::MulAndDiv Method

Overload List

#SignatureDescription
1TMtxVec *MulAndDiv(TMtxVec *X, TMtxVec *Y, TMtxVec *Z) const;Compute X * Y / Z
2TMtxVec *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
3TMtxVec *MulAndDiv(TMtxVec *X, TMtxVec *Y, const double xyScale, TMtxVec *Z) const;Compute X * Y * xyScale / Z
4TMtxVec *MulAndDiv(TMtxVec *X, TMtxVec *Y, const TCplx &xyScale, TMtxVec *Z) const;Compute X * Y * xyScale / Z
5TMtxVec *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
6TMtxVec *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
7TMtxVec *MulAndDiv(TMtxVec *X, TMtxVec *Y, const double Z) const;Compute X * Y / zScalar
8TMtxVec *MulAndDiv(TMtxVec *X, TMtxVec *Y, const TCplx &Z) const;Compute X * Y / zScalar
9TMtxVec *MulAndDiv(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double Z, int Index, int Len) const;Compute X * Y / zScalar on sub array
10TMtxVec *MulAndDiv(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &Z, int Index, int Len) const;Compute X * Y / zScalar on sub array

Overload 1: TMtxVec *MulAndDiv(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"
#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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5ZTMtxVec *
6zIndexint
7Indexint
8Lenint
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

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

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

#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 *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

#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 *MulAndDiv(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 8: TMtxVec *MulAndDiv(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 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

#NameTypeDescription
1XTMtxVec *
2XIndexint
3YTMtxVec *
4YIndexint
5Zconst double
6Indexint
7Lenint
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

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