MtxExpr::AddScaledC Function

Overload List

#SignatureDescription
1Vector AddScaledC(TVec *X, const double xScale, TMtxVec *Y, const double yScale, const double Z);Compute X*xScale + Y*yScale + zScalar
2Matrix AddScaledC(TMtx *X, const double xScale, TMtxVec *Y, const double yScale, const double Z);Compute X*xScale + Y*yScale + zScalar, when X is a Matrix
3Vector AddScaledC(TVec *X, TMtxVec *Y, const double yScale, const double Z);Compute X + Y*yScale + zScalar
4Matrix AddScaledC(TMtx *X, TMtxVec *Y, const double yScale, const double Z);Compute X + Y*yScale + zScalar, where X is a Matrix.
5Vector AddScaledC(TVec *X, TMtxVec *Y, const TCplx &yScale, const TCplx &Z);Compute X + Y*yScale + zScalar
6Matrix AddScaledC(TMtx *X, TMtxVec *Y, const TCplx &yScale, const TCplx &Z);Compute X + Y*yScale + zScalar, where X is a Matrix.
7Vector AddScaledC(TVec *X, const TCplx &xScale, TMtxVec *Y, const TCplx &yScale, const TCplx &Z);Compute X*xScale + Y*yScale + zScalar
8Matrix AddScaledC(TMtx *X, const TCplx &xScale, TMtxVec *Y, const TCplx &yScale, const TCplx &Z);Compute X*xScale + Y*yScale + zScalar, where X is a Matrix

Overload 1: Vector AddScaledC(TVec *X, const double xScale, TMtxVec *Y, const double yScale, const double Z);

Compute X*xScale + Y*yScale + zScalar

#NameTypeDescription
1XTVec *
2xScaleconst double
3YTMtxVec *
4yScaleconst double
5Zconst double
Remarks:

Computes X*xScale + Y*yScale plus a 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 xScale = 1.0, yScale = 2.0, zScalar = 3.0;
    Vector X = { 1, 2, 3, 4 };
    Vector Y = { 2, 3, 4, 5 };
    Vector A1 = X * xScale + Y * yScale + zScalar;
    Vector A2 = AddScaledC(X, xScale, Y, yScale, zScalar);
    Vector A3;
    A3.AddScaledC(X, xScale, Y, yScale, 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 2: Matrix AddScaledC(TMtx *X, const double xScale, TMtxVec *Y, const double yScale, const double Z);

Compute X*xScale + Y*yScale + zScalar, when X is a Matrix

#NameTypeDescription
1XTMtx *
2xScaleconst double
3YTMtxVec *
4yScaleconst double
5Zconst double
Declared in Dew::Math::Units::MtxExpr · Dew.Math/Units.MtxExpr.h · Cross-compiler

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

Compute X + Y*yScale + zScalar

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

Computes the sum of X and Y scaled by yScale, with an added scalar zScalar, without creating 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 yScale = 1.5, zScalar = 3.0;
    Vector X = { 1, 2, 3, 4 };
    Vector Y = { 2, 3, 4, 5 };
    Vector A1 = X + Y * yScale + zScalar;
    Vector A2 = AddScaledC(X, Y, yScale, zScalar);
    Vector A3;
    A3.AddScaledC(X, Y, yScale, 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 AddScaledC(TMtx *X, TMtxVec *Y, const double yScale, const double Z);

Compute X + Y*yScale + zScalar, where X is a Matrix.

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

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

Compute X + Y*yScale + zScalar

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

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

Compute X + Y*yScale + zScalar, where X is a Matrix.

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

Overload 7: Vector AddScaledC(TVec *X, const TCplx &xScale, TMtxVec *Y, const TCplx &yScale, const TCplx &Z);

Compute X*xScale + Y*yScale + zScalar

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

Overload 8: Matrix AddScaledC(TMtx *X, const TCplx &xScale, TMtxVec *Y, const TCplx &yScale, const TCplx &Z);

Compute X*xScale + Y*yScale + zScalar, where X is a Matrix

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