Vector::RealPart Method

Overload List

#SignatureDescription
1TMtxVec *RealPart(TMtxVec *Vec) const;Gets real part of complex object values.
2TMtxVec *RealPart(TMtxVec *Vec, int VecIndex, int Index, int Len) const;Gets the real part of a Vec object complex elements [VecIndex]..[VecIndex+Len-1].

Overload 1: TMtxVec *RealPart(TMtxVec *Vec) const;

Gets real part of complex object values.

#NameTypeDescription
1VecTMtxVec *
Remarks:

The method method gets the real part of a complex object Vec and stores the real results in the calling object. Size and Vector::Complex properties of the calling object are set implicitly to match Vec object. Vec Vector::Complex property must be true otherwise an exception is raised.

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Vector a, b;

    a.SetIt(true, DewArray<double>{1, 2, 3, 4}); // = [1+2i, 3+4i]
    b.RealPart(a); // b = [1,3]
}
See Also: Vector::ImagPart
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 2: TMtxVec *RealPart(TMtxVec *Vec, int VecIndex, int Index, int Len) const;

Gets the real part of a Vec object complex elements [VecIndex]..[VecIndex+Len-1].

#NameTypeDescription
1VecTMtxVec *
2VecIndexint
3Indexint
4Lenint
Remarks:

Stores the results in calling object real elements [Index]..[Index+Len-1]. An exception is raised if array borders are overrun or underrun or if Vec object Vector::Complex propety is false.

Examples
#include "MtxExpr.h"
#include "Units.Math387.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;

void Example()
{
    Vector a, b;

    a = {Cplx(1, 2), Cplx(3, 4)}; // = [1+2i, 3+4i]
    b.RealPart(a); // b = [1,3]
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler