OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
GSLComplex.h File Reference
#include <cmath>
#include <complex>
Include dependency graph for GSLComplex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gsl_complex
 Complex number stored as \((\Re, \Im)\). More...
 

Macros

#define GSL_REAL(z)   ((z).dat[0])
 Access real part of a gsl_complex.
 
#define GSL_IMAG(z)   ((z).dat[1])
 Access imaginary part of a gsl_complex.
 

Functions

gsl_complex gsl_complex_rect (double x, double y)
 Construct \(z = x + i y\).
 
gsl_complex gsl_complex_polar (double r, double theta)
 Construct \(z = r e^{i\theta}\).
 
double gsl_complex_arg (gsl_complex z)
 Argument (phase) \(\arg(z)\).
 
double gsl_complex_abs (gsl_complex z)
 Magnitude \(|z|\).
 
double gsl_complex_abs2 (gsl_complex z)
 Squared magnitude \(|z|^2\).
 
gsl_complex gsl_complex_add (gsl_complex a, gsl_complex b)
 Sum \(a + b\).
 
gsl_complex gsl_complex_sub (gsl_complex a, gsl_complex b)
 Difference \(a - b\).
 
gsl_complex gsl_complex_mul (gsl_complex a, gsl_complex b)
 Product \(a \cdot b\).
 
gsl_complex gsl_complex_div (gsl_complex a, gsl_complex b)
 Quotient \(a / b\).
 
gsl_complex gsl_complex_add_real (gsl_complex a, double x)
 Add real scalar \(a + x\).
 
gsl_complex gsl_complex_sub_real (gsl_complex a, double x)
 Subtract real scalar \(a - x\).
 
gsl_complex gsl_complex_mul_real (gsl_complex a, double x)
 Multiply by real scalar \(a \cdot x\).
 
gsl_complex gsl_complex_div_real (gsl_complex a, double x)
 Divide by real scalar \(a / x\).
 
gsl_complex gsl_complex_conjugate (gsl_complex a)
 Complex conjugate \(\overline{a}\).
 
gsl_complex gsl_complex_inverse (gsl_complex a)
 Multiplicative inverse \(1/a\).
 
gsl_complex gsl_complex_negative (gsl_complex a)
 Negation \(-a\).
 
gsl_complex gsl_complex_sqrt (gsl_complex a)
 Complex square root \(\sqrt{a}\).
 
gsl_complex gsl_complex_exp (gsl_complex a)
 Complex exponential \(e^{a}\).
 
gsl_complex gsl_complex_log (gsl_complex a)
 Complex natural logarithm \(\log(a)\).
 
gsl_complex gsl_complex_sin (gsl_complex a)
 Complex sine \(\sin(a)\).
 
gsl_complex gsl_complex_cos (gsl_complex a)
 Complex cosine \(\cos(a)\).
 
gsl_complex gsl_complex_pow (gsl_complex a, gsl_complex b)
 Complex power \(a^b\).
 
gsl_complex gsl_complex_tanh (gsl_complex a)
 Complex hyperbolic tangent \(\tanh(a)\).
 

Macro Definition Documentation

◆ GSL_IMAG

#define GSL_IMAG (   z)    ((z).dat[1])

Access imaginary part of a gsl_complex.

Definition at line 43 of file GSLComplex.h.

◆ GSL_REAL

#define GSL_REAL (   z)    ((z).dat[0])

Access real part of a gsl_complex.

Definition at line 41 of file GSLComplex.h.

Function Documentation

◆ gsl_complex_abs()

double gsl_complex_abs ( gsl_complex  z)
inline

Magnitude \(|z|\).

Parameters
zInput: complex value.
Returns
Output: \(|z|\).

Definition at line 67 of file GSLComplex.h.

Referenced by gsl_linalg_complex_LU_decomp(), and TEST_F().

◆ gsl_complex_abs2()

double gsl_complex_abs2 ( gsl_complex  z)
inline

Squared magnitude \(|z|^2\).

Parameters
zInput: complex value.
Returns
Output: \(|z|^2\).

Definition at line 72 of file GSLComplex.h.

References gsl_complex::dat.

◆ gsl_complex_add()

gsl_complex gsl_complex_add ( gsl_complex  a,
gsl_complex  b 
)
inline

Sum \(a + b\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: first operand.
bInput: second operand.
Returns
Output: \(a + b\).

Definition at line 79 of file GSLComplex.h.

References gsl_complex::dat.

Referenced by gsl_blas_zgemm(), gsl_blas_zgemv(), gsl_linalg_complex_LU_invert(), gsl_matrix_complex_add(), gsl_vector_complex_add(), interpolation::operator+(), interpolation::operator+=(), and TEST_F().

◆ gsl_complex_add_real()

gsl_complex gsl_complex_add_real ( gsl_complex  a,
double  x 
)
inline

Add real scalar \(a + x\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
xInput: real scalar.
Returns
Output: \(a + x\).

Definition at line 116 of file GSLComplex.h.

References gsl_complex::dat.

Referenced by interpolation::operator+(), interpolation::operator+(), and interpolation::operator+=().

◆ gsl_complex_arg()

double gsl_complex_arg ( gsl_complex  z)
inline

Argument (phase) \(\arg(z)\).

Parameters
zInput: complex value.
Returns
Output: phase angle.

Definition at line 62 of file GSLComplex.h.

Referenced by TEST_F().

◆ gsl_complex_conjugate()

gsl_complex gsl_complex_conjugate ( gsl_complex  a)
inline

Complex conjugate \(\overline{a}\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
Returns
Output: \(\overline{a}\).

Definition at line 151 of file GSLComplex.h.

References gsl_complex::dat.

Referenced by gsl_blas_zgemm(), gsl_blas_zgemv(), and TEST_F().

◆ gsl_complex_cos()

gsl_complex gsl_complex_cos ( gsl_complex  a)
inline

Complex cosine \(\cos(a)\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
Returns
Output: \(\cos(a)\).

Definition at line 208 of file GSLComplex.h.

◆ gsl_complex_div()

gsl_complex gsl_complex_div ( gsl_complex  a,
gsl_complex  b 
)
inline

Quotient \(a / b\).

Parameters
aInput: numerator.
bInput: denominator.
Returns
Output: \(a / b\).

Definition at line 106 of file GSLComplex.h.

Referenced by gsl_linalg_complex_LU_decomp(), gsl_linalg_complex_LU_invert(), interpolation::operator/(), interpolation::operator/(), interpolation::operator/=(), and TEST_F().

◆ gsl_complex_div_real()

gsl_complex gsl_complex_div_real ( gsl_complex  a,
double  x 
)
inline

Divide by real scalar \(a / x\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
xInput: real scalar.
Returns
Output: \(a / x\).

Definition at line 143 of file GSLComplex.h.

References gsl_complex::dat.

Referenced by interpolation::operator/(), and interpolation::operator/=().

◆ gsl_complex_exp()

gsl_complex gsl_complex_exp ( gsl_complex  a)
inline

Complex exponential \(e^{a}\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
Returns
Output: \(e^{a}\).

Definition at line 181 of file GSLComplex.h.

Referenced by TEST_F().

◆ gsl_complex_inverse()

gsl_complex gsl_complex_inverse ( gsl_complex  a)
inline

Multiplicative inverse \(1/a\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
Returns
Output: \(1/a\).

Definition at line 157 of file GSLComplex.h.

◆ gsl_complex_log()

gsl_complex gsl_complex_log ( gsl_complex  a)
inline

Complex natural logarithm \(\log(a)\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
Returns
Output: \(\log(a)\).

Definition at line 190 of file GSLComplex.h.

Referenced by TEST_F().

◆ gsl_complex_mul()

gsl_complex gsl_complex_mul ( gsl_complex  a,
gsl_complex  b 
)
inline

◆ gsl_complex_mul_real()

gsl_complex gsl_complex_mul_real ( gsl_complex  a,
double  x 
)
inline

Multiply by real scalar \(a \cdot x\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
xInput: real scalar.
Returns
Output: \(a x\).

Definition at line 134 of file GSLComplex.h.

References gsl_complex::dat.

Referenced by interpolation::operator*(), interpolation::operator*(), and interpolation::operator*=().

◆ gsl_complex_negative()

gsl_complex gsl_complex_negative ( gsl_complex  a)
inline

Negation \(-a\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
Returns
Output: \(-a\).

Definition at line 166 of file GSLComplex.h.

References gsl_complex::dat.

◆ gsl_complex_polar()

gsl_complex gsl_complex_polar ( double  r,
double  theta 
)
inline

Construct \(z = r e^{i\theta}\).

Parameters
rInput: magnitude.
thetaInput: phase angle.
Returns
Output: complex value \(r e^{i\theta}\).

Definition at line 55 of file GSLComplex.h.

Referenced by TEST_F().

◆ gsl_complex_pow()

gsl_complex gsl_complex_pow ( gsl_complex  a,
gsl_complex  b 
)
inline

Complex power \(a^b\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: base.
bInput: exponent.
Returns
Output: \(a^b\).

Definition at line 218 of file GSLComplex.h.

◆ gsl_complex_rect()

gsl_complex gsl_complex_rect ( double  x,
double  y 
)
inline

Construct \(z = x + i y\).

Parameters
xInput: real part.
yInput: imaginary part.
Returns
Output: complex value \(x + i y\).

Definition at line 49 of file GSLComplex.h.

Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ gsl_complex_sin()

gsl_complex gsl_complex_sin ( gsl_complex  a)
inline

Complex sine \(\sin(a)\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
Returns
Output: \(\sin(a)\).

Definition at line 199 of file GSLComplex.h.

◆ gsl_complex_sqrt()

gsl_complex gsl_complex_sqrt ( gsl_complex  a)
inline

Complex square root \(\sqrt{a}\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
Returns
Output: \(\sqrt{a}\).

Definition at line 172 of file GSLComplex.h.

◆ gsl_complex_sub()

gsl_complex gsl_complex_sub ( gsl_complex  a,
gsl_complex  b 
)
inline

Difference \(a - b\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: first operand.
bInput: second operand.
Returns
Output: \(a - b\).

Definition at line 88 of file GSLComplex.h.

References gsl_complex::dat.

Referenced by gsl_eigen_nonsymmv(), gsl_linalg_complex_LU_decomp(), gsl_linalg_complex_LU_invert(), interpolation::operator-(), interpolation::operator-=(), and TEST_F().

◆ gsl_complex_sub_real()

gsl_complex gsl_complex_sub_real ( gsl_complex  a,
double  x 
)
inline

Subtract real scalar \(a - x\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
xInput: real scalar.
Returns
Output: \(a - x\).

Definition at line 125 of file GSLComplex.h.

References gsl_complex::dat.

Referenced by interpolation::operator-(), interpolation::operator-(), and interpolation::operator-=().

◆ gsl_complex_tanh()

gsl_complex gsl_complex_tanh ( gsl_complex  a)
inline

Complex hyperbolic tangent \(\tanh(a)\).

See also
https://www.gnu.org/software/gsl/doc/html/complex.html
Parameters
aInput: complex operand.
Returns
Output: \(\tanh(a)\).

Definition at line 227 of file GSLComplex.h.

Referenced by TEST_F().