TBCI Numerical high perf. C++ Library  2.8.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
cplx< T > Class Template Reference

Our own complex class. More...

#include <cplx.h>

Public Types

typedef T value_type
 
typedef T aligned_value_type TALIGN(MIN_ALIGN)
 
typedef T cplx_base
 
typedef cplx< Tcplx_t
 

Public Member Functions

 cplx ()
 
 cplx (const T r, const T i=(T) 0)
 
 cplx (const cplx< T > &c)
 
template<typename U >
 cplx (const cplx< U > &c)
 
 ~cplx ()
 
cplx< T > & operator= (const T r)
 
cplx< T > & operator= (const cplx< T > &c)
 
cplx< T > & operator+= (const T)
 
cplx< T > & operator+= (const cplx< T > &)
 
cplx< T > & operator-= (const T)
 
cplx< T > & operator-= (const cplx< T > &)
 
cplx< T > & operator*= (const T)
 
cplx< T > & operator*= (const cplx< T > &)
 
cplx< T > & operator/= (const T)
 
cplx< T > & operator/= (const cplx< T > &)
 
cplx< T > & set (const T r, const T i)
 
T real () const
 
T imag () const
 
Treal ()
 
Timag ()
 
cplx< Toperator+ (const cplx< T > &) const
 
cplx< Toperator- (const cplx< T > &) const
 
cplx< Toperator* (const cplx< T > &) const
 
cplx< Toperator/ (const cplx< T > &) const
 
cplx< Tplus (const T v) const
 
cplx< Tminus (const T v) const
 
cplx< Tmult (const T v) const
 
cplx< Tdiv (const T a) const
 
cplx< Toperator+ (const T) const
 
cplx< Toperator- (const T) const
 
cplx< Toperator* (const T) const
 
cplx< Toperator/ (const T) const
 
cplx< Toperator- () const
 
cplx< Toperator~ () const
 
T theta () const
 
cplx< Tconj () const
 
cplx< T > & do_conj ()
 
double fabssqr () const
 
double fabs () const
 
double norm () const
 
T abs () const
 
cplx< Texp () const
 
cplx< Tsqrt () const
 
cplx< Tpower (const double) const
 
cplx< Tpower (const cplx< T > &) const
 
cplx< Tln () const
 
cplx< Tsin () const
 
cplx< Tcos () const
 
cplx< Tsinh () const
 
cplx< Tcosh () const
 
cplx< Tasin () const
 
cplx< Tacos () const
 
cplx< Tatan () const
 
cplx< Tasinh () const
 
cplx< Tacosh () const
 
cplx< Tatanh () const
 
bool operator== (const cplx< T > &c) const
 
bool operator!= (const cplx< T > &c) const
 
bool operator> (const cplx< T > &c) const
 
bool operator>= (const cplx< T > &c) const
 
bool operator< (const cplx< T > &c) const
 
bool operator<= (const cplx< T > &c) const
 

Protected Member Functions

T re ALIGN (MIN_ALIGN)
 

Protected Attributes

T re im
 

Friends

template<typename U >
class cplx
 
cplx< T > dot FGD (const cplx< T > &, const cplx< T > &)
 
STD__ ostream & operator<< FGD (STD__ ostream &, const cplx< T > &)
 
STD__ istream & operator>> FGD (STD__ istream &, cplx< T > &)
 

Detailed Description

template<typename T>
class cplx< T >

Our own complex class.

Definition at line 48 of file cplx.h.

Member Typedef Documentation

◆ cplx_base

template<typename T>
typedef T cplx< T >::cplx_base

Definition at line 67 of file cplx.h.

◆ cplx_t

template<typename T>
typedef cplx<T> cplx< T >::cplx_t

Definition at line 68 of file cplx.h.

◆ TALIGN

template<typename T>
typedef T aligned_value_type cplx< T >::TALIGN(MIN_ALIGN)

Definition at line 66 of file cplx.h.

◆ value_type

template<typename T>
typedef T cplx< T >::value_type

Definition at line 65 of file cplx.h.

Constructor & Destructor Documentation

◆ cplx() [1/4]

template<typename T>
cplx< T >::cplx ( )
inline

Definition at line 71 of file cplx.h.

◆ cplx() [2/4]

template<typename T>
cplx< T >::cplx ( const T  r,
const T  i = (T)0 
)
inline

Definition at line 72 of file cplx.h.

◆ cplx() [3/4]

template<typename T>
cplx< T >::cplx ( const cplx< T > &  c)
inline

Definition at line 73 of file cplx.h.

◆ cplx() [4/4]

template<typename T>
template<typename U >
cplx< T >::cplx ( const cplx< U > &  c)
inlineexplicit

Definition at line 79 of file cplx.h.

◆ ~cplx()

template<typename T>
cplx< T >::~cplx ( )
inline

Definition at line 85 of file cplx.h.

Member Function Documentation

◆ abs()

template<typename T >
T cplx< T >::abs ( ) const
inline

Definition at line 411 of file cplx.h.

References abs(), CSTD__, GLBL__, cplx< T >::im, MATH__, sqrt(), and UNLIKELY.

◆ acos()

template<typename T >
cplx< T > cplx< T >::acos ( ) const

Definition at line 532 of file cplx.h.

References arg(), GLBL__, MATH__, sqr(), and sqrt().

◆ acosh()

template<typename T >
cplx< T > cplx< T >::acosh ( ) const

Definition at line 546 of file cplx.h.

References arg(), GLBL__, MATH__, sqr(), and sqrt().

◆ ALIGN()

template<typename T>
T re cplx< T >::ALIGN ( MIN_ALIGN  )
protected

Referenced by cplx< T >::div().

◆ asin()

template<typename T >
cplx< T > cplx< T >::asin ( ) const

Definition at line 525 of file cplx.h.

References arg(), GLBL__, cplx< T >::im, MATH__, sqr(), and sqrt().

◆ asinh()

template<typename T >
cplx< T > cplx< T >::asinh ( ) const

Definition at line 539 of file cplx.h.

References arg(), GLBL__, MATH__, sqr(), and sqrt().

◆ atan()

template<typename T >
cplx< T > cplx< T >::atan ( ) const

Definition at line 553 of file cplx.h.

References arg(), and cplx< T >::im.

◆ atanh()

template<typename T >
cplx< T > cplx< T >::atanh ( ) const

Definition at line 560 of file cplx.h.

References arg().

◆ conj()

template<typename T>
cplx<T> cplx< T >::conj ( ) const
inline

Definition at line 158 of file cplx.h.

References cplx< T >::im.

◆ cos()

template<typename T >
cplx< T > cplx< T >::cos ( ) const

Definition at line 506 of file cplx.h.

References cplx< T >::exp(), exp(), and cplx< T >::im.

◆ cosh()

template<typename T >
cplx< T > cplx< T >::cosh ( ) const

Definition at line 519 of file cplx.h.

References exp().

◆ div()

template<typename T>
cplx<T> cplx< T >::div ( const T  a) const
inline

Definition at line 137 of file cplx.h.

References a, cplx< T >::ALIGN(), cplx< T >::im, MIN_ALIGN, REGISTER, and T.

◆ do_conj()

template<typename T>
cplx<T>& cplx< T >::do_conj ( )
inline

Definition at line 162 of file cplx.h.

References cplx< T >::im.

◆ exp()

template<typename T >
cplx< T > cplx< T >::exp ( ) const
inline

Definition at line 473 of file cplx.h.

References exp(), expi(), GLBL__, imag(), MATH__, real(), and TBCI__.

Referenced by cplx< T >::cos(), and cplx< T >::sin().

◆ fabs()

template<typename T >
double cplx< T >::fabs ( ) const
inline

Definition at line 395 of file cplx.h.

References fabs(), GLBL__, cplx< T >::im, MATH__, sqrt(), and UNLIKELY.

◆ fabssqr()

template<typename T>
double cplx< T >::fabssqr ( ) const
inline

◆ imag() [1/2]

template<typename T>
T cplx< T >::imag ( ) const
inline

Definition at line 107 of file cplx.h.

References cplx< T >::im.

Referenced by besselh1(), besselh2(), besseli(), besselj(), besselk(), bessely(), and gamma().

◆ imag() [2/2]

template<typename T>
T& cplx< T >::imag ( )
inline

Definition at line 110 of file cplx.h.

References cplx< T >::im.

◆ ln()

template<typename T >
cplx< T > cplx< T >::ln ( ) const
inline

Definition at line 493 of file cplx.h.

References fabs(), GLBL__, log(), MATH__, and cplx< T >::theta().

◆ minus()

template<typename T>
cplx<T> cplx< T >::minus ( const T  v) const
inline

Definition at line 130 of file cplx.h.

References cplx< T >::im.

◆ mult()

template<typename T>
cplx<T> cplx< T >::mult ( const T  v) const
inline

Definition at line 133 of file cplx.h.

References cplx< T >::im.

◆ norm()

template<typename T>
double cplx< T >::norm ( ) const
inline

Definition at line 166 of file cplx.h.

References cplx< T >::fabssqr().

◆ operator!=()

template<typename T>
bool cplx< T >::operator!= ( const cplx< T > &  c) const
inline

Definition at line 190 of file cplx.h.

References c, and cplx< T >::im.

◆ operator*() [1/2]

template<typename T >
cplx< T > cplx< T >::operator* ( const cplx< T > &  a) const
inline

Definition at line 294 of file cplx.h.

References a, and cplx< T >::im.

◆ operator*() [2/2]

template<typename T >
cplx< T > cplx< T >::operator* ( const T  b) const
inline

Definition at line 361 of file cplx.h.

References b, and cplx< T >::im.

◆ operator*=() [1/2]

template<typename T >
cplx< T > & cplx< T >::operator*= ( const T  a)
inline

Definition at line 245 of file cplx.h.

References a, and cplx< T >::im.

◆ operator*=() [2/2]

template<typename T >
cplx< T > & cplx< T >::operator*= ( const cplx< T > &  a)
inline

Definition at line 252 of file cplx.h.

References a, ALIGN, cplx< T >::im, MIN_ALIGN, REGISTER, and T.

◆ operator+() [1/2]

template<typename T >
cplx< T > cplx< T >::operator+ ( const cplx< T > &  a) const
inline

Definition at line 280 of file cplx.h.

References a, and cplx< T >::im.

◆ operator+() [2/2]

template<typename T >
cplx< T > cplx< T >::operator+ ( const T  b) const
inline

Definition at line 347 of file cplx.h.

References b, and cplx< T >::im.

◆ operator+=() [1/2]

template<typename T >
NAMESPACE_CSTD_END NAMESPACE_TBCI cplx< T > & cplx< T >::operator+= ( const T  a)
inline

Definition at line 218 of file cplx.h.

References a.

◆ operator+=() [2/2]

template<typename T >
cplx< T > & cplx< T >::operator+= ( const cplx< T > &  a)
inline

Definition at line 225 of file cplx.h.

References a, and cplx< T >::im.

◆ operator-() [1/3]

template<typename T >
cplx< T > cplx< T >::operator- ( const cplx< T > &  a) const
inline

Definition at line 287 of file cplx.h.

References a, and cplx< T >::im.

◆ operator-() [2/3]

template<typename T >
cplx< T > cplx< T >::operator- ( const T  b) const
inline

Definition at line 354 of file cplx.h.

References b, and cplx< T >::im.

◆ operator-() [3/3]

template<typename T >
cplx< T > cplx< T >::operator- ( ) const
inline

Definition at line 375 of file cplx.h.

References cplx< T >::im.

◆ operator-=() [1/2]

template<typename T >
cplx< T > & cplx< T >::operator-= ( const T  a)
inline

Definition at line 231 of file cplx.h.

References a.

◆ operator-=() [2/2]

template<typename T >
cplx< T > & cplx< T >::operator-= ( const cplx< T > &  a)
inline

Definition at line 238 of file cplx.h.

References a, and cplx< T >::im.

◆ operator/() [1/2]

template<typename T >
cplx< T > cplx< T >::operator/ ( const cplx< T > &  a) const
inline

Definition at line 307 of file cplx.h.

References a, ALIGN, cplx< T >::im, MIN_ALIGN, REGISTER, and T.

◆ operator/() [2/2]

template<typename T >
cplx< T > cplx< T >::operator/ ( const T  b) const
inline

Definition at line 368 of file cplx.h.

References b, and cplx< T >::im.

◆ operator/=() [1/2]

template<typename T >
cplx< T > & cplx< T >::operator/= ( const T  a)
inline

Definition at line 262 of file cplx.h.

References a, and cplx< T >::im.

◆ operator/=() [2/2]

template<typename T >
cplx< T > & cplx< T >::operator/= ( const cplx< T > &  a)
inline

Definition at line 268 of file cplx.h.

References a, ALIGN, cplx< T >::im, MIN_ALIGN, REGISTER, and T.

◆ operator<()

template<typename T>
bool cplx< T >::operator< ( const cplx< T > &  c) const
inline

Definition at line 194 of file cplx.h.

References c, and cplx< T >::fabssqr().

◆ operator<=()

template<typename T>
bool cplx< T >::operator<= ( const cplx< T > &  c) const
inline

Definition at line 195 of file cplx.h.

References c, and cplx< T >::fabssqr().

◆ operator=() [1/2]

template<typename T>
cplx<T>& cplx< T >::operator= ( const T  r)
inline

Definition at line 89 of file cplx.h.

References cplx< T >::im, and T.

◆ operator=() [2/2]

template<typename T>
cplx<T>& cplx< T >::operator= ( const cplx< T > &  c)
inline

Definition at line 90 of file cplx.h.

References c, and cplx< T >::im.

◆ operator==()

template<typename T>
bool cplx< T >::operator== ( const cplx< T > &  c) const
inline

Definition at line 189 of file cplx.h.

References c, and cplx< T >::im.

◆ operator>()

template<typename T>
bool cplx< T >::operator> ( const cplx< T > &  c) const
inline

Definition at line 192 of file cplx.h.

References c, and cplx< T >::fabssqr().

◆ operator>=()

template<typename T>
bool cplx< T >::operator>= ( const cplx< T > &  c) const
inline

Definition at line 193 of file cplx.h.

References c, and cplx< T >::fabssqr().

◆ operator~()

template<typename T >
cplx< T > cplx< T >::operator~ ( ) const
inline

Definition at line 382 of file cplx.h.

References cplx< T >::im.

◆ plus()

template<typename T>
cplx<T> cplx< T >::plus ( const T  v) const
inline

Definition at line 127 of file cplx.h.

References cplx< T >::im.

◆ power() [1/2]

template<typename T >
cplx< T > cplx< T >::power ( const double  n) const
inline

Definition at line 479 of file cplx.h.

References expi(), fabs(), GLBL__, MATH__, pow(), TBCI__, and cplx< T >::theta().

◆ power() [2/2]

template<typename T >
cplx< T > cplx< T >::power ( const cplx< T > &  z) const

Definition at line 485 of file cplx.h.

References exp(), expi(), fabs(), GLBL__, cplx< T >::im, log(), MATH__, T, and cplx< T >::theta().

◆ real() [1/2]

template<typename T>
T cplx< T >::real ( ) const
inline

Definition at line 106 of file cplx.h.

Referenced by besselh1(), besselh2(), besseli(), besselj(), besselk(), bessely(), and gamma().

◆ real() [2/2]

template<typename T>
T& cplx< T >::real ( )
inline

Definition at line 109 of file cplx.h.

◆ set()

template<typename T>
cplx<T>& cplx< T >::set ( const T  r,
const T  i 
)
inline

Definition at line 104 of file cplx.h.

References i, and cplx< T >::im.

◆ sin()

template<typename T >
cplx< T > cplx< T >::sin ( ) const

Definition at line 499 of file cplx.h.

References cplx< T >::exp(), exp(), and cplx< T >::im.

◆ sinh()

template<typename T >
cplx< T > cplx< T >::sinh ( ) const

Definition at line 513 of file cplx.h.

References exp().

◆ sqrt()

template<typename T >
cplx< T > cplx< T >::sqrt ( ) const

Definition at line 467 of file cplx.h.

References expi(), fabs(), GLBL__, MATH__, sqrt(), TBCI__, and cplx< T >::theta().

◆ theta()

template<typename T >
T cplx< T >::theta ( ) const

Definition at line 427 of file cplx.h.

References atan2(), cplx< T >::im, LIKELY, pi, and UNLIKELY.

Referenced by cplx< T >::ln(), cplx< T >::power(), and cplx< T >::sqrt().

Friends And Related Function Documentation

◆ cplx

template<typename T>
template<typename U >
friend class cplx
friend

Definition at line 78 of file cplx.h.

◆ FGD

template<typename T>
cplx<T> dot FGD ( const cplx< T > &  ,
const cplx< T > &   
)
friend

◆ operator<< FGD

template<typename T>
STD__ ostream& operator<< FGD ( STD__ ostream &  ,
const cplx< T > &   
)
friend

◆ operator>> FGD

template<typename T>
STD__ istream& operator>> FGD ( STD__ istream &  ,
cplx< T > &   
)
friend

Member Data Documentation

◆ im

template<typename T>
T re cplx< T >::im
protected

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