latest version v1.9 - last update 10 Apr 2010 |
Class to represent and manipulate complex numbers. More...
#include <ltiComplex.h>
Public Member Functions | |
complex (const T &=T(), const T &=T()) | |
template<class U > | |
complex (const complex< U > &other) | |
complex (const std::complex< T > &other) | |
operator std::complex< T > () | |
T | real () const |
T | imag () const |
complex< T > & | operator= (const T &other) |
complex< T > & | operator+= (const T &other) |
complex< T > & | operator-= (const T &other) |
complex< T > & | operator*= (const T &other) |
complex< T > & | operator/= (const T &other) |
template<typename U > | |
complex< T > & | operator= (const complex< U > &other) |
template<typename U > | |
complex< T > & | operator+= (const complex< U > &other) |
template<typename U > | |
complex< T > & | operator-= (const complex< U > &other) |
template<typename U > | |
complex< T > & | operator*= (const complex< U > &other) |
template<typename U > | |
complex< T > & | operator/= (const complex< U > &other) |
Class to represent and manipulate complex numbers.
The complex numbers contain a real and an imaginary part, which can be accessed through the methods real() and imag().
The interface of this class is similar to the one provided by the Standard C++ library. It has being included in the LTI-Lib because different library versions do not provide the same functionality.
Note that many of the provided mathematical operations make only sense if the type used for the components of the complex number is double or float.
lti::complex< T >::complex | ( | const T & | re = T() , |
|
const T & | im = T() | |||
) | [inline] |
default constructor.
lti::complex< T >::complex | ( | const complex< U > & | other | ) | [inline] |
copy constructor
lti::complex< T >::complex | ( | const std::complex< T > & | other | ) | [inline] |
cast a std::complex to an lti::complex of the same type
T lti::complex< T >::imag | ( | ) | const [inline] |
return the imaginary component of the complex number
Referenced by lti::abs(), lti::acos(), lti::arg(), lti::asin(), lti::atan(), lti::conj(), lti::cos(), lti::cosh(), lti::exp(), lti::imag(), lti::norm(), lti::complex< T >::operator std::complex< T >(), lti::operator!=(), lti::complex< T >::operator*=(), lti::operator-(), lti::complex< T >::operator/=(), lti::operator==(), lti::operator>(), lti::sin(), lti::sinh(), lti::sqrt(), and lti::write().
lti::complex< T >::operator std::complex< T > | ( | ) | [inline] |
cast a lti::complex into a std::complex of the same type
References lti::complex< T >::imag(), and lti::complex< T >::real().
complex<T>& lti::complex< T >::operator*= | ( | const complex< U > & | other | ) | [inline] |
multiply with another complex number
References lti::complex< T >::imag(), and lti::complex< T >::real().
complex< T > & lti::complex< T >::operator*= | ( | const T & | other | ) | [inline] |
multiply this complex number with a real one.
complex<T>& lti::complex< T >::operator+= | ( | const complex< U > & | other | ) | [inline] |
add another complex number
complex< T > & lti::complex< T >::operator+= | ( | const T & | other | ) | [inline] |
add a real number to this complex one.
complex<T>& lti::complex< T >::operator-= | ( | const complex< U > & | other | ) | [inline] |
subtract another complex number
complex< T > & lti::complex< T >::operator-= | ( | const T & | other | ) | [inline] |
subtract a real number to this complex one.
complex<T>& lti::complex< T >::operator/= | ( | const complex< U > & | other | ) | [inline] |
divide with another complex number
References lti::complex< T >::imag(), lti::norm(), and lti::complex< T >::real().
complex< T > & lti::complex< T >::operator/= | ( | const T & | other | ) | [inline] |
divide this complex number by a real one.
complex<T>& lti::complex< T >::operator= | ( | const complex< U > & | other | ) | [inline] |
copy another complex number into this one
complex< T > & lti::complex< T >::operator= | ( | const T & | other | ) | [inline] |
copy a real number into this complex one, making the imaginary part zero.
T lti::complex< T >::real | ( | ) | const [inline] |
return the real component of the complex number
Referenced by lti::abs(), lti::acos(), lti::arg(), lti::asin(), lti::atan(), lti::conj(), lti::cos(), lti::cosh(), lti::exp(), lti::norm(), lti::complex< T >::operator std::complex< T >(), lti::operator!=(), lti::complex< T >::operator*=(), lti::operator-(), lti::complex< T >::operator/=(), lti::operator==(), lti::operator>(), lti::real(), lti::sin(), lti::sinh(), lti::sqrt(), and lti::write().