ZeusMath-Library  2.0.4
zeus::TComplex Class Reference

#include <Complex.h>

Public Member Functions

 TComplex ()
 
 TComplex (const TComplex &rInpar)
 
 TComplex (const Float &fValue1, const Float &fValue2, bool bPolar=false)
 
 TComplex (const Float &fX)
 
 TComplex (Int iX)
 
 TComplex (int iX)
 
virtual ~TComplex ()
 
void assign (const TComplex &rInpar)
 
bool equals (const TComplex &rInpar, Float fPrecision=FLOAT_PRECISION) const
 
bool equals (const Float &rX, Float fPrecision=FLOAT_PRECISION) const
 
const Float & getReal () const
 
const Float & getIm () const
 
const Float getAbsValue () const
 
const Float getArgument () const
 
bool isReal () const
 
bool isImaginary () const
 
bool isComplex () const
 
void setReal (const Float &fReal)
 
void setIm (const Float &fIm)
 
void setAbsValue (const Float &fAbsValue)
 
void setArgument (const Float &fArgument)
 
void setCartesianValues (const Float &fReal, const Float &fIm)
 
void setPolarValues (const Float &fAbsValue, const Float &fArgument)
 
TString toString (Float fRoundPrecision=0.0001, bool bPolar=false) const
 
TComplex operator+ (const TComplex &z) const
 
TComplex operator+ (const Float &x) const
 
TComplex operator- (const TComplex &z) const
 
TComplex operator- (const Float &x) const
 
TComplex operator* (const TComplex &b) const
 
TComplex operator* (const Float &x) const
 
TComplex operator/ (const Float &x) const
 
void operator+= (const TComplex &z)
 
void operator+= (const Float &x)
 
void operator-= (const TComplex &z)
 
void operator-= (const Float &x)
 
void operator*= (const TComplex &z)
 
void operator*= (const Float &x)
 
void operator/= (const Float &x)
 
const TComplexoperator= (const TComplex &rX)
 
const TComplexoperator= (Float fReal)
 
bool operator== (const TComplex &z) const
 
bool operator== (const Float &x) const
 
bool operator!= (const TComplex &z) const
 
bool operator!= (const Float &x) const
 

Static Public Member Functions

static TComplex log (const TComplex &z)
 
static TComplex log (const TComplex &z, const Float &fBasis)
 
static TComplex log10 (const TComplex &z)
 
static TComplex sqrt (const TComplex &z)
 
static TComplex pow (const TComplex &zBase, const TComplex &zExponent)
 

Detailed Description

This datatype implements a complex number

Constructor & Destructor Documentation

§ TComplex() [1/6]

zeus::TComplex::TComplex ( )
inline

Creates a complex number 0 + 0i

§ TComplex() [2/6]

zeus::TComplex::TComplex ( const TComplex rInpar)
inline

Copy constructor

Parameters
rInpar: complex value to assign

§ TComplex() [3/6]

zeus::TComplex::TComplex ( const Float &  fValue1,
const Float &  fValue2,
bool  bPolar = false 
)
inline

Creates a complex number fValue1 + fValue2i if the bPolar-Flag is not set (default) or fValue1*e^(i*fValue2) if the flag is set (polar form)

Parameters
fValue1: value 1 (real or absolute value)
fValue2: value 2 (imaginary or argument value)
bPolar: Flag must be set for polar values

§ TComplex() [4/6]

zeus::TComplex::TComplex ( const Float &  fX)
inline

Creates a complex number out of a real number (no imaginary component)

Parameters
fX: real value

§ TComplex() [5/6]

zeus::TComplex::TComplex ( Int  iX)
inline

Creates a complex number out of an integer number (no imaginary component)

Parameters
iX: integer value

§ TComplex() [6/6]

zeus::TComplex::TComplex ( int  iX)
inline

Creates a complex number out of an integer number (no imaginary component)

Parameters
iX: integer value

§ ~TComplex()

virtual zeus::TComplex::~TComplex ( )
inlinevirtual

Destroys the complex number

Member Function Documentation

§ assign()

void zeus::TComplex::assign ( const TComplex rInpar)
inline

assigns a complex number

Parameters
rInpar: complex number to assign

§ equals() [1/2]

bool zeus::TComplex::equals ( const TComplex rInpar,
Float  fPrecision = FLOAT_PRECISION 
) const
inline

checks if two complex numbers are equal

Parameters
rInpar: complex value to check
fPrecision: Precision of the float comparing
Return values
true: are equal
falseare not equal

§ equals() [2/2]

bool zeus::TComplex::equals ( const Float &  rX,
Float  fPrecision = FLOAT_PRECISION 
) const
inline

checks if a real number numbers equals the complex number

Parameters
rX: real value to check
fPrecision: Precision of the float comparing
Return values
true: are equal
falseare not equal

§ getAbsValue()

const Float zeus::TComplex::getAbsValue ( ) const
inline

returns the absolute component of the complex value

§ getArgument()

const Float zeus::TComplex::getArgument ( ) const
inline

returns the argument component of the complex value

§ getIm()

const Float& zeus::TComplex::getIm ( ) const
inline

returns the imaginary component of the complex value

§ getReal()

const Float& zeus::TComplex::getReal ( ) const
inline

returns the real component of the complex value

§ isComplex()

bool zeus::TComplex::isComplex ( ) const
inline

Checks if the number is complex

Return values
falseis real
true: is complex

§ isImaginary()

bool zeus::TComplex::isImaginary ( ) const
inline

Checks if the complex number is imaginary

Return values
true: is imaginary
falseis complex or real

§ isReal()

bool zeus::TComplex::isReal ( ) const
inline

Checks if the complex number is real

Return values
true: is real
falseis complex

§ log() [1/2]

static TComplex zeus::TComplex::log ( const TComplex z)
inlinestatic

logarithm naturalis

Parameters
zcomplex value
Returns
log(z)

§ log() [2/2]

static TComplex zeus::TComplex::log ( const TComplex z,
const Float &  fBasis 
)
inlinestatic

generic logarithm

Parameters
zcomplex value
fBasis: Basis of th log
Returns
log_fBasis(z)

§ log10()

static TComplex zeus::TComplex::log10 ( const TComplex z)
inlinestatic

decimal logarithm

Parameters
z: complex value
Returns
log10(z)

§ operator!=() [1/2]

bool zeus::TComplex::operator!= ( const TComplex z) const
inline

§ operator!=() [2/2]

bool zeus::TComplex::operator!= ( const Float &  x) const
inline

§ operator*() [1/2]

TComplex zeus::TComplex::operator* ( const TComplex b) const
inline

§ operator*() [2/2]

TComplex zeus::TComplex::operator* ( const Float &  x) const
inline

§ operator*=() [1/2]

void zeus::TComplex::operator*= ( const TComplex z)
inline

§ operator*=() [2/2]

void zeus::TComplex::operator*= ( const Float &  x)
inline

§ operator+() [1/2]

TComplex zeus::TComplex::operator+ ( const TComplex z) const
inline

§ operator+() [2/2]

TComplex zeus::TComplex::operator+ ( const Float &  x) const
inline

§ operator+=() [1/2]

void zeus::TComplex::operator+= ( const TComplex z)
inline

§ operator+=() [2/2]

void zeus::TComplex::operator+= ( const Float &  x)
inline

§ operator-() [1/2]

TComplex zeus::TComplex::operator- ( const TComplex z) const
inline

§ operator-() [2/2]

TComplex zeus::TComplex::operator- ( const Float &  x) const
inline

§ operator-=() [1/2]

void zeus::TComplex::operator-= ( const TComplex z)
inline

§ operator-=() [2/2]

void zeus::TComplex::operator-= ( const Float &  x)
inline

§ operator/()

TComplex zeus::TComplex::operator/ ( const Float &  x) const
inline

§ operator/=()

void zeus::TComplex::operator/= ( const Float &  x)
inline

§ operator=() [1/2]

const TComplex& zeus::TComplex::operator= ( const TComplex rX)
inline

§ operator=() [2/2]

const TComplex& zeus::TComplex::operator= ( Float  fReal)
inline

§ operator==() [1/2]

bool zeus::TComplex::operator== ( const TComplex z) const
inline

§ operator==() [2/2]

bool zeus::TComplex::operator== ( const Float &  x) const
inline

§ pow()

TComplex TComplex::pow ( const TComplex zBase,
const TComplex zExponent 
)
static

operator to get the power

Parameters
zBasebase
zExponent: exponent
Return values
zBase^ zExponent

§ setAbsValue()

void zeus::TComplex::setAbsValue ( const Float &  fAbsValue)
inline

Sets the absolute value as the polar component

Parameters
fAbsValue: Absolute value

§ setArgument()

void zeus::TComplex::setArgument ( const Float &  fArgument)
inline

Sets the argument value as the polar component

Parameters
fArgument: Argument value

§ setCartesianValues()

void zeus::TComplex::setCartesianValues ( const Float &  fReal,
const Float &  fIm 
)
inline

Sets the real and imaginary values of the complex number

Parameters
fReal: Real component
fIm: Imaginary component

§ setIm()

void zeus::TComplex::setIm ( const Float &  fIm)
inline

Sets the imaginary component

Parameters
fIm: imaginary component

§ setPolarValues()

void zeus::TComplex::setPolarValues ( const Float &  fAbsValue,
const Float &  fArgument 
)
inline

Sets the absolute and argument values of the complex number

Parameters
fAbsValue: absolute value
fArgument: argument value

§ setReal()

void zeus::TComplex::setReal ( const Float &  fReal)
inline

Sets the real component

Parameters
fReal: Real component

§ sqrt()

static TComplex zeus::TComplex::sqrt ( const TComplex z)
inlinestatic

Square root

Parameters
z: complex value
Return values
sqrt(z)

§ toString()

TString TComplex::toString ( Float  fRoundPrecision = 0.0001,
bool  bPolar = false 
) const

Prints a complex number as string

Parameters
fRoundPrecision: Rounding precision
bPolar: Flag to either print in regular comple notation or in polar notation
Returns
formated string

The documentation for this class was generated from the following files:


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Wed Sep 14 2016 06:46:05