MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Protected Attributes
mds::math::CComplex< T > Class Template Reference

Class representing a complex number. More...

#include <mdsComplex.h>

List of all members.

Public Types

typedef T tComponent
 Type of the complex number component.

Public Member Functions

 CComplex ()
 Default constructor.
 CComplex (tComponent r, tComponent i)
 Constructor.
 CComplex (tComponent r)
 Constructor.
 CComplex (const std::complex< T > &z)
 Constructor.
 CComplex (const CComplex &z)
 Copy constructor.
std::complex< T > conv2Std () const
 Conversion to the STL complex number.
CComplexget (tComponent &r, tComponent &i)
 Returns both the real and the imaginary part of the complex number.
const CComplexget (tComponent &r, tComponent &i) const
tComponent getArg () const
 Returns argument (angle) of the complex number.
CComplex getConj () const
 Returns complex conjugate number.
tComponentgetImag ()
 Returns imaginary part of the complex number.
const tComponentgetImag () const
tComponent getMag () const
 Returns absolute value (magnitude) of the complex number.
tComponent getNorm () const
 Returns squared absolute value of the complex number.
tComponentgetReal ()
 Returns real part of the complex number.
const tComponentgetReal () const
tComponentim ()
 Returns imaginary part of the complex number.
const tComponentim () const
CComplexnormalize ()
 Normalizes the complex number so that the absolute value is equal to one.
CComplexoperator*= (const CComplex &z)
CComplexoperator*= (const T &c)
CComplexoperator+= (const CComplex &z)
 Combined assignment operators.
CComplexoperator+= (const T &c)
 Others combined assignment operators.
CComplexoperator-= (const CComplex &z)
CComplexoperator-= (const T &c)
CComplexoperator/= (const CComplex &z)
CComplexoperator/= (const T &c)
CComplexoperator= (const CComplex &z)
 Assignment operator.
CComplexoperator= (const std::complex< T > &z)
 Assignment operator.
CComplexoperator= (tComponent r)
 Assignment operator.
tComponentre ()
 Returns real part of the complex number.
const tComponentre () const
CComplexset (tComponent r, tComponent i)
 Sets real and imaginary part of the complex number.
CComplexsetImag (tComponent i)
 Sets imaginary part of the complex number.
CComplexsetReal (tComponent r)
 Sets real part of the complex number.
 ~CComplex ()
 Destructor.

Protected Attributes

m_im
m_re
 Real and imaginary part of the complex number.

Detailed Description

template<typename T>
class mds::math::CComplex< T >

Class representing a complex number.


Member Typedef Documentation

template<typename T >
typedef T mds::math::CComplex< T >::tComponent

Type of the complex number component.


Constructor & Destructor Documentation

template<typename T >
mds::math::CComplex< T >::CComplex ( )

Default constructor.

template<typename T >
mds::math::CComplex< T >::CComplex ( tComponent  r,
tComponent  i 
)

Constructor.

template<typename T >
mds::math::CComplex< T >::CComplex ( tComponent  r) [explicit]

Constructor.

  • Creates complex number from a given real number.
template<typename T >
mds::math::CComplex< T >::CComplex ( const std::complex< T > &  z) [explicit]

Constructor.

template<typename T >
mds::math::CComplex< T >::~CComplex ( )

Destructor.

template<typename T >
mds::math::CComplex< T >::CComplex ( const CComplex< T > &  z)

Copy constructor.


Member Function Documentation

template<typename T >
std::complex<T> mds::math::CComplex< T >::conv2Std ( ) const

Conversion to the STL complex number.

template<typename T >
CComplex& mds::math::CComplex< T >::get ( tComponent r,
tComponent i 
)

Returns both the real and the imaginary part of the complex number.

template<typename T >
const CComplex& mds::math::CComplex< T >::get ( tComponent r,
tComponent i 
) const
template<typename T >
tComponent mds::math::CComplex< T >::getArg ( ) const

Returns argument (angle) of the complex number.

template<typename T >
CComplex mds::math::CComplex< T >::getConj ( ) const

Returns complex conjugate number.

template<typename T >
tComponent& mds::math::CComplex< T >::getImag ( )

Returns imaginary part of the complex number.

template<typename T >
const tComponent& mds::math::CComplex< T >::getImag ( ) const
template<typename T >
tComponent mds::math::CComplex< T >::getMag ( ) const

Returns absolute value (magnitude) of the complex number.

template<typename T >
tComponent mds::math::CComplex< T >::getNorm ( ) const

Returns squared absolute value of the complex number.

template<typename T >
tComponent& mds::math::CComplex< T >::getReal ( )

Returns real part of the complex number.

template<typename T >
const tComponent& mds::math::CComplex< T >::getReal ( ) const
template<typename T >
tComponent& mds::math::CComplex< T >::im ( )

Returns imaginary part of the complex number.

template<typename T >
const tComponent& mds::math::CComplex< T >::im ( ) const
template<typename T >
CComplex& mds::math::CComplex< T >::normalize ( )

Normalizes the complex number so that the absolute value is equal to one.

template<typename T >
CComplex< T > & mds::math::CComplex< T >::operator*= ( const CComplex< T > &  z)
template<typename T >
CComplex< T > & mds::math::CComplex< T >::operator*= ( const T &  c)
template<typename T >
CComplex< T > & mds::math::CComplex< T >::operator+= ( const CComplex< T > &  z)

Combined assignment operators.

template<typename T >
CComplex< T > & mds::math::CComplex< T >::operator+= ( const T &  c)

Others combined assignment operators.

template<typename T >
CComplex< T > & mds::math::CComplex< T >::operator-= ( const CComplex< T > &  z)
template<typename T >
CComplex< T > & mds::math::CComplex< T >::operator-= ( const T &  c)
template<typename T >
CComplex< T > & mds::math::CComplex< T >::operator/= ( const CComplex< T > &  z)
template<typename T >
CComplex< T > & mds::math::CComplex< T >::operator/= ( const T &  c)
template<typename T >
CComplex& mds::math::CComplex< T >::operator= ( const CComplex< T > &  z)

Assignment operator.

template<typename T >
CComplex& mds::math::CComplex< T >::operator= ( const std::complex< T > &  z)

Assignment operator.

template<typename T >
CComplex& mds::math::CComplex< T >::operator= ( tComponent  r)

Assignment operator.

template<typename T >
tComponent& mds::math::CComplex< T >::re ( )

Returns real part of the complex number.

template<typename T >
const tComponent& mds::math::CComplex< T >::re ( ) const
template<typename T >
CComplex& mds::math::CComplex< T >::set ( tComponent  r,
tComponent  i 
)

Sets real and imaginary part of the complex number.

template<typename T >
CComplex& mds::math::CComplex< T >::setImag ( tComponent  i)

Sets imaginary part of the complex number.

template<typename T >
CComplex& mds::math::CComplex< T >::setReal ( tComponent  r)

Sets real part of the complex number.


Member Data Documentation

template<typename T >
T mds::math::CComplex< T >::m_im [protected]
template<typename T >
T mds::math::CComplex< T >::m_re [protected]

Real and imaginary part of the complex number.


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