TSparseMtx::Scale Method

Overload List

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

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

Multiply object elements with Value.

#NameTypeDescription
1Factorconst double
Remarks:

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

Examples
#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->Scale(3); // a = [6,9,15]
    FreeIt(a);
}
See Also: TDenseMtxVec::Add
Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

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

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

#NameTypeDescription
1Factorconst double
2Indexint
3Lenint
Remarks:

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

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

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

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

#NameTypeDescription
1Factorconst TCplx &
Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

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

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

#NameTypeDescription
1Factorconst TCplx &
2Indexint
3Lenint
Remarks:

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

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler