TBCI Numerical high perf. C++ Library  2.8.0
Classes | Macros | Functions
cplx.h File Reference

Rich implementation of complex numbers TBCI::cplx. More...

#include "tbci/basics.h"
#include "tbci/constants.h"
#include "cplx_memalloc.h"
Include dependency graph for cplx.h:

Go to the source code of this file.

Classes

class  cplx< T >
 Our own complex class. More...
 
class  cplx< T >
 Our own complex class. More...
 

Macros

#define CPLX(t)   cplx<t>
 
#define CPLXR(t, a, r)   cplx<t> a (r)
 
#define CPLXRI(t, a, r, i)   cplx<t> a (r,i)
 
#define CPLXC(t, a, c)   cplx<t> a (c)
 
#define CPLXVRI(t, r, i)   (cplx<t>(r,i))
 

Functions

template<typename T >
NAMESPACE_END NAMESPACE_CSTD TBCI__ cplx< Tsqrt (const TBCI__ cplx< T > &z)
 
template<typename T >
cplx< Tdot (const cplx< T > &a, const cplx< T > &b)
 
template<typename T >
cplx< Toperator+ (const T a, const cplx< T > &b)
 
template<typename T >
cplx< Toperator- (const T a, const cplx< T > &b)
 
template<typename T >
cplx< Toperator* (const T a, const cplx< T > &b)
 
template<typename T >
cplx< Toperator/ (const T a, const cplx< T > &b)
 
template<typename T >
double fabssqr (const cplx< T > &c)
 
template<typename T >
cplx< Tsqr (const cplx< T > &c)
 
template<typename T >
cplx< Texpi (const T phi)
 
template<typename T >
STD__ ostream & operator<< (STD__ ostream &os, const cplx< T > &c)
 
template<typename T >
STD__ istream & operator>> (STD__ istream &in, cplx< T > &c)
 
template<typename T >
NAMESPACE_END NAMESPACE_CPLX TBCI__ cplx< Tconj (const TBCI__ cplx< T > &c)
 
template<typename T >
T real (const TBCI__ cplx< T > &z)
 
template<typename T >
T imag (const TBCI__ cplx< T > &z)
 
template<typename T >
Treal (TBCI__ cplx< T > &z)
 
template<typename T >
Timag (TBCI__ cplx< T > &z)
 
template<typename T >
T arg (const TBCI__ cplx< T > &c)
 
template<typename T >
double norm (const TBCI__ cplx< T > &c)
 
template<typename T >
NAMESPACE_CPLX_END NAMESPACE_TBCI TBCI__ cplx< Tpolar (const T &r, const T &p)
 
template<typename T >
NAMESPACE_END NAMESPACE_CSTD T abs (const TBCI__ cplx< T > &c)
 
template<typename T >
double fabs (const TBCI__ cplx< T > &c)
 
template<typename T >
TBCI__ cplx< Tsqrt (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Texp (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tpow (const TBCI__ cplx< T > &z, const double n)
 
template<typename T >
TBCI__ cplx< Tpow (const TBCI__ cplx< T > &z, const TBCI__ cplx< T > &x)
 
template<typename T >
TBCI__ cplx< Tlog (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tsin (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tsinh (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tcos (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tcosh (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Ttan (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Ttanh (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tasin (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tasinh (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tacos (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tacosh (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tatan (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tatanh (const TBCI__ cplx< T > &z)
 
template<typename T >
TBCI__ cplx< Tlog10 (const TBCI__ cplx< T > &z)
 
NAMESPACE_CSTD_END NAMESPACE_TBCI SPEC_TBCI_TRAITS_LOOP_COPY (TBCI__ cplx< float >)
 
 SPEC_TBCI_TRAITS_LOOP_COPY (TBCI__ cplx< double >)
 
 SPEC_TBCI_TRAITS_ALWAYS_COPY (TBCI__ cplx< float > *)
 
 SPEC_TBCI_TRAITS_ALWAYS_COPY (TBCI__ cplx< double > *)
 

Detailed Description

Rich implementation of complex numbers TBCI::cplx.

Definition in file cplx.h.

Macro Definition Documentation

◆ CPLX

#define CPLX (   t)    cplx<t>

Definition at line 31 of file cplx.h.

◆ CPLXC

#define CPLXC (   t,
  a,
  c 
)    cplx<t> a (c)

Definition at line 34 of file cplx.h.

◆ CPLXR

#define CPLXR (   t,
  a,
 
)    cplx<t> a (r)

Definition at line 32 of file cplx.h.

◆ CPLXRI

#define CPLXRI (   t,
  a,
  r,
  i 
)    cplx<t> a (r,i)

Definition at line 33 of file cplx.h.

◆ CPLXVRI

#define CPLXVRI (   t,
  r,
  i 
)    (cplx<t>(r,i))

Definition at line 35 of file cplx.h.

Function Documentation

◆ abs()

template<typename T >
NAMESPACE_END NAMESPACE_CSTD T abs ( const TBCI__ cplx< T > &  c)
inline

Definition at line 741 of file cplx.h.

References c.

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

◆ acos()

template<typename T >
TBCI__ cplx<T> acos ( const TBCI__ cplx< T > &  z)
inline

Definition at line 816 of file cplx.h.

◆ acosh()

template<typename T >
TBCI__ cplx<T> acosh ( const TBCI__ cplx< T > &  z)
inline

Definition at line 821 of file cplx.h.

◆ arg()

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

◆ asin()

template<typename T >
TBCI__ cplx<T> asin ( const TBCI__ cplx< T > &  z)
inline

Definition at line 806 of file cplx.h.

◆ asinh()

template<typename T >
TBCI__ cplx<T> asinh ( const TBCI__ cplx< T > &  z)
inline

Definition at line 811 of file cplx.h.

◆ atan()

template<typename T >
TBCI__ cplx<T> atan ( const TBCI__ cplx< T > &  z)
inline

Definition at line 826 of file cplx.h.

Referenced by zbknu_(), zlog_(), zsqrt_(), and zunhj_().

◆ atanh()

template<typename T >
TBCI__ cplx<T> atanh ( const TBCI__ cplx< T > &  z)
inline

Definition at line 831 of file cplx.h.

◆ conj()

template<typename T >
NAMESPACE_END NAMESPACE_CPLX TBCI__ cplx<T> conj ( const TBCI__ cplx< T > &  c)
inline

Definition at line 663 of file cplx.h.

References c.

◆ cos()

template<typename T >
TBCI__ cplx<T> cos ( const TBCI__ cplx< T > &  z)
inline

◆ cosh()

template<typename T >
TBCI__ cplx<T> cosh ( const TBCI__ cplx< T > &  z)
inline

Definition at line 791 of file cplx.h.

Referenced by zshch_().

◆ dot()

template<typename T >
cplx<T> dot ( const cplx< T > &  a,
const cplx< T > &  b 
)
inline

Definition at line 300 of file cplx.h.

References a, and b.

◆ exp()

template<typename T >
TBCI__ cplx<T> exp ( const TBCI__ cplx< T > &  z)
inline

◆ expi()

template<typename T >
cplx<T> expi ( const T  phi)

Definition at line 460 of file cplx.h.

References ALIGN, cos(), MATH__, MIN_ALIGN, pi, REGISTER, sin(), and T.

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

◆ fabs()

template<typename T >
double fabs ( const TBCI__ cplx< T > &  c)
inline

Definition at line 746 of file cplx.h.

References c.

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

◆ fabssqr()

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

Definition at line 390 of file cplx.h.

References c.

◆ imag() [1/2]

template<typename T >
T imag ( const TBCI__ cplx< T > &  z)
inline

Definition at line 674 of file cplx.h.

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

◆ imag() [2/2]

template<typename T >
T& imag ( TBCI__ cplx< T > &  z)
inline

Definition at line 684 of file cplx.h.

◆ log()

template<typename T >
TBCI__ cplx<T> log ( const TBCI__ cplx< T > &  z)
inline

◆ log10()

template<typename T >
TBCI__ cplx<T> log10 ( const TBCI__ cplx< T > &  z)
inline

Definition at line 836 of file cplx.h.

References log().

◆ norm()

template<typename T >
double norm ( const TBCI__ cplx< T > &  c)
inline

Definition at line 695 of file cplx.h.

References c.

Referenced by operator/(), and Vector< unsigned >::operator/().

◆ operator*()

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

Definition at line 336 of file cplx.h.

References a, and b.

◆ operator+()

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

Definition at line 317 of file cplx.h.

References a, and b.

◆ operator-()

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

Definition at line 323 of file cplx.h.

References a, and b.

◆ operator/()

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

Definition at line 342 of file cplx.h.

References a, and b.

◆ operator<<()

template<typename T >
STD__ ostream& operator<< ( STD__ ostream &  os,
const cplx< T > &  c 
)

Definition at line 621 of file cplx.h.

References c.

◆ operator>>()

template<typename T >
STD__ istream& operator>> ( STD__ istream &  in,
cplx< T > &  c 
)

Definition at line 627 of file cplx.h.

References ALIGN, c, i, MIN_ALIGN, and T.

◆ polar()

template<typename T >
NAMESPACE_CPLX_END NAMESPACE_TBCI TBCI__ cplx<T> polar ( const T r,
const T p 
)
inline

Definition at line 706 of file cplx.h.

References expi(), p, and TBCI__.

◆ pow() [1/2]

template<typename T >
TBCI__ cplx<T> pow ( const TBCI__ cplx< T > &  z,
const double  n 
)
inline

Definition at line 761 of file cplx.h.

Referenced by chi_s(), expm(), expm2(), expm3(), fact(), poisson(), and cplx< T >::power().

◆ pow() [2/2]

template<typename T >
TBCI__ cplx<T> pow ( const TBCI__ cplx< T > &  z,
const TBCI__ cplx< T > &  x 
)
inline

Definition at line 766 of file cplx.h.

References x.

◆ real() [1/2]

template<typename T >
T real ( const TBCI__ cplx< T > &  z)
inline

Definition at line 671 of file cplx.h.

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

◆ real() [2/2]

template<typename T >
T& real ( TBCI__ cplx< T > &  z)
inline

Definition at line 681 of file cplx.h.

◆ sin()

template<typename T >
TBCI__ cplx<T> sin ( const TBCI__ cplx< T > &  z)
inline

◆ sinh()

template<typename T >
TBCI__ cplx<T> sinh ( const TBCI__ cplx< T > &  z)
inline

Definition at line 781 of file cplx.h.

Referenced by zshch_().

◆ SPEC_TBCI_TRAITS_ALWAYS_COPY() [1/2]

SPEC_TBCI_TRAITS_ALWAYS_COPY ( TBCI__ cplx< float > *  )

◆ SPEC_TBCI_TRAITS_ALWAYS_COPY() [2/2]

SPEC_TBCI_TRAITS_ALWAYS_COPY ( TBCI__ cplx< double > *  )

◆ SPEC_TBCI_TRAITS_LOOP_COPY() [1/2]

NAMESPACE_CSTD_END NAMESPACE_TBCI SPEC_TBCI_TRAITS_LOOP_COPY ( TBCI__ cplx< float >  )

◆ SPEC_TBCI_TRAITS_LOOP_COPY() [2/2]

SPEC_TBCI_TRAITS_LOOP_COPY ( TBCI__ cplx< double >  )

◆ sqr()

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

Definition at line 449 of file cplx.h.

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

Referenced by cplx< T >::acos(), cplx< T >::acosh(), cplx< T >::asin(), cplx< T >::asinh(), BiCG(), BiCGSTAB(), CGS(), and QMR().

◆ sqrt() [1/2]

template<typename T >
NAMESPACE_END NAMESPACE_CSTD TBCI__ cplx<T> sqrt ( const TBCI__ cplx< T > &  z)
inline

◆ sqrt() [2/2]

template<typename T >
TBCI__ cplx<T> sqrt ( const TBCI__ cplx< T > &  z)
inline

◆ tan()

template<typename T >
TBCI__ cplx<T> tan ( const TBCI__ cplx< T > &  z)
inline

Definition at line 796 of file cplx.h.

◆ tanh()

template<typename T >
TBCI__ cplx<T> tanh ( const TBCI__ cplx< T > &  z)
inline

Definition at line 801 of file cplx.h.