Overload List
Overload 1: TMtxVec *AddScaled(TMtxVec *Vec, double aScale) const;
Add each of Vec elements to corresponding elements in the calling object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * | |
| 2 | aScale | double |
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.
#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");
}
Overload 2: TMtxVec *AddScaled(TMtxVec *Vec, double RScale, double IScale) const;
Add each of Vec elements to corresponding elements in the calling object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * | |
| 2 | RScale | double | |
| 3 | IScale | double |
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.
#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");
}
Overload 3: TMtxVec *AddScaled(TMtxVec *Vec, TCplx aScale) const;
Add each of Vec elements to corresponding elements in the calling object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * | |
| 2 | aScale | TCplx |
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.
#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");
}
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].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * | |
| 2 | aScale | double | |
| 3 | VecIndex | int | |
| 4 | Index | int | |
| 5 | Len | int |
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.
#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");
}
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].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * | |
| 2 | aScale | TCplx | |
| 3 | VecIndex | int | |
| 4 | Index | int | |
| 5 | Len | int |
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.
#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");
}
Overload 6: TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const double yScale) const;
Compute X + Y*yScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | yScale | const double |
Overload 7: TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const TCplx &yScale) const;
Compute X + Y*yScale with complex arguments.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | yScale | const TCplx & |
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.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | yScale | const double | |
| 6 | Index | int | |
| 7 | Len | int |
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.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | yScale | const TCplx & | |
| 6 | Index | int | |
| 7 | Len | int |
Overload 10: TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, TMtxVec *Z, const double zScale) const;
Compute X + Y + Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * | |
| 4 | zScale | const double |
Overload 11: TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, TMtxVec *Z, const TCplx &zScale) const;
Compute X + Y + Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * | |
| 4 | zScale | const TCplx & |
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | Z | TMtxVec * | |
| 6 | zIndex | int | |
| 7 | zScale | const double | |
| 8 | Index | int | |
| 9 | Len | int |
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | Z | TMtxVec * | |
| 6 | zIndex | int | |
| 7 | zScale | const TCplx & | |
| 8 | Index | int | |
| 9 | Len | int |
Overload 14: TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const double yScale, TMtxVec *Z, const double zScale) const;
Compute X + Y*yScale + Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | yScale | const double | |
| 4 | Z | TMtxVec * | |
| 5 | zScale | const double |
Overload 15: TMtxVec *AddScaled(TMtxVec *X, TMtxVec *Y, const TCplx &yScale, TMtxVec *Z, const TCplx &zScale) const;
Compute X + Y*yScale + Z*zScale
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | yScale | const double | |
| 6 | Z | TMtxVec * | |
| 7 | zIndex | int | |
| 8 | zScale | const double | |
| 9 | Index | int | |
| 10 | Len | int |
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | yScale | const TCplx & | |
| 6 | Z | TMtxVec * | |
| 7 | zIndex | int | |
| 8 | zScale | const TCplx & | |
| 9 | Index | int | |
| 10 | Len | int |
Overload 18: TMtxVec *AddScaled(TMtxVec *X, const double xScale, TMtxVec *Y, const double yScale) const;
Compute X*xScale + Y*yScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | xScale | const double | |
| 3 | Y | TMtxVec * | |
| 4 | yScale | const double |
Overload 19: TMtxVec *AddScaled(TMtxVec *X, const TCplx &xScale, TMtxVec *Y, const TCplx &yScale) const;
Compute X*xScale + Y*yScale
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | xScale | const double | |
| 4 | Y | TMtxVec * | |
| 5 | YIndex | int | |
| 6 | yScale | const double | |
| 7 | Index | int | |
| 8 | Len | int |
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | xScale | const TCplx & | |
| 4 | Y | TMtxVec * | |
| 5 | YIndex | int | |
| 6 | yScale | const TCplx & | |
| 7 | Index | int | |
| 8 | Len | int |
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | xScale | const double | |
| 3 | Y | TMtxVec * | |
| 4 | yScale | const double | |
| 5 | Z | TMtxVec * | |
| 6 | zScale | const double |
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | xScale | const TCplx & | |
| 3 | Y | TMtxVec * | |
| 4 | yScale | const TCplx & | |
| 5 | Z | TMtxVec * | |
| 6 | zScale | const TCplx & |
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | xScale | const double | |
| 4 | Y | TMtxVec * | |
| 5 | YIndex | int | |
| 6 | yScale | const double | |
| 7 | Z | TMtxVec * | |
| 8 | zIndex | int | |
| 9 | zScale | const double | |
| 10 | Index | int | |
| 11 | Len | int |