A class for defining operations on and functions of complex numbers. More...
#include <gslpp_complex.h>
A class for defining operations on and functions of complex numbers.
This class defines some common operations on complex variables using the GSL.
Definition at line 35 of file gslpp_complex.h.
Public Member Functions | |
| double | abs () const |
| double | abs2 () const |
| double | arg () const |
| gsl_complex & | as_gsl_type () |
| const gsl_complex & | as_gsl_type () const |
| gsl_complex * | as_gsl_type_ptr () const |
| void | assign (const double &real, const double &imag, bool polar) |
| complex () | |
| Default constructor for the complex class. More... | |
| complex (const complex &z) | |
| Copy constructor for the complex class. More... | |
| complex (const double &a) | |
| Conversion constructor for the complex class. Converts a real double to a complex type. More... | |
| complex (const double &real, const double &imag, bool polar=false) | |
| Overleaded constructor for the complex class. More... | |
| complex (const gsl_complex &z) | |
| Conversion constructor for the complex class. Converts a gsl_complex type reference to a complex type. More... | |
| complex (const gsl_complex *z) | |
| Conversion constructor for the complex class. Converts a gsl_complex type pointer to a complex type. More... | |
| complex | conjugate () const |
| double & | imag () |
| const double & | imag () const |
| complex | inverse () const |
| bool | is_imag () const |
| Check if complex number is purely imaginary. More... | |
| bool | is_real () const |
| Check if complex number is purely real. More... | |
| double | log_of_abs () const |
| operator const gsl_complex & () const | |
| operator gsl_complex & () | |
| bool | operator!= (const complex &z1) const |
| Inequivalence operator between two complex variables. More... | |
| complex | operator* (const complex &z1) const |
| Multiplication operator for a complex number. More... | |
| complex | operator* (const double &a) const |
| Multiplication operator for multiplying a real number to a complex number. More... | |
| complex & | operator*= (const complex &z1) |
| Muliplication assignment operator for a complex number. More... | |
| complex & | operator*= (const double &a) |
| Multiplication assignment operator for mulitplying a real number to a complex number. More... | |
| complex | operator+ (const complex &z1) const |
| Addition operator for a complex number. More... | |
| complex | operator+ (const double &a) const |
| Addition operator for adding a real number to a complex number. More... | |
| complex & | operator+= (const complex &z1) |
| Addition assignment operator for a complex number. More... | |
| complex & | operator+= (const double &a) |
| Addition assignment operator for adding a real number to a complex number. More... | |
| complex | operator- () const |
| Unary minus operator for a complex number. More... | |
| complex | operator- (const complex &z1) const |
| Subtraction operator for a complex number. More... | |
| complex | operator- (const double &a) const |
| Subtraction operator for subtracting a real number from a complex number. More... | |
| complex & | operator-= (const complex &z1) |
| Subtraction assignment operator for a complex number. More... | |
| complex & | operator-= (const double &a) |
| Subtraction assignment operator for subtracting a real number from a complex number. More... | |
| complex | operator/ (const complex &z1) const |
| Division operator for a complex number. More... | |
| complex | operator/ (const double &a) const |
| Divsion operator for dividing a complex number by a real number. More... | |
| complex & | operator/= (const complex &z1) |
| Division assignment operator for a complex number. More... | |
| complex & | operator/= (const double &a) |
| Division assignment operator for dividing a complex number by a real number. More... | |
| complex & | operator= (const complex &z) |
| Assignment operator for a complex variable of complex type. More... | |
| complex & | operator= (const double &x) |
| Assignment operator for a double variable to complex type. More... | |
| bool | operator== (const complex &z1) const |
| Equivalence operator between two complex variables. More... | |
| double & | real () |
| const double & | real () const |
| virtual | ~complex () |
| Default destructor for the complex class. More... | |
Static Public Member Functions | |
| static const complex & | i () |
Private Attributes | |
| gsl_complex | _complex |
| gslpp::complex::complex | ( | ) |
Default constructor for the complex class.
Definition at line 18 of file gslpp_complex.cpp.
| gslpp::complex::complex | ( | const double & | real, |
| const double & | imag, | ||
| bool | polar = false |
||
| ) |
Overleaded constructor for the complex class.
| [in] | real | real part of the comlex number |
| [in] | imag | imaginary part of the complex number |
| [in] | polar | boolean switch for specifying polar form of of the complex number (default: false) |
Definition at line 23 of file gslpp_complex.cpp.
| gslpp::complex::complex | ( | const complex & | z | ) |
Copy constructor for the complex class.
Definition at line 28 of file gslpp_complex.cpp.
| gslpp::complex::complex | ( | const double & | a | ) |
Conversion constructor for the complex class. Converts a real double to a complex type.
Definition at line 32 of file gslpp_complex.cpp.
| gslpp::complex::complex | ( | const gsl_complex * | z | ) |
Conversion constructor for the complex class. Converts a gsl_complex type pointer to a complex type.
Definition at line 160 of file gslpp_complex.cpp.
| gslpp::complex::complex | ( | const gsl_complex & | z | ) |
Conversion constructor for the complex class. Converts a gsl_complex type reference to a complex type.
Definition at line 166 of file gslpp_complex.cpp.
|
virtual |
Default destructor for the complex class.
Definition at line 37 of file gslpp_complex.cpp.
| double gslpp::complex::abs | ( | ) | const |
Definition at line 81 of file gslpp_complex.cpp.
| double gslpp::complex::abs2 | ( | ) | const |
Definition at line 86 of file gslpp_complex.cpp.
| double gslpp::complex::arg | ( | ) | const |
Definition at line 76 of file gslpp_complex.cpp.
| gsl_complex & gslpp::complex::as_gsl_type | ( | ) |
Definition at line 123 of file gslpp_complex.cpp.
| const gsl_complex & gslpp::complex::as_gsl_type | ( | ) | const |
Definition at line 128 of file gslpp_complex.cpp.
| gsl_complex * gslpp::complex::as_gsl_type_ptr | ( | ) | const |
Conversion
Definition at line 118 of file gslpp_complex.cpp.
| void gslpp::complex::assign | ( | const double & | real = 0., |
| const double & | imag = 0., |
||
| bool | polar = false |
||
| ) |
| complex gslpp::complex::conjugate | ( | ) | const |
Definition at line 288 of file gslpp_complex.cpp.
|
static |
Definition at line 154 of file gslpp_complex.cpp.
| double & gslpp::complex::imag | ( | ) |
Get the imaginary part
Definition at line 71 of file gslpp_complex.cpp.
| const double & gslpp::complex::imag | ( | ) | const |
Set imaginary part
Definition at line 59 of file gslpp_complex.cpp.
| complex gslpp::complex::inverse | ( | ) | const |
Definition at line 294 of file gslpp_complex.cpp.
| bool gslpp::complex::is_imag | ( | ) | const |
Check if complex number is purely imaginary.
Definition at line 47 of file gslpp_complex.cpp.
| bool gslpp::complex::is_real | ( | ) | const |
Check if complex number is purely real.
Definition at line 41 of file gslpp_complex.cpp.
| double gslpp::complex::log_of_abs | ( | ) | const |
Definition at line 91 of file gslpp_complex.cpp.
| gslpp::complex::operator const gsl_complex & | ( | ) | const |
Definition at line 138 of file gslpp_complex.cpp.
| gslpp::complex::operator gsl_complex & | ( | ) |
Definition at line 133 of file gslpp_complex.cpp.
| bool gslpp::complex::operator!= | ( | const complex & | z1 | ) | const |
Inequivalence operator between two complex variables.
Definition at line 113 of file gslpp_complex.cpp.
Multiplication operator for a complex number.
Definition at line 203 of file gslpp_complex.cpp.
| complex gslpp::complex::operator* | ( | const double & | a | ) | const |
Multiplication operator for multiplying a real number to a complex number.
Definition at line 251 of file gslpp_complex.cpp.
Muliplication assignment operator for a complex number.
Definition at line 227 of file gslpp_complex.cpp.
| complex & gslpp::complex::operator*= | ( | const double & | a | ) |
Multiplication assignment operator for mulitplying a real number to a complex number.
Definition at line 276 of file gslpp_complex.cpp.
Addition operator for a complex number.
Definition at line 191 of file gslpp_complex.cpp.
| complex gslpp::complex::operator+ | ( | const double & | a | ) | const |
Addition operator for adding a real number to a complex number.
Definition at line 239 of file gslpp_complex.cpp.
Addition assignment operator for a complex number.
Definition at line 215 of file gslpp_complex.cpp.
| complex & gslpp::complex::operator+= | ( | const double & | a | ) |
Addition assignment operator for adding a real number to a complex number.
Definition at line 263 of file gslpp_complex.cpp.
| complex gslpp::complex::operator- | ( | ) | const |
Unary minus operator for a complex number.
Definition at line 185 of file gslpp_complex.cpp.
Subtraction operator for a complex number.
Definition at line 197 of file gslpp_complex.cpp.
| complex gslpp::complex::operator- | ( | const double & | a | ) | const |
Subtraction operator for subtracting a real number from a complex number.
Definition at line 245 of file gslpp_complex.cpp.
Subtraction assignment operator for a complex number.
Definition at line 221 of file gslpp_complex.cpp.
| complex & gslpp::complex::operator-= | ( | const double & | a | ) |
Subtraction assignment operator for subtracting a real number from a complex number.
Definition at line 269 of file gslpp_complex.cpp.
Division operator for a complex number.
Definition at line 209 of file gslpp_complex.cpp.
| complex gslpp::complex::operator/ | ( | const double & | a | ) | const |
Divsion operator for dividing a complex number by a real number.
Definition at line 257 of file gslpp_complex.cpp.
Division assignment operator for a complex number.
Definition at line 233 of file gslpp_complex.cpp.
| complex & gslpp::complex::operator/= | ( | const double & | a | ) |
Division assignment operator for dividing a complex number by a real number.
Definition at line 282 of file gslpp_complex.cpp.
Assignment operator for a complex variable of complex type.
Definition at line 96 of file gslpp_complex.cpp.
| complex & gslpp::complex::operator= | ( | const double & | x | ) |
Assignment operator for a double variable to complex type.
Definition at line 102 of file gslpp_complex.cpp.
| bool gslpp::complex::operator== | ( | const complex & | z1 | ) | const |
Equivalence operator between two complex variables.
Definition at line 108 of file gslpp_complex.cpp.
| double & gslpp::complex::real | ( | ) |
Get the real part
Definition at line 65 of file gslpp_complex.cpp.
| const double & gslpp::complex::real | ( | ) | const |
Set the real part
Definition at line 53 of file gslpp_complex.cpp.
Inverse cosine
| [in] | z | Complex number |
Definition at line 483 of file gslpp_complex.cpp.
Inverse hyperbolic cosine
| [in] | z | Complex number |
Definition at line 596 of file gslpp_complex.cpp.
Inverse cotangent
| [in] | z | Complex number |
Definition at line 519 of file gslpp_complex.cpp.
Inverse hyperbolic cotangent
| [in] | z | Complex number |
Definition at line 632 of file gslpp_complex.cpp.
Inverse cosecant
| [in] | z | Complex number |
Definition at line 510 of file gslpp_complex.cpp.
Inverse hyperbolic cosecant
| [in] | z | Complex number |
Definition at line 623 of file gslpp_complex.cpp.
Inverse secant
| [in] | z | Complex number |
Definition at line 501 of file gslpp_complex.cpp.
Inverse hyperbolic secant
| [in] | z | Complex number |
Definition at line 614 of file gslpp_complex.cpp.
Inverse sine
| [in] | z | Complex number |
Definition at line 474 of file gslpp_complex.cpp.
Inverse hyperbolic sine
| [in] | z | Complex number |
Definition at line 587 of file gslpp_complex.cpp.
Inverse tangent
| [in] | z | Complex number |
Definition at line 492 of file gslpp_complex.cpp.
Inverse hyperbolic tangent
| [in] | z | Complex number |
Definition at line 605 of file gslpp_complex.cpp.
Cosine
| [in] | z | Complex number |
Definition at line 429 of file gslpp_complex.cpp.
Hyperbolic cosine
| [in] | z | Complex number |
Definition at line 542 of file gslpp_complex.cpp.
Cotangent
| [in] | z | Complex number |
Definition at line 465 of file gslpp_complex.cpp.
Hyperbolic cotangent
| [in] | z | Complex number |
Definition at line 578 of file gslpp_complex.cpp.
Cosecant
| [in] | z | Complex number |
Definition at line 456 of file gslpp_complex.cpp.
Hyperbolic cosecant
| [in] | z | Complex number |
Definition at line 569 of file gslpp_complex.cpp.
DiLogarithm of a complex number
| [in] | z | Complex number |
Definition at line 370 of file gslpp_complex.cpp.
exponentioal of a complex number
| [in] | z | Complex number |
Definition at line 333 of file gslpp_complex.cpp.
Logarithm of a complex number (base e)
| [in] | z | Complex number |
Definition at line 342 of file gslpp_complex.cpp.
Logarithm of a complex number (base b)
| [in] | z | Complex number |
| [in] | b | Complex number |
Definition at line 361 of file gslpp_complex.cpp.
Logarithm of a complex number (base 10)
| [in] | z | Complex number |
Definition at line 351 of file gslpp_complex.cpp.
Multiply a real and complex numbers
| [in] | x1 | Real number |
| [in] | z2 | Complex number |
Definition at line 314 of file gslpp_complex.cpp.
Add a real and complex numbers
| [in] | x1 | Real number |
| [in] | z2 | Complex number |
Definition at line 302 of file gslpp_complex.cpp.
Subtract a real and complex numbers
| [in] | x1 | Real number |
| [in] | z2 | Complex number |
Definition at line 308 of file gslpp_complex.cpp.
Divide a real and complex numbers
| [in] | x1 | Real number |
| [in] | z2 | Complex number |
Definition at line 320 of file gslpp_complex.cpp.
|
friend |
Friend functions
| [in] | output | output stream |
| [in] | z | Complex number |
Definition at line 143 of file gslpp_complex.cpp.
Complex number to the x real order
| [in] | z | Complex number |
| [in] | x | Real number |
Definition at line 407 of file gslpp_complex.cpp.
Complex number to the z2 complex order
| [in] | z1 | Complex number |
| [in] | z2 | Complex number |
Definition at line 395 of file gslpp_complex.cpp.
Secant
| [in] | z | Complex number |
Definition at line 447 of file gslpp_complex.cpp.
Hyperbolic secant
| [in] | z | Complex number |
Definition at line 560 of file gslpp_complex.cpp.
Sine
| [in] | z | Complex number |
Definition at line 420 of file gslpp_complex.cpp.
Hyperbolic sine
| [in] | z | Complex number |
Definition at line 533 of file gslpp_complex.cpp.
Square root of a complex number
| [in] | z | Complex number |
Definition at line 385 of file gslpp_complex.cpp.
Tangent
| [in] | z | Complex number |
Definition at line 438 of file gslpp_complex.cpp.
Hyperbolic tangent
| [in] | z | Complex number |
Definition at line 551 of file gslpp_complex.cpp.
|
private |
Definition at line 37 of file gslpp_complex.h.