MtxExpr::MulElem Function

Overload List

#SignatureDescription
1Vector MulElem(TVec *X, TMtxVec *Y, TMtxVec *Z);Compute X*Y*Z
2Matrix MulElem(TMtx *X, TMtxVec *Y, TMtxVec *Z);Compute X*Y*Z, when X is a Matrix
3Vector MulElem(TVec *X, TMtxVec *Y, const double Z);Compute X*Y*zScalar
4Matrix MulElem(TMtx *X, TMtxVec *Y, const double Z);Compute X*Y*zScalar, when X is a Matrix
5Vector MulElem(TVec *X, TMtxVec *Y, const TCplx &Z);Compute X*Y*zScalar
6Matrix MulElem(TMtx *X, TMtxVec *Y, const TCplx &Z);Compute X*Y*zScalar, where X is a Matrix

Overload 1: Vector MulElem(TVec *X, TMtxVec *Y, TMtxVec *Z);

Compute X*Y*Z

#NameTypeDescription
1XTVec *
2YTMtxVec *
3ZTMtxVec *
Remarks:

Computes the product X*Y*Z without temporary objects.

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 = { 1, 2, 3, 4 };
    Vector Y = { 2, 3, 4, 5 };
    Vector Z = { 3, 4, 5, 6 };
    Vector A1 = X * Y * Z;
    Vector A2 = MulElem(X, Y, Z);
    Vector A3;
    A3.Mul(X, Y, Z);
    if (!A2.IsEqual(A1)) ERaise("Problem");
    if (!A3.IsEqual(A1)) ERaise("Problem");
}
Declared in Dew::Math::Units::MtxExpr · Dew.Math/Units.MtxExpr.h · Cross-compiler

Overload 2: Matrix MulElem(TMtx *X, TMtxVec *Y, TMtxVec *Z);

Compute X*Y*Z, when X is a Matrix

#NameTypeDescription
1XTMtx *
2YTMtxVec *
3ZTMtxVec *
Declared in Dew::Math::Units::MtxExpr · Dew.Math/Units.MtxExpr.h · Cross-compiler

Overload 3: Vector MulElem(TVec *X, TMtxVec *Y, const double Z);

Compute X*Y*zScalar

#NameTypeDescription
1XTVec *
2YTMtxVec *
3Zconst double
Remarks:

Computes the product of X and Y multiplied by the scalar zScalar without temporary objects.

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()
{
    double zScalar = 2.0;
    Vector X = { 1, 2, 3, 4 };
    Vector Y = { 2, 3, 4, 5 };
    Vector A1 = (X * Y) * zScalar;
    Vector A2 = MulElem(X, Y, zScalar);
    Vector A3;
    A3.Mul(X, Y, zScalar);
    if (!A2.IsEqual(A1)) ERaise("Problem");
    if (!A3.IsEqual(A1)) ERaise("Problem");
}
Declared in Dew::Math::Units::MtxExpr · Dew.Math/Units.MtxExpr.h · Cross-compiler

Overload 4: Matrix MulElem(TMtx *X, TMtxVec *Y, const double Z);

Compute X*Y*zScalar, when X is a Matrix

#NameTypeDescription
1XTMtx *
2YTMtxVec *
3Zconst double
Remarks:

The operation does only per-element math.

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

Overload 5: Vector MulElem(TVec *X, TMtxVec *Y, const TCplx &Z);

Compute X*Y*zScalar

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

Overload 6: Matrix MulElem(TMtx *X, TMtxVec *Y, const TCplx &Z);

Compute X*Y*zScalar, where X is a Matrix

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