MtxExpr::DivideElem Function

Overload List

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

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

Compute X / (Y*Z)

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

Divides X by the product of Y and 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 = { 6, 8, 10, 12 };
    Vector Y = { 1, 2, 3, 4 };
    Vector Z = { 2, 2, 2, 2 };
    Vector A1 = X / (Y * Z);
    Vector A2 = DivideElem(X, Y, Z);
    Vector A3;
    A3.Divide(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 DivideElem(TMtx *X, TMtxVec *Y, TMtxVec *Z);

Compute X / (Y*Z), when X is a Matrix

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

The operation does only per-element math.

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 Y, Z, A1, A2, A3;
    double xScalar;

    xScalar = 100;
    Y = {2, 4, 5, 10};
    Z = {1, 2, 2, 2};
    A1 = xScalar / (Y * Z);
    A2 = DivideElem(xScalar, Y, Z);
    A3.Divide(xScalar, 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 3: Vector DivideElem(const double X, TVec *Y, TMtxVec *Z);

Compute xScalar / (Y*Z)

#NameTypeDescription
1Xconst double
2YTVec *
3ZTMtxVec *
Remarks:

Divides a scalar xScalar by the product of Y and Z without temporary objects. Since the first parameter is scalar, the overload is provided by splitting the second parameter into TVec and TMtx versions.

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 xScalar = 100;
    Vector Y = { 2, 4, 5, 10 };
    Vector Z = { 1, 2, 2, 2 };
    Vector A1 = xScalar / (Y * Z);
    Vector A2 = DivideElem(xScalar, Y, Z);
    Vector A3;
    A3.Divide(xScalar, 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 4: Matrix DivideElem(const double X, TMtx *Y, TMtxVec *Z);

Compute xScalar / (Y*Z), when Y is a Matrix

#NameTypeDescription
1Xconst double
2YTMtx *
3ZTMtxVec *
Remarks:

The operation does only per-element math.

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

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

Compute xScalar / (Y*Z)

#NameTypeDescription
1Xconst TCplx &
2YTVec *
3ZTMtxVec *
Declared in Dew::Math::Units::MtxExpr · Dew.Math/Units.MtxExpr.h · Cross-compiler

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

Compute xScalar / (Y*Z), where Y is a Matrix

#NameTypeDescription
1Xconst TCplx &
2YTMtx *
3ZTMtxVec *
Declared in Dew::Math::Units::MtxExpr · Dew.Math/Units.MtxExpr.h · Cross-compiler