Vector::AddScaled Method

Overload List

#SignatureDescription
1TMtxVec *AddScaled(TMtxVec *Vec, double aScale) const;Add each of Vec elements to corresponding elements in the calling object.
2TMtxVec *AddScaled(TMtxVec *Vec, double RScale, double IScale) const;Add each of Vec elements to corresponding elements in the calling object.
3TMtxVec *AddScaled(TMtxVec *Vec, TCplx aScale) const;Add each of Vec elements to corresponding elements in the calling object.
4TMtxVec *AddScaled(TMtxVec *Vec, double aScale, int VecIndex, int Index, int Len) const;Adds Vec elements [VecIndex]..[VecIndex+Len-1] to calling object elements [Index]..[Index+Len-1].
5TMtxVec *AddScaled(TMtxVec *Vec, TCplx aScale, int VecIndex, int Index, int Len) const;Adds Vec elements [VecIndex]..[VecIndex+Len-1] to calling object elements [Index]..[Index+Len-1].
6TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const double yScale) const;Compute X + Y*yScale
7TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const TCplx &yScale) const;Compute X + Y*yScale with complex arguments.
8TMtxVec *AddScaled(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double yScale, int Index, int Len) const;Compute X + Y*yScale on sub arrays.
9TMtxVec *AddScaled(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &yScale, int Index, int Len) const;Compute X + Y*yScale on sub arrays with complex arguments.
10TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, TMtxVec *Z, const double zScale) const;Compute X + Y + Z*zScale
11TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, TMtxVec *Z, const TCplx &zScale) const;Compute X + Y + Z*zScale
12TMtxVec *AddScaled(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 arrays
13TMtxVec *AddScaled(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 arrays
14TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const double yScale, TMtxVec *Z, const double zScale) const;Compute X + Y*yScale + Z*zScale
15TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const TCplx &yScale, TMtxVec *Z, const TCplx &zScale) const;Compute X + Y*yScale + Z*zScale
16TMtxVec *AddScaled(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double yScale, TMtxVec *Z, int zIndex, const double zScale, int Index, int Len) const;Compute X + Y*yScale + Z*zScale on sub arrays
17TMtxVec *AddScaled(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &yScale, TMtxVec *Z, int zIndex, const TCplx &zScale, int Index, int Len) const;Compute X + Y*yScale + Z*zScale on sub arrays
18TMtxVec *AddScaled(TMtxVec *X, const double xScale, TMtxVec *Y, const double yScale) const;Compute X*xScale + Y*yScale
19TMtxVec *AddScaled(TMtxVec *X, const TCplx &xScale, TMtxVec *Y, const TCplx &yScale) const;Compute X*xScale + Y*yScale
20TMtxVec *AddScaled(TMtxVec *X, int XIndex, const double xScale, TMtxVec *Y, int YIndex, const double yScale, int Index, int Len) const;Compute X*xScale + Y*yScale on sub arrays
21TMtxVec *AddScaled(TMtxVec *X, int XIndex, const TCplx &xScale, TMtxVec *Y, int YIndex, const TCplx &yScale, int Index, int Len) const;Compute X*xScale + Y*yScale on sub arrays
22TMtxVec *AddScaled(TMtxVec *X, const double xScale, TMtxVec *Y, const double yScale, TMtxVec *Z, const double zScale) const;Compute X*xScale + Y*yScale + Z*zScale
23TMtxVec *AddScaled(TMtxVec *X, const TCplx &xScale, TMtxVec *Y, const TCplx &yScale, TMtxVec *Z, const TCplx &zScale) const;Compute X*xScale + Y*yScale + Z*zScale
24TMtxVec *AddScaled(TMtxVec *X, int XIndex, const double xScale, TMtxVec *Y, int YIndex, const double yScale, TMtxVec *Z, int zIndex, const double zScale, int Index, int Len) const;Compute X*xScale + Y*yScale + Z*zScale on sub arrays
25TMtxVec *AddScaled(TMtxVec *X, int XIndex, const TCplx &xScale, TMtxVec *Y, int YIndex, const TCplx &yScale, TMtxVec *Z, int zIndex, const TCplx &zScale, int Index, int Len) const;Compute X*xScale + Y*yScale + Z*zScale on sub arrays

Overload 1: TMtxVec *AddScaled(TMtxVec *Vec, double aScale) const;

Add each of Vec elements to corresponding elements in the calling object.

#NameTypeDescription
1VecTMtxVec *
2aScaledouble
Remarks:

In addition, the following formula is begin used:

result = result+ aScale*Vec . 

The results are stored in the calling object. Size and Vector::Complex properties of the calling object are set implicitly to match the Vec object.

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 xScale, yScale;

    xScale = 1.5;
    yScale = -1.5;
    X = {1, 2, 3, 4};
    Y = {2, 3, 4, 5};
    A1 = X * xScale + Y * yScale; // easiest to read, but creates temporaries
    A2 = AddScaled(X, xScale, Y, yScale); // faster, but still one temporary
    A3.AddScaled(X, xScale, Y, yScale); // fastest (in-place)

    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 *AddScaled(TMtxVec *Vec, double RScale, double IScale) const;

Add each of Vec elements to corresponding elements in the calling object.

#NameTypeDescription
1VecTMtxVec *
2RScaledouble
3IScaledouble
Remarks:

In addition, the following formula is begin used:

result = result+ Cplx(RScale,IScale)*Vec . 

When default values for parameters are being used the "normal" addition is being performed.

The results are stored in the calling object. Size and Vector::Complex properties of the calling object are set implicitly to match the Vec object.

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 xScale, yScale, zScale;

    xScale = 1.0;
    yScale = 2.0;
    zScale = 3.0;
    X = {1, 2, 3, 4};
    Y = {2, 3, 4, 5};
    Z = {3, 4, 5, 6};
    A1 = X * xScale + Y * yScale + Z * zScale;
    A2 = AddScaled(X, xScale, Y, yScale, Z, zScale);
    A3.AddScaled(X, xScale, Y, yScale, 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 3: TMtxVec *AddScaled(TMtxVec *Vec, TCplx aScale) const;

Add each of Vec elements to corresponding elements in the calling object.

#NameTypeDescription
1VecTMtxVec *
2aScaleTCplx
Remarks:

In addition, the following formula is begin used:

result = result+ aScale*Vec . 

The results are stored in the calling object. Size and Vector::Complex properties of the calling object are set implicitly to match the Vec object.

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 yScale;

    yScale = 1.5;
    X = {1, 2, 3, 4};
    Y = {2, 3, 4, 5};
    A1 = X + Y * yScale;
    A2 = AddScaled(X, Y, yScale);
    A3.AddScaled(X, Y, yScale);
    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 *AddScaled(TMtxVec *Vec, double aScale, int VecIndex, int Index, int Len) const;

Adds Vec elements [VecIndex]..[VecIndex+Len-1] to calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1VecTMtxVec *
2aScaledouble
3VecIndexint
4Indexint
5Lenint
Remarks:

In addition, the following formula is begin used:

result = result+ Cplx(aScale)*Vec . 

An exception is raised if Vector::ConditionCheck is true and array borders are overrun.

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 zScale;

    zScale = 2.0;
    X = {1, 2, 3, 4};
    Y = {2, 3, 4, 5};
    Z = {3, 4, 5, 6};
    A1 = X + Y + Z * zScale;
    A2 = AddScaled(X, Y, Z, zScale);
    A3.AddScaled(X, Y, 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 5: TMtxVec *AddScaled(TMtxVec *Vec, TCplx aScale, int VecIndex, int Index, int Len) const;

Adds Vec elements [VecIndex]..[VecIndex+Len-1] to calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1VecTMtxVec *
2aScaleTCplx
3VecIndexint
4Indexint
5Lenint
Remarks:

In addition, the following formula is begin used:

result = result+ aScale*Vec . 

An exception is raised if Vector::ConditionCheck is true and array borders are overrun.

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 yScale, zScale;

    yScale = 1.5;
    zScale = 2.0;
    X = {1, 2, 3, 4};
    Y = {2, 3, 4, 5};
    Z = {3, 4, 5, 6};
    A1 = X + Y * yScale + Z * zScale;
    A2 = AddScaled(X, Y, yScale, Z, zScale);
    A3.AddScaled(X, Y, yScale, 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 6: TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const double yScale) const;

Compute X + Y*yScale

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

Overload 7: TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const TCplx &yScale) const;

Compute X + Y*yScale with complex arguments.

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

Overload 8: TMtxVec *AddScaled(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double yScale, int Index, int Len) const;

Compute X + Y*yScale on sub arrays.

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

Overload 9: TMtxVec *AddScaled(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &yScale, int Index, int Len) const;

Compute X + Y*yScale on sub arrays with complex arguments.

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

Overload 10: TMtxVec *AddScaled(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 11: TMtxVec *AddScaled(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 12: TMtxVec *AddScaled(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 arrays

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

Overload 13: TMtxVec *AddScaled(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 arrays

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

Overload 14: TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const double yScale, TMtxVec *Z, const double zScale) const;

Compute X + Y*yScale + Z*zScale

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

Overload 15: TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const TCplx &yScale, TMtxVec *Z, const TCplx &zScale) const;

Compute X + Y*yScale + Z*zScale

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

Overload 16: TMtxVec *AddScaled(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double yScale, TMtxVec *Z, int zIndex, const double zScale, int Index, int Len) const;

Compute X + Y*yScale + Z*zScale on sub arrays

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

Overload 17: TMtxVec *AddScaled(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &yScale, TMtxVec *Z, int zIndex, const TCplx &zScale, int Index, int Len) const;

Compute X + Y*yScale + Z*zScale on sub arrays

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

Overload 18: TMtxVec *AddScaled(TMtxVec *X, const double xScale, TMtxVec *Y, const double yScale) const;

Compute X*xScale + Y*yScale

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

Overload 19: TMtxVec *AddScaled(TMtxVec *X, const TCplx &xScale, TMtxVec *Y, const TCplx &yScale) const;

Compute X*xScale + Y*yScale

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

Overload 20: TMtxVec *AddScaled(TMtxVec *X, int XIndex, const double xScale, TMtxVec *Y, int YIndex, const double yScale, int Index, int Len) const;

Compute X*xScale + Y*yScale on sub arrays

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

Overload 21: TMtxVec *AddScaled(TMtxVec *X, int XIndex, const TCplx &xScale, TMtxVec *Y, int YIndex, const TCplx &yScale, int Index, int Len) const;

Compute X*xScale + Y*yScale on sub arrays

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

Overload 22: TMtxVec *AddScaled(TMtxVec *X, const double xScale, TMtxVec *Y, const double yScale, TMtxVec *Z, const double zScale) const;

Compute X*xScale + Y*yScale + Z*zScale

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

Overload 23: TMtxVec *AddScaled(TMtxVec *X, const TCplx &xScale, TMtxVec *Y, const TCplx &yScale, TMtxVec *Z, const TCplx &zScale) const;

Compute X*xScale + Y*yScale + Z*zScale

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

Overload 24: TMtxVec *AddScaled(TMtxVec *X, int XIndex, const double xScale, TMtxVec *Y, int YIndex, const double yScale, TMtxVec *Z, int zIndex, const double zScale, int Index, int Len) const;

Compute X*xScale + Y*yScale + Z*zScale on sub arrays

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

Overload 25: TMtxVec *AddScaled(TMtxVec *X, int XIndex, const TCplx &xScale, TMtxVec *Y, int YIndex, const TCplx &yScale, TMtxVec *Z, int zIndex, const TCplx &zScale, int Index, int Len) const;

Compute X*xScale + Y*yScale + Z*zScale on sub arrays

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