casa
$Rev:20696$
|
Single and double precision complex numbers. More...
#include <Complex.h>
Public Member Functions | |
Bool | isNaN (const Complex &val) |
Complex NaN and Infinity. | |
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. | |
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. | |
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. | |
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. | |
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) |
Complex | pow (const Complex &val, Double p) |
The log10 should be in stl. | |
Complex | operator* (const Complex &val, Double f) |
QMath and scimath need these operators * and /. | |
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. | |
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. | |
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. | |
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 | |
Complex | fmod (const Complex &in, const Complex &f) |
DComplex | atan (const DComplex &in) |
Inverse trigonometry. | |
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. | |
Complex | erf (const Complex &in) |
DComplex | erfc (const DComplex &in) |
Complex | erfc (const Complex &in) |
Single and double precision complex numbers.
<h3>Synopsis</h3> The class <tt>Complex</tt> is a straight typedef as the standard library <tt>complex<float></tt>. In a similar way <tt>DComplex</tt> is typedef-ed as <tt>complex<double></tt>. \link casa::IComplex IComplex \endlink is defined as a specific class. It is only used by the <tt>FITS</tt> classes. <tt>lDComplex</tt> has not been defined: <tt>long double</tt> is not part of the standard aips++ data suite (yet) A set of global functions are added for historic reasons (they were present in the original aips++/gcc complex implementation). See the standard library documentation for the expected behaviour of the <tt>Complex</tt> and <tt>DComplex</tt> classes. <br><strong>Tip:</strong><em> In the following all references to <tt>Complex</tt> can be replaced with <tt>DComplex</tt>; with simultaneous replacement of <tt>Float</tt> with <tt>Double</tt>; </em><br> Complex numbers may be constructed and used in the following ways: <dl> <dt>Complex x;</dt> <dd> Declares an uninitialized Complex. </dd> <dt>Complex x = 2; Complex y(2.0);</dt> <dd> Set x and y to the Complex value (2.0, 0.0); </dd> <dt>Complex x(2, 3);</dt> <dd> Sets x to the Complex value (2, 3); </dd> <dt>Complex u(x); Complex v = x;</dt> <dd> Set u and v to the same value as x. </dd> <dt>Float real(Complex& x);</dt> <dd> returns the real part of x. </dd> <dt>Float imag(Complex& x);</dt> <dd> returns the imaginary part of x. </dd> <dt>Float abs(Complex& x);</dt> <dd> returns the magnitude of x. </dd> <dt>Float norm(Complex& x);</dt> <dd> returns the square of the magnitude of x. </dd> <dt>Float arg(Complex& x);</dt> <dd> returns the argument (amplitude) of x. </dd> <dt>Complex polar(Float r, Float t = 0.0);</dt> <dd> returns a Complex with abs of r and arg of t. </dd> <dt>Complex conj(Complex& x);</dt> <dd> returns the complex conjugate of x </dd> <dt>Complex cos(Complex& x);</dt> <dd> returns the complex cosine of x. </dd> <dt>Complex sin(Complex& x);</dt> <dd> returns the complex sine of x. </dd> <dt>Complex cosh(Complex& x);</dt> <dd> returns the complex hyperbolic cosine of x. </dd> <dt>Complex sinh(Complex& x);</dt> <dd> returns the complex hyperbolic sine of x. </dd> <dt>Complex exp(Complex& x);</dt> <dd> returns the exponential of x. </dd> <dt>Complex log(Complex& x);</dt> <dd> returns the natural log of x. </dd> <dt>Complex pow(Complex& x, long p);</dt> <dd> returns x raised to the p power. </dd> <dt>Complex pow(Complex& x, Complex& p);</dt> <dd> returns x raised to the p power. </dd> <dt>Complex sqrt(Complex& x);</dt> <dd> returns the square root of x. </dd> <dt> Complex min(Complex x,Complex y); <dd> Returns the minumum of x,y (using operator<=, i.e. the norm). <dt> Complex max(Complex x,Complex y); <dd> Returns the maximum of x,y (using operator>=, i.e. the norm). <dt>Bool near(Complex val1, Complex val2, Double tol = 1.0e-5);</dt> <dd> returns whether val1 is relatively near val2 (see Math.h). (Note the Double tolerance) </dd> <dt>Bool nearAbs(Complex val1, Complex val2, Double tol = 1.0e-5);</dt> <dd> returns whether val1 is absolutely near val2 (see Math.h). (Note the Double tolerance) </dd> <dt>ostream << x;</dt> <dd> prints x in the form (re, im). </dd> <dt>istream >> x;</dt> <dd> reads x in the form (re, im), or just (re) or re in which case the imaginary part is set to zero. </dd> </dl>
DComplex casa::Complex_global_functions_Complex_desc::acos | ( | const DComplex & | in | ) |
Complex casa::Complex_global_functions_Complex_desc::acos | ( | const Complex & | in | ) |
Bool casa::Complex_global_functions_Complex_desc::allNear | ( | const Complex & | val1, |
const Complex & | val2, | ||
Double | tol = 1.0e-5 |
||
) | [inline] |
Definition at line 264 of file Complex.h.
References casa::near().
Bool casa::Complex_global_functions_Complex_desc::allNear | ( | const DComplex & | val1, |
const DComplex & | val2, | ||
Double | tol = 1.0e-13 |
||
) | [inline] |
Definition at line 267 of file Complex.h.
References casa::near().
Bool casa::Complex_global_functions_Complex_desc::allNearAbs | ( | const Complex & | val1, |
const Complex & | val2, | ||
Double | tol = 1.0e-5 |
||
) | [inline] |
Definition at line 270 of file Complex.h.
References casa::nearAbs().
Bool casa::Complex_global_functions_Complex_desc::allNearAbs | ( | const DComplex & | val1, |
const DComplex & | val2, | ||
Double | tol = 1.0e-13 |
||
) | [inline] |
Definition at line 273 of file Complex.h.
References casa::nearAbs().
DComplex casa::Complex_global_functions_Complex_desc::asin | ( | const DComplex & | in | ) |
Complex casa::Complex_global_functions_Complex_desc::asin | ( | const Complex & | in | ) |
DComplex casa::Complex_global_functions_Complex_desc::atan | ( | const DComplex & | in | ) |
Complex casa::Complex_global_functions_Complex_desc::atan | ( | const Complex & | in | ) |
DComplex casa::Complex_global_functions_Complex_desc::atan2 | ( | const DComplex & | in, |
const DComplex & | t2 | ||
) |
Complex casa::Complex_global_functions_Complex_desc::atan2 | ( | const Complex & | in, |
const Complex & | t2 | ||
) |
Complex casa::Complex_global_functions_Complex_desc::ceil | ( | const Complex & | x | ) | [inline] |
Definition at line 296 of file Complex.h.
References casa::ceil().
DComplex casa::Complex_global_functions_Complex_desc::ceil | ( | const DComplex & | x | ) | [inline] |
Definition at line 298 of file Complex.h.
References casa::ceil().
DComplex casa::Complex_global_functions_Complex_desc::cube | ( | const DComplex & | val | ) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::cube | ( | const Complex & | val | ) | [inline] |
DComplex casa::Complex_global_functions_Complex_desc::erf | ( | const DComplex & | in | ) |
Error function.
Preliminary to get Functionals working. erf(z) will return erf(real(z)) only for now.
Complex casa::Complex_global_functions_Complex_desc::erf | ( | const Complex & | in | ) |
DComplex casa::Complex_global_functions_Complex_desc::erfc | ( | const DComplex & | in | ) |
Complex casa::Complex_global_functions_Complex_desc::erfc | ( | const Complex & | in | ) |
Double casa::Complex_global_functions_Complex_desc::fabs | ( | const DComplex & | val | ) | [inline] |
Additional complex mathematical functions.
Definition at line 219 of file Complex.h.
References casa::abs().
Float casa::Complex_global_functions_Complex_desc::fabs | ( | const Complex & | val | ) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::floor | ( | const Complex & | x | ) | [inline] |
Definition at line 291 of file Complex.h.
References casa::floor().
DComplex casa::Complex_global_functions_Complex_desc::floor | ( | const DComplex & | x | ) | [inline] |
Definition at line 293 of file Complex.h.
References casa::floor().
DComplex casa::Complex_global_functions_Complex_desc::fmod | ( | const DComplex & | in, |
const DComplex & | f | ||
) |
Complex casa::Complex_global_functions_Complex_desc::fmod | ( | const Complex & | in, |
const Complex & | f | ||
) |
Bool casa::Complex_global_functions_Complex_desc::isFinite | ( | const Complex & | val | ) |
Bool casa::Complex_global_functions_Complex_desc::isFinite | ( | const DComplex & | val | ) |
Bool casa::Complex_global_functions_Complex_desc::isInf | ( | const Complex & | val | ) |
Bool casa::Complex_global_functions_Complex_desc::isInf | ( | const DComplex & | val | ) |
Bool casa::Complex_global_functions_Complex_desc::isNaN | ( | const Complex & | val | ) |
Bool casa::Complex_global_functions_Complex_desc::isNaN | ( | const DComplex & | val | ) |
Complex casa::Complex_global_functions_Complex_desc::max | ( | const Complex & | x, |
const Complex & | y | ||
) | [inline] |
DComplex casa::Complex_global_functions_Complex_desc::max | ( | const DComplex & | x, |
const DComplex & | y | ||
) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::min | ( | const Complex & | x, |
const Complex & | y | ||
) | [inline] |
DComplex casa::Complex_global_functions_Complex_desc::min | ( | const DComplex & | x, |
const DComplex & | y | ||
) | [inline] |
Bool casa::Complex_global_functions_Complex_desc::near | ( | const Complex & | val1, |
const Complex & | val2, | ||
Double | tol = 1.0e-5 |
||
) |
Bool casa::Complex_global_functions_Complex_desc::near | ( | const DComplex & | val1, |
const DComplex & | val2, | ||
Double | tol = 1.0e-13 |
||
) |
Bool casa::Complex_global_functions_Complex_desc::nearAbs | ( | const Complex & | val1, |
const Complex & | val2, | ||
Double | tol = 1.0e-5 |
||
) |
Bool casa::Complex_global_functions_Complex_desc::nearAbs | ( | const DComplex & | val1, |
const DComplex & | val2, | ||
Double | tol = 1.0e-13 |
||
) |
Complex casa::Complex_global_functions_Complex_desc::operator* | ( | const Complex & | val, |
Double | f | ||
) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::operator* | ( | Double | f, |
const Complex & | val | ||
) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::operator* | ( | const Complex & | val, |
Int | f | ||
) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::operator* | ( | Int | f, |
const Complex & | val | ||
) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::operator/ | ( | const Complex & | val, |
Double | f | ||
) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::operator/ | ( | Double | f, |
const Complex & | val | ||
) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::operator/ | ( | const Complex & | val, |
Int | f | ||
) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::operator/ | ( | Int | f, |
const Complex & | val | ||
) | [inline] |
Bool casa::Complex_global_functions_Complex_desc::operator< | ( | const Complex & | left, |
const Complex & | right | ||
) | [inline] |
Definition at line 182 of file Complex.h.
References casa::False, and casa::norm().
Bool casa::Complex_global_functions_Complex_desc::operator< | ( | const DComplex & | left, |
const DComplex & | right | ||
) | [inline] |
Definition at line 209 of file Complex.h.
References casa::norm().
Bool casa::Complex_global_functions_Complex_desc::operator<= | ( | const Complex & | left, |
const Complex & | right | ||
) | [inline] |
Definition at line 180 of file Complex.h.
References casa::norm(), and casa::True.
Bool casa::Complex_global_functions_Complex_desc::operator<= | ( | const DComplex & | left, |
const DComplex & | right | ||
) | [inline] |
Definition at line 207 of file Complex.h.
References casa::norm().
Bool casa::Complex_global_functions_Complex_desc::operator> | ( | const Complex & | left, |
const Complex & | right | ||
) | [inline] |
Definition at line 178 of file Complex.h.
References casa::False, and casa::norm().
Bool casa::Complex_global_functions_Complex_desc::operator> | ( | const DComplex & | left, |
const DComplex & | right | ||
) | [inline] |
Definition at line 205 of file Complex.h.
References casa::norm().
Bool casa::Complex_global_functions_Complex_desc::operator>= | ( | const Complex & | left, |
const Complex & | right | ||
) | [inline] |
Complex comparisons.
Definition at line 176 of file Complex.h.
References casa::norm(), and casa::True.
Bool casa::Complex_global_functions_Complex_desc::operator>= | ( | const DComplex & | left, |
const DComplex & | right | ||
) | [inline] |
DComplex comparisons.
Definition at line 203 of file Complex.h.
References casa::norm().
Complex casa::Complex_global_functions_Complex_desc::pow | ( | const Complex & | val, |
Double | p | ||
) | [inline] |
The log10 should be in stl.
ArrayMath::pow needs this pow function (on SGI).
Definition at line 236 of file Complex.h.
References casa::pow().
void casa::Complex_global_functions_Complex_desc::setInf | ( | Complex & | val | ) |
void casa::Complex_global_functions_Complex_desc::setInf | ( | DComplex & | val | ) |
void casa::Complex_global_functions_Complex_desc::setNaN | ( | Complex & | val | ) |
void casa::Complex_global_functions_Complex_desc::setNaN | ( | DComplex & | val | ) |
DComplex casa::Complex_global_functions_Complex_desc::square | ( | const DComplex & | val | ) | [inline] |
Complex casa::Complex_global_functions_Complex_desc::square | ( | const Complex & | val | ) | [inline] |