Public Member Functions | Static Public Member Functions

zeus::TComplex Class Reference

#include <Complex.h>

List of all members.

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

zeus::TComplex::TComplex (  ) [inline]

Creates a complex number 0 + 0i

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

Copy constructor

Parameters:
rInpar: complex value to assign
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
zeus::TComplex::TComplex ( const Float &  fX ) [inline]

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

Parameters:
fX: real value
zeus::TComplex::TComplex ( Int  iX ) [inline]

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

Parameters:
iX: integer value
zeus::TComplex::TComplex ( int  iX ) [inline]

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

Parameters:
iX: integer value
virtual zeus::TComplex::~TComplex (  ) [inline, virtual]

Destroys the complex number


Member Function Documentation

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

assigns a complex number

Parameters:
rInpar: complex number to assign
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
false,:are not equal
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
false,:are not equal
const Float zeus::TComplex::getAbsValue (  ) const [inline]

returns the absolute component of the complex value

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

returns the argument component of the complex value

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

returns the imaginary component of the complex value

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

returns the real component of the complex value

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

Checks if the number is complex

Return values:
false,:is real
true: is complex
bool zeus::TComplex::isImaginary (  ) const [inline]

Checks if the complex number is imaginary

Return values:
true: is imaginary
false,:is complex or real
bool zeus::TComplex::isReal (  ) const [inline]

Checks if the complex number is real

Return values:
true: is real
false,:is complex
static TComplex zeus::TComplex::log ( const TComplex z ) [inline, static]

logarithm naturalis

Parameters:
z,:complex value
Returns:
log(z)
static TComplex zeus::TComplex::log ( const TComplex z,
const Float &  fBasis 
) [inline, static]

generic logarithm

Parameters:
z,:complex value
fBasis: Basis of th log
Returns:
log_fBasis(z)
static TComplex zeus::TComplex::log10 ( const TComplex z ) [inline, static]

decimal logarithm

Parameters:
z: complex value
Returns:
log10(z)
bool zeus::TComplex::operator!= ( const TComplex z ) const [inline]
bool zeus::TComplex::operator!= ( const Float &  x ) const [inline]
TComplex zeus::TComplex::operator* ( const TComplex b ) const [inline]
TComplex zeus::TComplex::operator* ( const Float &  x ) const [inline]
void zeus::TComplex::operator*= ( const TComplex z ) [inline]
void zeus::TComplex::operator*= ( const Float &  x ) [inline]
TComplex zeus::TComplex::operator+ ( const TComplex z ) const [inline]
TComplex zeus::TComplex::operator+ ( const Float &  x ) const [inline]
void zeus::TComplex::operator+= ( const TComplex z ) [inline]
void zeus::TComplex::operator+= ( const Float &  x ) [inline]
TComplex zeus::TComplex::operator- ( const TComplex z ) const [inline]
TComplex zeus::TComplex::operator- ( const Float &  x ) const [inline]
void zeus::TComplex::operator-= ( const TComplex z ) [inline]
void zeus::TComplex::operator-= ( const Float &  x ) [inline]
TComplex zeus::TComplex::operator/ ( const Float &  x ) const [inline]
void zeus::TComplex::operator/= ( const Float &  x ) [inline]
const TComplex& zeus::TComplex::operator= ( const TComplex rX ) [inline]
const TComplex& zeus::TComplex::operator= ( Float  fReal ) [inline]
bool zeus::TComplex::operator== ( const TComplex z ) const [inline]
bool zeus::TComplex::operator== ( const Float &  x ) const [inline]
TComplex TComplex::pow ( const TComplex zBase,
const TComplex zExponent 
) [static]

operator to get the power

Parameters:
zBase,:base
zExponent: exponent
Return values:
zBase^ zExponent
void zeus::TComplex::setAbsValue ( const Float &  fAbsValue ) [inline]

Sets the absolute value as the polar component

Parameters:
fAbsValue: Absolute value
void zeus::TComplex::setArgument ( const Float &  fArgument ) [inline]

Sets the argument value as the polar component

Parameters:
fArgument: Argument value
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
void zeus::TComplex::setIm ( const Float &  fIm ) [inline]

Sets the imaginary component

Parameters:
fIm: imaginary component
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
void zeus::TComplex::setReal ( const Float &  fReal ) [inline]

Sets the real component

Parameters:
fReal: Real component
static TComplex zeus::TComplex::sqrt ( const TComplex z ) [inline, static]

Square root

Parameters:
z: complex value
Return values:
sqrt(z)
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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:32:27