8 #ifndef GSLPP_COMPLEX_H
10 #include <gsl/gsl_sf.h>
120 return const_cast<gsl_complex*
>(&
_complex);
133 complex::operator gsl_complex& ()
138 complex::operator
const gsl_complex& ()
const
145 double absim = ::fabs(z.
imag());
146 output <<
"(" << z.
real() << (z.
imag() < 0.?
"-" :
"+");
148 output << fabs(z.
imag()) <<
"*";
163 GSL_SET_COMPLEX(&
_complex, GSL_REAL(*z), GSL_IMAG(*z));
169 GSL_SET_COMPLEX(&
_complex, GSL_REAL(z), GSL_IMAG(z));
187 gsl_complex t = gsl_complex_negative(
_complex);
241 gsl_complex rl = gsl_complex_add_real(
_complex,a);
247 gsl_complex rl = gsl_complex_sub_real(
_complex,a);
253 gsl_complex rl = gsl_complex_mul_real(
_complex,a);
259 gsl_complex rl = gsl_complex_div_real(
_complex,a);
290 gsl_complex t = gsl_complex_conjugate(
_complex);
296 gsl_complex t = gsl_complex_inverse(
_complex);
372 gsl_sf_result re, im;
373 gsl_sf_complex_dilog_xy_e(z.
real(), z.
imag(), &re, &im);
374 return complex(re.val, im.val,
false);
complex cos(const complex &z)
complex arccosh(const complex &z)
complex sec(const complex &z)
complex tanh(const complex &z)
complex sinh(const complex &z)
complex & operator-=(const complex &z1)
Subtraction assignment operator for a complex number.
complex operator*(const double &x1, const complex &z2)
double log_of_abs() const
gsl_complex & as_gsl_type()
complex csch(const complex &z)
complex arcsin(const complex &z)
complex conjugate() const
complex coth(const complex &z)
complex & operator+=(const complex &z1)
Addition assignment operator for a complex number.
complex & operator=(const complex &z)
Assignment operator for a complex variable of complex type.
complex arcsec(const complex &z)
std::ostream & operator<<(std::ostream &output, const complex &z)
complex pow(const complex &z1, const complex &z2)
complex operator-() const
Unary minus operator for a complex number.
const double & real() const
static const complex & i()
complex operator/(const complex &z1) const
Division operator for a complex number.
complex csc(const complex &z)
complex log10(const complex &z)
complex arccos(const complex &z)
complex cosh(const complex &z)
bool is_imag() const
Check if complex number is purely imaginary.
bool is_real() const
Check if complex number is purely real.
complex arccsch(const complex &z)
void assign(const double &real, const double &imag, bool polar)
complex dilog(const complex &z)
complex operator/(const double &x1, const complex &z2)
complex & operator/=(const complex &z1)
Division assignment operator for a complex number.
complex arcsech(const complex &z)
complex()
Default constructor for the complex class.
complex sech(const complex &z)
bool operator==(const complex &z1) const
Equivalence operator between two complex variables.
const double & imag() const
gsl_complex * as_gsl_type_ptr() const
complex arccot(const complex &z)
complex & operator*=(const complex &z1)
Muliplication assignment operator for a complex number.
complex log(const complex &z)
complex arctan(const complex &z)
complex cot(const complex &z)
complex arctanh(const complex &z)
complex arccoth(const complex &z)
bool operator!=(const complex &z1) const
Inequivalence operator between two complex variables.
complex exp(const complex &z)
complex arcsinh(const complex &z)
complex operator+(const double &x1, const complex &z2)
A class for defining operations on and functions of complex numbers.
complex operator-(const double &x1, const complex &z2)
complex sin(const complex &z)
complex operator+(const complex &z1) const
Addition operator for a complex number.
complex arccsc(const complex &z)
Complex number, vector and matrix manipulation using GSL.
virtual ~complex()
Default destructor for the complex class.
complex tan(const complex &z)
complex operator*(const complex &z1) const
Multiplication operator for a complex number.
complex sqrt(const complex &z)