Openholo  v5.0
Open Source Digital Holographic Library
oph::Complex< T > Class Template Reference

class for the complex number and its arithmetic. type T == type cplx type only float || double T real() : real number T imag() : imaginary number More...

#include <complex.h>

Inheritance diagram for oph::Complex< T >:
Collaboration diagram for oph::Complex< T >:

Public Types

using cplx = typename std::enable_if< std::is_same< double, T >::value||std::is_same< float, T >::value||std::is_same< long double, T >::value, T >::type
 

Public Member Functions

 Complex ()
 
 Complex (T p)
 
 Complex (T tRe, T tIm)
 
 Complex (const Complex< T > &p)
 
mag2 () const
 
mag () const
 
arg () const
 
void euler (T &r, T &theta)
 
angle (void)
 
Complex< T > & exp ()
 
Complex< T > conj () const
 
Complex< T > & operator() (T re, T im)
 
Complex< T > & operator= (const Complex< T > &p)
 
Complex< T > & operator= (const T &p)
 
Complex< T > operator+ (const Complex< T > &p)
 
Complex< T > & operator+= (const Complex< T > &p)
 
Complex< T > operator+ (const T p)
 
Complex< T > & operator+= (const T p)
 
Complex< T > operator- (const Complex< T > &p)
 
Complex< T > & operator-= (const Complex< T > &p)
 
Complex< T > operator- (const T p)
 
Complex< T > & operator-= (const T p)
 
Complex< T > operator* (const T k)
 
Complex< T > & operator*= (const T k)
 
Complex< T > & operator= (const std::complex< T > &p)
 
Complex< T > operator* (const Complex< T > &p)
 
Complex< T > & operator*= (const Complex< T > &p)
 
Complex< T > operator/ (const T &p)
 
Complex< T > & operator/= (const T k)
 
Complex< T > operator/ (const Complex< T > &p)
 
Complex< T > & operator/= (const Complex< T > &p)
 
T & operator[] (const int idx)
 
bool operator< (const Complex< T > &p)
 
bool operator> (const Complex< T > &p)
 
 operator unsigned char ()
 
 operator int ()
 

Friends

Complex< T > operator+ (const Complex< T > &p, const T q)
 
Complex< T > operator- (const Complex< T > &p, const T q)
 
Complex< T > operator* (const T k, const Complex< T > &p)
 
Complex< T > operator* (const Complex< T > &p, const T k)
 
Complex< T > operator* (const Complex< T > &p, const Complex< T > &q)
 
Complex< T > operator/ (const Complex< T > &p, const Complex< T > &q)
 
Complex< T > operator/ (const Complex< T > &p, const T &q)
 
Complex< T > operator/ (const T &p, const Complex< T > &q)
 
bool operator< (const Complex< T > &p, const Complex< T > &q)
 
bool operator> (const Complex< T > &p, const Complex< T > &q)
 

Detailed Description

template<typename T = double>
class oph::Complex< T >

class for the complex number and its arithmetic. type T == type cplx type only float || double T real() : real number T imag() : imaginary number

Definition at line 354 of file complex.h.

Member Typedef Documentation

◆ cplx

template<typename T = double>
using oph::Complex< T >::cplx = typename std::enable_if<std::is_same<double, T>::value || std::is_same<float, T>::value || std::is_same<long double, T>::value, T>::type

Definition at line 357 of file complex.h.

Constructor & Destructor Documentation

◆ Complex() [1/4]

template<typename T = double>
oph::Complex< T >::Complex ( )
inline

Definition at line 360 of file complex.h.

◆ Complex() [2/4]

template<typename T = double>
oph::Complex< T >::Complex ( p)
inline

Definition at line 361 of file complex.h.

◆ Complex() [3/4]

template<typename T = double>
oph::Complex< T >::Complex ( tRe,
tIm 
)
inline

Definition at line 362 of file complex.h.

◆ Complex() [4/4]

template<typename T = double>
oph::Complex< T >::Complex ( const Complex< T > &  p)
inline

Definition at line 363 of file complex.h.

Member Function Documentation

◆ angle()

template<typename T = double>
T oph::Complex< T >::angle ( void  )
inline

Definition at line 387 of file complex.h.

◆ arg()

template<typename T = double>
T oph::Complex< T >::arg ( ) const
inline

Definition at line 370 of file complex.h.

◆ conj()

template<typename T = double>
Complex<T> oph::Complex< T >::conj ( ) const
inline

Definition at line 413 of file complex.h.

◆ euler()

template<typename T = double>
void oph::Complex< T >::euler ( T &  r,
T &  theta 
)
inline

Definition at line 381 of file complex.h.

◆ exp()

template<typename T = double>
Complex<T>& oph::Complex< T >::exp ( )
inline

Definition at line 395 of file complex.h.

◆ mag()

template<typename T = double>
T oph::Complex< T >::mag ( ) const
inline

Definition at line 368 of file complex.h.

◆ mag2()

template<typename T = double>
T oph::Complex< T >::mag2 ( ) const
inline

Definition at line 367 of file complex.h.

◆ operator int()

template<typename T = double>
oph::Complex< T >::operator int ( )
inline

Definition at line 577 of file complex.h.

◆ operator unsigned char()

template<typename T = double>
oph::Complex< T >::operator unsigned char ( )
inline

Definition at line 573 of file complex.h.

◆ operator()()

template<typename T = double>
Complex<T>& oph::Complex< T >::operator() ( re,
im 
)
inline

Definition at line 415 of file complex.h.

◆ operator*() [1/2]

template<typename T = double>
Complex<T> oph::Complex< T >::operator* ( const T  k)
inline

Definition at line 487 of file complex.h.

◆ operator*() [2/2]

template<typename T = double>
Complex<T> oph::Complex< T >::operator* ( const Complex< T > &  p)
inline

Definition at line 507 of file complex.h.

◆ operator*=() [1/2]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator*= ( const T  k)
inline

Definition at line 493 of file complex.h.

◆ operator*=() [2/2]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator*= ( const Complex< T > &  p)
inline

Definition at line 516 of file complex.h.

◆ operator+() [1/2]

template<typename T = double>
Complex<T> oph::Complex< T >::operator+ ( const Complex< T > &  p)
inline

Definition at line 437 of file complex.h.

◆ operator+() [2/2]

template<typename T = double>
Complex<T> oph::Complex< T >::operator+ ( const T  p)
inline

Definition at line 450 of file complex.h.

◆ operator+=() [1/2]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator+= ( const Complex< T > &  p)
inline

Definition at line 443 of file complex.h.

◆ operator+=() [2/2]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator+= ( const T  p)
inline

Definition at line 456 of file complex.h.

◆ operator-() [1/2]

template<typename T = double>
Complex<T> oph::Complex< T >::operator- ( const Complex< T > &  p)
inline

Definition at line 462 of file complex.h.

◆ operator-() [2/2]

template<typename T = double>
Complex<T> oph::Complex< T >::operator- ( const T  p)
inline

Definition at line 475 of file complex.h.

◆ operator-=() [1/2]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator-= ( const Complex< T > &  p)
inline

Definition at line 468 of file complex.h.

◆ operator-=() [2/2]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator-= ( const T  p)
inline

Definition at line 481 of file complex.h.

◆ operator/() [1/2]

template<typename T = double>
Complex<T> oph::Complex< T >::operator/ ( const T &  p)
inline

Definition at line 526 of file complex.h.

◆ operator/() [2/2]

template<typename T = double>
Complex<T> oph::Complex< T >::operator/ ( const Complex< T > &  p)
inline

Definition at line 539 of file complex.h.

◆ operator/=() [1/2]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator/= ( const T  k)
inline

Definition at line 532 of file complex.h.

◆ operator/=() [2/2]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator/= ( const Complex< T > &  p)
inline

Definition at line 550 of file complex.h.

◆ operator<()

template<typename T = double>
bool oph::Complex< T >::operator< ( const Complex< T > &  p)
inline

Definition at line 565 of file complex.h.

◆ operator=() [1/3]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator= ( const Complex< T > &  p)
inline

Definition at line 423 of file complex.h.

◆ operator=() [2/3]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator= ( const T &  p)
inline

Definition at line 430 of file complex.h.

◆ operator=() [3/3]

template<typename T = double>
Complex<T>& oph::Complex< T >::operator= ( const std::complex< T > &  p)
inline

Definition at line 500 of file complex.h.

◆ operator>()

template<typename T = double>
bool oph::Complex< T >::operator> ( const Complex< T > &  p)
inline

Definition at line 569 of file complex.h.

◆ operator[]()

template<typename T = double>
T& oph::Complex< T >::operator[] ( const int  idx)
inline

Definition at line 561 of file complex.h.

Friends And Related Function Documentation

◆ operator* [1/3]

template<typename T = double>
Complex<T> operator* ( const T  k,
const Complex< T > &  p 
)
friend

Definition at line 589 of file complex.h.

◆ operator* [2/3]

template<typename T = double>
Complex<T> operator* ( const Complex< T > &  p,
const T  k 
)
friend

Definition at line 593 of file complex.h.

◆ operator* [3/3]

template<typename T = double>
Complex<T> operator* ( const Complex< T > &  p,
const Complex< T > &  q 
)
friend

Definition at line 597 of file complex.h.

◆ operator+

template<typename T = double>
Complex<T> operator+ ( const Complex< T > &  p,
const T  q 
)
friend

Definition at line 581 of file complex.h.

◆ operator-

template<typename T = double>
Complex<T> operator- ( const Complex< T > &  p,
const T  q 
)
friend

Definition at line 585 of file complex.h.

◆ operator/ [1/3]

template<typename T = double>
Complex<T> operator/ ( const Complex< T > &  p,
const Complex< T > &  q 
)
friend

Definition at line 601 of file complex.h.

◆ operator/ [2/3]

template<typename T = double>
Complex<T> operator/ ( const Complex< T > &  p,
const T &  q 
)
friend

Definition at line 605 of file complex.h.

◆ operator/ [3/3]

template<typename T = double>
Complex<T> operator/ ( const T &  p,
const Complex< T > &  q 
)
friend

Definition at line 609 of file complex.h.

◆ operator<

template<typename T = double>
bool operator< ( const Complex< T > &  p,
const Complex< T > &  q 
)
friend

Definition at line 613 of file complex.h.

◆ operator>

template<typename T = double>
bool operator> ( const Complex< T > &  p,
const Complex< T > &  q 
)
friend

Definition at line 617 of file complex.h.


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