casacore
|
#include <Complex.h>
Public Member Functions | |
Bool | isNaN (const Complex &val) |
Complex NaN and Infinity. More... | |
void | setNaN (Complex &val) |
Bool | isInf (const Complex &val) |
void | setInf (Complex &val) |
Bool | isFinite (const Complex &val) |
Bool | operator>= (const Complex &left, const Complex &right) |
Complex comparisons. More... | |
Bool | operator> (const Complex &left, const Complex &right) |
Bool | operator<= (const Complex &left, const Complex &right) |
Bool | operator< (const Complex &left, const Complex &right) |
Bool | isNaN (const DComplex &val) |
DComplex NaN and Infinity. More... | |
void | setNaN (DComplex &val) |
Bool | isInf (const DComplex &val) |
void | setInf (DComplex &val) |
Bool | isFinite (const DComplex &val) |
Bool | operator>= (const DComplex &left, const DComplex &right) |
DComplex comparisons. More... | |
Bool | operator> (const DComplex &left, const DComplex &right) |
Bool | operator<= (const DComplex &left, const DComplex &right) |
Bool | operator< (const DComplex &left, const DComplex &right) |
Double | fabs (const DComplex &val) |
Additional complex mathematical functions. More... | |
Float | fabs (const Complex &val) |
DComplex | square (const DComplex &val) |
Complex | square (const Complex &val) |
DComplex | cube (const DComplex &val) |
Complex | cube (const Complex &val) |
DComplex | operator+ (const DComplex &d, const Complex &c) |
ArrayMath::pow needs this pow function. More... | |
DComplex | operator+ (const Complex &c, const DComplex &d) |
DComplex | operator- (const DComplex &d, const Complex &c) |
DComplex | operator- (const Complex &c, const DComplex &d) |
Complex | operator* (const Complex &val, Double f) |
QMath and scimath need these operators * and /. More... | |
Complex | operator* (Double f, const Complex &val) |
Complex | operator/ (const Complex &val, Double f) |
Complex | operator/ (Double f, const Complex &val) |
Complex | operator* (const Complex &val, Int f) |
These operators are useful, otherwise both Float and Double are applicable for Ints. More... | |
Complex | operator* (Int f, const Complex &val) |
Complex | operator/ (const Complex &val, Int f) |
Complex | operator/ (Int f, const Complex &val) |
Bool | near (const Complex &val1, const Complex &val2, Double tol=1.0e-5) |
The near functions. More... | |
Bool | near (const DComplex &val1, const DComplex &val2, Double tol=1.0e-13) |
Bool | nearAbs (const Complex &val1, const Complex &val2, Double tol=1.0e-5) |
Bool | nearAbs (const DComplex &val1, const DComplex &val2, Double tol=1.0e-13) |
Bool | allNear (const Complex &val1, const Complex &val2, Double tol=1.0e-5) |
Bool | allNear (const DComplex &val1, const DComplex &val2, Double tol=1.0e-13) |
Bool | allNearAbs (const Complex &val1, const Complex &val2, Double tol=1.0e-5) |
Bool | allNearAbs (const DComplex &val1, const DComplex &val2, Double tol=1.0e-13) |
Complex | max (const Complex &x, const Complex &y) |
Max and min, floor and ceil functions. More... | |
DComplex | max (const DComplex &x, const DComplex &y) |
Complex | min (const Complex &x, const Complex &y) |
DComplex | min (const DComplex &x, const DComplex &y) |
Complex | floor (const Complex &x) |
DComplex | floor (const DComplex &x) |
Complex | ceil (const Complex &x) |
DComplex | ceil (const DComplex &x) |
DComplex | fmod (const DComplex &in, const DComplex &f) |
fmod More... | |
Complex | fmod (const Complex &in, const Complex &f) |
DComplex | atan (const DComplex &in) |
Inverse trigonometry. More... | |
Complex | atan (const Complex &in) |
DComplex | asin (const DComplex &in) |
Complex | asin (const Complex &in) |
DComplex | acos (const DComplex &in) |
Complex | acos (const Complex &in) |
DComplex | atan2 (const DComplex &in, const DComplex &t2) |
Complex | atan2 (const Complex &in, const Complex &t2) |
DComplex | erf (const DComplex &in) |
Error function. More... | |
Complex | erf (const Complex &in) |
DComplex | erfc (const DComplex &in) |
Complex | erfc (const Complex &in) |
Single and double precision complex numbers
The class Complex
is a straight typedef as the standard library complex<float>
.
In a similar way DComplex
is typedef-ed as complex<double>
.
IComplex is defined as a specific class. It is only used by the FITS
classes.
lDComplex
has not been defined: long double
is not part of the standard Casacore data suite (yet)
A set of global functions are added for historic reasons (they were present in the original Casacore/gcc complex implementation).
See the standard library documentation for the expected behaviour of the Complex
and DComplex
classes.
Tip: In the following all references to Complex
can be replaced with DComplex
; with simultaneous replacement of Float
with Double
;
Complex numbers may be constructed and used in the following ways:
Declares an uninitialized Complex.
Set x and y to the Complex value (2.0, 0.0);
Sets x to the Complex value (2, 3);
Set u and v to the same value as x.
returns the real part of x.
returns the imaginary part of x.
returns the magnitude of x.
returns the square of the magnitude of x.
returns the argument (amplitude) of x.
returns a Complex with abs of r and arg of t.
returns the complex conjugate of x
returns the complex cosine of x.
returns the complex sine of x.
returns the complex hyperbolic cosine of x.
returns the complex hyperbolic sine of x.
returns the exponential of x.
returns the natural log of x.
returns x raised to the p power.
returns x raised to the p power.
returns the square root of x.
Returns the minumum of x,y (using operator<=, i.e. the norm).
Returns the maximum of x,y (using operator>=, i.e. the norm).
returns whether val1 is relatively near val2 (see Math.h). (Note the Double tolerance)
returns whether val1 is absolutely near val2 (see Math.h). (Note the Double tolerance)
prints x in the form (re, im).
Complex casacore::Complex_global_functions_Complex_desc::acos | ( | const Complex & | in | ) |
DComplex casacore::Complex_global_functions_Complex_desc::acos | ( | const DComplex & | in | ) |
Complex casacore::Complex_global_functions_Complex_desc::asin | ( | const Complex & | in | ) |
DComplex casacore::Complex_global_functions_Complex_desc::asin | ( | const DComplex & | in | ) |
Complex casacore::Complex_global_functions_Complex_desc::atan | ( | const Complex & | in | ) |
Complex casacore::Complex_global_functions_Complex_desc::atan2 | ( | const Complex & | in, |
const Complex & | t2 | ||
) |
DComplex casacore::Complex_global_functions_Complex_desc::atan2 | ( | const DComplex & | in, |
const DComplex & | t2 | ||
) |
|
inline |
Definition at line 305 of file Complex.h.
References casacore::ceil().
|
inline |
Definition at line 307 of file Complex.h.
References casacore::ceil().
|
inline |
|
inline |
Complex casacore::Complex_global_functions_Complex_desc::erf | ( | const Complex & | in | ) |
Complex casacore::Complex_global_functions_Complex_desc::erfc | ( | const Complex & | in | ) |
DComplex casacore::Complex_global_functions_Complex_desc::erfc | ( | const DComplex & | in | ) |
|
inline |
Definition at line 220 of file Complex.h.
References casacore::abs().
|
inline |
Definition at line 300 of file Complex.h.
References casacore::floor().
|
inline |
Definition at line 302 of file Complex.h.
References casacore::floor().
Complex casacore::Complex_global_functions_Complex_desc::fmod | ( | const Complex & | in, |
const Complex & | f | ||
) |
Bool casacore::Complex_global_functions_Complex_desc::isFinite | ( | const Complex & | val | ) |
Bool casacore::Complex_global_functions_Complex_desc::isFinite | ( | const DComplex & | val | ) |
Bool casacore::Complex_global_functions_Complex_desc::isInf | ( | const Complex & | val | ) |
Bool casacore::Complex_global_functions_Complex_desc::isInf | ( | const DComplex & | val | ) |
|
inline |
|
inline |
|
inline |
Bool casacore::Complex_global_functions_Complex_desc::near | ( | const DComplex & | val1, |
const DComplex & | val2, | ||
Double | tol = 1.0e-13 |
||
) |
Bool casacore::Complex_global_functions_Complex_desc::nearAbs | ( | const Complex & | val1, |
const Complex & | val2, | ||
Double | tol = 1.0e-5 |
||
) |
Referenced by allNearAbs().
Bool casacore::Complex_global_functions_Complex_desc::nearAbs | ( | const DComplex & | val1, |
const DComplex & | val2, | ||
Double | tol = 1.0e-13 |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 235 of file Complex.h.
References casacore::C::c.
|
inline |
ArrayMath::pow needs this pow function.
inline Complex pow(const Complex& val, Double p) { return std::pow(val,Float(p)); } We have to explicitly implement these for different type operands
Definition at line 231 of file Complex.h.
References casacore::C::c.
|
inline |
Definition at line 243 of file Complex.h.
References casacore::C::c.
|
inline |
Definition at line 239 of file Complex.h.
References casacore::C::c.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 182 of file Complex.h.
References casacore::False, and casacore::norm().
|
inline |
Definition at line 209 of file Complex.h.
References casacore::norm().
|
inline |
Definition at line 180 of file Complex.h.
References casacore::norm(), and casacore::True.
|
inline |
Definition at line 207 of file Complex.h.
References casacore::norm().
|
inline |
Definition at line 178 of file Complex.h.
References casacore::False, and casacore::norm().
|
inline |
Definition at line 205 of file Complex.h.
References casacore::norm().
void casacore::Complex_global_functions_Complex_desc::setInf | ( | Complex & | val | ) |
void casacore::Complex_global_functions_Complex_desc::setInf | ( | DComplex & | val | ) |
void casacore::Complex_global_functions_Complex_desc::setNaN | ( | Complex & | val | ) |
void casacore::Complex_global_functions_Complex_desc::setNaN | ( | DComplex & | val | ) |
|
inline |
|
inline |