CAPD DynSys Library  5.2.0
capd::fields::Complex< T > Class Template Reference

Class Complex represents complex number. More...

#include <capd/fields/Complex.h>

Public Types

typedef T value_type
 

Public Member Functions

 Complex (const T &re=T(), const T &im=T())
 
 Complex (const Complex &other)=default
 
template<typename R >
 Complex (const Complex< R > &other)
 
real () const
 
void real (T value)
 
imag () const
 
void imag (T value)
 
Complexoperator+= (const T &other)
 
Complexoperator+= (const Complex &other)
 
Complexoperator-= (const T &other)
 
Complexoperator-= (const Complex &other)
 
Complexoperator*= (const T &other)
 
Complexoperator*= (const Complex &other)
 
Complexoperator/= (const T &other)
 
Complexoperator/= (const Complex &other)
 

Friends

Complex operator+ (const Complex &val)
 
Complex operator- (const Complex &val)
 
Complex operator+ (const Complex &a, const Complex &b)
 
More...
 
Complex operator+ (const Complex &a, const T &b)
 
Complex operator+ (const T &a, const Complex &b)
 
Complex operator- (const Complex &a, const Complex &b)
 
More...
 
Complex operator- (const Complex &a, const T &b)
 
Complex operator- (const T &a, const Complex &b)
 
Complex operator* (const Complex &a, const Complex &b)
 
More...
 
Complex operator* (const Complex &a, const T &b)
 
Complex operator* (const T &a, const Complex &b)
 
Complex operator/ (const Complex &x, const Complex &y)
 / More...
 
Complex operator/ (const Complex &a, const T &b)
 
Complex operator/ (const T &a, const Complex &b)
 
bool operator== (const Complex &a, const Complex &b)
 
bool operator!= (const Complex &a, const Complex &b)
 
std::ostream & operator<< (std::ostream &out, const Complex &z)
 

Detailed Description

template<typename T>
class capd::fields::Complex< T >

Class Complex represents complex number.

This is replacement for std::complex for user defined types especially intervals. For built-in floating point types it uses std::complex. It also adds TypeTraits and functions needed by vectalg algorithms (like capd::abs, capd::min).

Template Parameters
Ttype of real and imaginary part

Member Typedef Documentation

◆ value_type

template<typename T >
typedef T capd::fields::Complex< T >::value_type

Constructor & Destructor Documentation

◆ Complex() [1/3]

template<typename T >
capd::fields::Complex< T >::Complex ( const T &  re = T(),
const T &  im = T() 
)
inline

◆ Complex() [2/3]

template<typename T >
capd::fields::Complex< T >::Complex ( const Complex< T > &  other)
default

◆ Complex() [3/3]

template<typename T >
template<typename R >
capd::fields::Complex< T >::Complex ( const Complex< R > &  other)
inlineexplicit

Member Function Documentation

◆ imag() [1/2]

template<typename T >
T capd::fields::Complex< T >::imag ( ) const
inline

◆ imag() [2/2]

template<typename T >
void capd::fields::Complex< T >::imag ( value)
inline

◆ operator*=() [1/2]

template<typename T >
Complex& capd::fields::Complex< T >::operator*= ( const Complex< T > &  other)
inline

◆ operator*=() [2/2]

template<typename T >
Complex& capd::fields::Complex< T >::operator*= ( const T &  other)
inline

◆ operator+=() [1/2]

template<typename T >
Complex& capd::fields::Complex< T >::operator+= ( const Complex< T > &  other)
inline

◆ operator+=() [2/2]

template<typename T >
Complex& capd::fields::Complex< T >::operator+= ( const T &  other)
inline

◆ operator-=() [1/2]

template<typename T >
Complex& capd::fields::Complex< T >::operator-= ( const Complex< T > &  other)
inline

◆ operator-=() [2/2]

template<typename T >
Complex& capd::fields::Complex< T >::operator-= ( const T &  other)
inline

◆ operator/=() [1/2]

template<typename T >
Complex& capd::fields::Complex< T >::operator/= ( const Complex< T > &  other)
inline

◆ operator/=() [2/2]

template<typename T >
Complex& capd::fields::Complex< T >::operator/= ( const T &  other)
inline

◆ real() [1/2]

template<typename T >
T capd::fields::Complex< T >::real ( ) const
inline

◆ real() [2/2]

template<typename T >
void capd::fields::Complex< T >::real ( value)
inline

Friends And Related Function Documentation

◆ operator!=

template<typename T >
bool operator!= ( const Complex< T > &  a,
const Complex< T > &  b 
)
friend

◆ operator* [1/3]

template<typename T >
Complex operator* ( const Complex< T > &  a,
const Complex< T > &  b 
)
friend

◆ operator* [2/3]

template<typename T >
Complex operator* ( const Complex< T > &  a,
const T &  b 
)
friend

◆ operator* [3/3]

template<typename T >
Complex operator* ( const T &  a,
const Complex< T > &  b 
)
friend

◆ operator+ [1/4]

template<typename T >
Complex operator+ ( const Complex< T > &  a,
const Complex< T > &  b 
)
friend

◆ operator+ [2/4]

template<typename T >
Complex operator+ ( const Complex< T > &  a,
const T &  b 
)
friend

◆ operator+ [3/4]

template<typename T >
Complex operator+ ( const Complex< T > &  val)
friend

◆ operator+ [4/4]

template<typename T >
Complex operator+ ( const T &  a,
const Complex< T > &  b 
)
friend

◆ operator- [1/4]

template<typename T >
Complex operator- ( const Complex< T > &  a,
const Complex< T > &  b 
)
friend

◆ operator- [2/4]

template<typename T >
Complex operator- ( const Complex< T > &  a,
const T &  b 
)
friend

◆ operator- [3/4]

template<typename T >
Complex operator- ( const Complex< T > &  val)
friend

◆ operator- [4/4]

template<typename T >
Complex operator- ( const T &  a,
const Complex< T > &  b 
)
friend

◆ operator/ [1/3]

template<typename T >
Complex operator/ ( const Complex< T > &  a,
const T &  b 
)
friend

◆ operator/ [2/3]

template<typename T >
Complex operator/ ( const Complex< T > &  x,
const Complex< T > &  y 
)
friend

/

◆ operator/ [3/3]

template<typename T >
Complex operator/ ( const T &  a,
const Complex< T > &  b 
)
friend

◆ operator<<

template<typename T >
std::ostream& operator<< ( std::ostream &  out,
const Complex< T > &  z 
)
friend

◆ operator==

template<typename T >
bool operator== ( const Complex< T > &  a,
const Complex< T > &  b 
)
friend