TOpenCLVector::Mag Method

Overload List

#SignatureDescription
1TOpenCLMtxVec *Mag();Magnitude.
2TOpenCLMtxVec *Mag(int Index, int Len);Calculate the magnitude for calling object elements [Index]..[Index+Len-1] in-place.
3TOpenCLMtxVec *Mag(TOpenCLMtxVec *X);Calculate the magnitude for all X elements.
4TOpenCLMtxVec *Mag(TOpenCLMtxVec *X, int XIndex, int Index, int Len);Calculate the magnitude for X elements [XIndex]..[XIndex+Len-1].

Overload 1: TOpenCLMtxVec *Mag();

Magnitude.

Remarks:

Calculate the magnitude for all calling object elements in-place. This method has the same function as the TOpenCLVector::Abs method.

Examples
#include "Units.clMtxVec.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::ClMtxVec;

void Example()
{
    TOpenCLVector* a;
    CreateIt(a);
    a->CopyFromArray( DewArray<double>{1,-2,3,4}); // a = [1,-2, 3,4]
    a->Mag();  // a = [1, 2, 3,4]
    FreeIt(a);
}
See Also: TOpenCLVector::Abs, TOpenCLVector::PhaseSpectrum
Declared in Dew::Math::TOpenCLMtxVec · Dew.Math/clMtxVec.h · Cross-compiler

Overload 2: TOpenCLMtxVec *Mag(int Index, int Len);

Calculate the magnitude for calling object elements [Index]..[Index+Len-1] in-place.

#NameTypeDescription
1Indexint
2Lenint
Remarks:

An exception is raised if array borders are overrun.

Declared in Dew::Math::TOpenCLMtxVec · Dew.Math/clMtxVec.h · Cross-compiler

Overload 3: TOpenCLMtxVec *Mag(TOpenCLMtxVec *X);

Calculate the magnitude for all X elements.

#NameTypeDescription
1XTOpenCLMtxVec *
Remarks:

Store the results in the calling object elements. Size and TOpenCLBase::Complex properties of the calling vector are set implicitly to match Vec vector.

Declared in Dew::Math::TOpenCLMtxVec · Dew.Math/clMtxVec.h · Cross-compiler

Overload 4: TOpenCLMtxVec *Mag(TOpenCLMtxVec *X, int XIndex, int Index, int Len);

Calculate the magnitude for X elements [XIndex]..[XIndex+Len-1].

#NameTypeDescription
1XTOpenCLMtxVec *
2XIndexint
3Indexint
4Lenint
Remarks:

Store the results in the calling object elements [Index]..[Index+Len-1]. Size and TOpenCLBase::Complex properties of the calling object must be set explicitly. An exception is raised if array borders are overrun.

Declared in Dew::Math::TOpenCLMtxVec · Dew.Math/clMtxVec.h · Cross-compiler