Vector::Scale Method

Overload List

#SignatureDescription
1TMtxVec *Scale(double Factor) const;Multiply object elements with Value.
2TMtxVec *Scale(double Factor, int Index, int Len) const;Multipy calling object elements [Index]..[Index+Len-1] with Value in-place.
3TMtxVec *Scale(TCplx Factor) const;Multiply all calling object elements with a complex Value in-place.
4TMtxVec *Scale(TCplx Factor, int Index, int Len) const;Multipy calling object elements [Index]..[Index+Len-1] with complex Value in-place.

Overload 1: TMtxVec *Scale(double Factor) const;

Multiply object elements with Value.

#NameTypeDescription
1Factordouble
Remarks:

Multiply all calling object elements with Value in-place. This method is the same as the Vector::Mul method overloads multiplying with vector elements with a scalar.

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Vector v;

    v.SetIt(false, DewArray<double>{2, 3, 5}); // v = [2,3,5]
    v.Scale(3); // v = [6,9,15]
}
See Also: Vector::Add
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 2: TMtxVec *Scale(double Factor, int Index, int Len) const;

Multipy calling object elements [Index]..[Index+Len-1] with Value in-place.

#NameTypeDescription
1Factordouble
2Indexint
3Lenint
Remarks:

An exception is raised if array borders are overrun or underrun.

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Vector v;

    v = {2, 3, 5}; // v = [2,3,5]
    v.Scale(3); // v = [6,9,15]
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 3: TMtxVec *Scale(TCplx Factor) const;

Multiply all calling object elements with a complex Value in-place.

#NameTypeDescription
1FactorTCplx
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 4: TMtxVec *Scale(TCplx Factor, int Index, int Len) const;

Multipy calling object elements [Index]..[Index+Len-1] with complex Value in-place.

#NameTypeDescription
1FactorTCplx
2Indexint
3Lenint
Remarks:

An exception is raised if array borders are overrun or underrun.

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