Overload List
Overload 1: TMtxVec *Mul(const double Value);
Multiply object elements with Value.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | const double |
Multiplies all calling object elements with Value in-place.
#include "Units.MtxVec.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;
void Example()
{
TVec* a;
CreateIt(a);
a->SetIt(false,DewArray<double>{2,3,5}); // a = [2,3,5]
a->Mul(3); // a = [6,9,15]
FreeIt(a);
}
Overload 2: TMtxVec *Mul(const TCplx &Value);
Multiply all calling object elements with complex Value in-place.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | const TCplx & |
Overload 3: TMtxVec *Mul(const double Value, int Index, int Len);
Multipy calling object elements [Index]..[Index+Len-1] with Value in-place.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | const double | |
| 2 | Index | int | |
| 3 | Len | int |
An exception is raised if array borders are overrun or underrun.
Overload 4: TMtxVec *Mul(const TCplx &Value, int Index, int Len);
Multipy calling object elements [Index]..[Index+Len-1] with complex Value in-place.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | const TCplx & | |
| 2 | Index | int | |
| 3 | Len | int |
An exception is raised if array borders are overrun or underrun.
Overload 5: TMtxVec *Mul(TMtxVec *Vec, const double Value);
Multiply each element of Vec with Value.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * | |
| 2 | Value | const double |
Store the result in the calling object. Size and TVec::Complex properties of the calling object are adjusted automatically.
Overload 6: TMtxVec *Mul(TMtxVec *Vec, const TCplx &Value);
Multiply each element of Vec with complex Value.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * | |
| 2 | Value | const TCplx & |
Store the result in the calling object. Size of the calling object is set automatically. TVec::Complex property of the calling object is set to True.
Overload 7: TMtxVec *Mul(TMtxVec *Vec, const double Value, int VecIndex, int Index, int Len);
Multiply Vec elements [VecIndex]..[VecIndex+Len-1] with Value.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * | |
| 2 | Value | const double | |
| 3 | VecIndex | int | |
| 4 | Index | int | |
| 5 | Len | int |
Store the result in calling object elements [Index]..[Index+Len-1]. Size of the calling object is not changed. An exception is raised if array borders are overrun or underrun. TVec::Complex propertiy of the calling object is set implicitly.
Overload 8: TMtxVec *Mul(TMtxVec *Vec, const TCplx &Value, int VecIndex, int Index, int Len);
Multiply Vec elements [VecIndex]..[VecIndex+Len-1] with complex Value.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * | |
| 2 | Value | const TCplx & | |
| 3 | VecIndex | int | |
| 4 | Index | int | |
| 5 | Len | int |
Store the result in calling object elements [Index]..[Index+Len-1]. Size of the calling object is not changed. An exception is raised if array borders are overrun or underrun. TVec::Complex propertiy of the calling object is set to True.
Overload 9: TMtxVec *Mul(TMtxVec *X, TMtxVec *Y, TMtxVec *Z);
Compute X*Y*Z
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | TMtxVec * |
The following expression would also run at the same or higher speed, when passing X also for the Z parameter:
X^2*Y
Overload 10: TMtxVec *Mul(TMtxVec *X, TMtxVec *Y, const double Z);
Compute X*Y*zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | const double |
The following expression would also run at the same or higher speed, when passing X also for the Z parameter:
X^2*zScalar
Overload 11: TMtxVec *Mul(TMtxVec *X, TMtxVec *Y, const TCplx &Z);
Compute X*Y*zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | Y | TMtxVec * | |
| 3 | Z | const TCplx & |
The following expression would also run at the same or higher speed, when passing X also for the Z parameter:
X^2*zScalar
Overload 12: TMtxVec *Mul(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, TMtxVec *Z, int zIndex, int Index, int Len);
Compute X*Y*Z on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | Z | TMtxVec * | |
| 6 | zIndex | int | |
| 7 | Index | int | |
| 8 | Len | int |
Overload 13: TMtxVec *Mul(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const double Z, int Index, int Len);
Compute X*Y*zScalar on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | Z | const double | |
| 6 | Index | int | |
| 7 | Len | int |
Overload 14: TMtxVec *Mul(TMtxVec *X, int XIndex, TMtxVec *Y, int YIndex, const TCplx &Z, int Index, int Len);
Compute X*Y*zScalar on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec * | |
| 2 | XIndex | int | |
| 3 | Y | TMtxVec * | |
| 4 | YIndex | int | |
| 5 | Z | const TCplx & | |
| 6 | Index | int | |
| 7 | Len | int |
Overload 15: TMtxVec *Mul(TMtxVec *Vec);
Vector multiplication.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * |
Multiply each of Vec elements with corresponding elements in the calling object. Size and TVec::Complex property of the calling object are set automatically. The result is stored in the calling object.
#include "Math387.h"
#include "MtxExpr.h"
using namespace Dew;
using namespace Dew::Math;
void Example()
{
Vector a;
a.SetIt(DewArray<double>{ 1.0, 2.0, 3.0, 4.0 });
Vector b;
b.SetIt(DewArray<double>{ 5.0, 6.0, 7.0, 8.0 });
a.Mul(b);
Vector expected;
expected.SetIt(DewArray<double>{ 5.0, 12.0, 21.0, 32.0 });
if (!a.IsEqual(expected, 1e-10, TCompare::cmpAbsolute))
throw tException("Vector.Mul: mismatch");
}
Overload 16: TMtxVec *Mul(TMtxVec *Vec, int VecIndex, int Index, int Len);
Multiply Vec elements [VecIndex]..[VecIndex+Len-1] with calling object elements [Index]..[Index+Len-1] in-place.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec * | |
| 2 | VecIndex | int | |
| 3 | Index | int | |
| 4 | Len | int |
An exception is raised if Vec and calling object TVec::Complex property do not match or if array borders are overrun/underrun.
Overload 17: TMtxVec *Mul(TMtxVec *Vec1, TMtxVec *Vec2);
Multiply all Vec1 elements with corresponding Vec2 elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec1 | TMtxVec * | |
| 2 | Vec2 | TMtxVec * |
Store the results in calling object. Size and TVec::Complex property of calling object are adjusted automatically to match those of Vec1 and Vec2. An exception is raised if Vec1 and Vec2 size and TVec::Complex property do not match.
#include "Math387.h"
#include "MtxExpr.h"
using namespace Dew;
using namespace Dew::Math;
void Example()
{
Vector a;
Vector x;
x.SetIt(DewArray<double>{ 1.0, 2.0, 3.0, 4.0 });
Vector y;
y.SetIt(DewArray<double>{ 5.0, 6.0, 7.0, 8.0 });
a.Mul(x, y);
Vector expected;
expected.SetIt(DewArray<double>{ 5.0, 12.0, 21.0, 32.0 });
if (!a.IsEqual(expected, 1e-10, TCompare::cmpAbsolute))
throw tException("Vector.Mul: mismatch");
}
Overload 18: TMtxVec *Mul(TMtxVec *Vec1, TMtxVec *Vec2, int Vec1Index, int Vec2Index, int Index, int Len);
Multiply Vec1 elements [Vec1Index]..[Vec1Index+Len-1] with Vec2 object elements [Vec2Index]..[Vec2Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec1 | TMtxVec * | |
| 2 | Vec2 | TMtxVec * | |
| 3 | Vec1Index | int | |
| 4 | Vec2Index | int | |
| 5 | Index | int | |
| 6 | Len | int |
Store the results in calling object elements [Index]..[Index+Len-1]. Size and TVec::Complex properties of the calling object must be set explicitly. An exception is raised if TVec::ConditionCheck is True and array borders are overrun or underrun.