PARP Research Group | Universidad de Murcia |
QVComplex Class Reference
|
Public Member Functions | |
QVComplex () | |
Default constructor. | |
QVComplex (const QVComplex &complex) | |
Copy constructor. | |
QVComplex (const double real, const double imaginary=0.0) | |
Common constructor. | |
QVComplex (const QPointF &point) | |
Constructor from a QPointF. | |
QVComplex & | operator= (const QVComplex &complex) |
Copy operator. | |
bool | operator== (const QVComplex &complex) const |
Complex-complex equality operator. | |
QVComplex & | operator+= (const QVComplex &complex) |
Complex-complex incremental operator. | |
bool | operator!= (const QVComplex &complex) const |
Complex-complex unequality operator. | |
QVComplex | operator* (const QVComplex &complex) const |
Complex-complex product operator. | |
QVComplex | operator/ (const QVComplex &complex) const |
Complex-complex division. | |
QVComplex | operator+ (const QVComplex &complex) const |
Complex-complex addition operator. | |
QVComplex | operator- (const QVComplex &complex) const |
Complex-complex substraction operator. | |
QVComplex | operator- () const |
Obtains the additive inverse of the complex. | |
QVComplex | operator* (const double value) const |
Complex-scalar product. | |
QVComplex | operator/ (const double value) const |
Complex-scalar division operator. | |
QVComplex | operator+ (const double value) const |
Complex-scalar addition. | |
QVComplex | operator- (const double value) const |
Complex-scalar substraction operator. | |
double | norm2 () const |
Gets the norm2 for complex. | |
double | real () const |
Get real component of complex value. | |
double | imaginary () const |
Get imaginary component of complex value. | |
double & | real () |
Get reference to the real component of complex value. | |
double & | imaginary () |
Get reference to the imaginary component of complex value. | |
Static Public Member Functions | |
static QVComplex | i () |
Creates the unit imaginary value. |
Implementation of complex numbers.
Definition at line 37 of file qvcomplex.h.
QVComplex::QVComplex | ( | ) |
Default constructor.
Constructs a complex number object equal to zero.
Definition at line 31 of file qvcomplex.cpp.
Referenced by i(), operator*(), operator+(), operator-(), and operator/().
QVComplex::QVComplex | ( | const QVComplex & | complex | ) |
Copy constructor.
Creates a complex object copying the content from a given one.
complex | complex to be copied. |
Definition at line 32 of file qvcomplex.cpp.
QVComplex::QVComplex | ( | const double | real, | |
const double | imaginary = 0.0 | |||
) |
Common constructor.
Creates a new complex number object, specifying the real and imaginary parts.
real | Real part of the complex number. | |
imaginary | Imaginary part of the complex number. |
Definition at line 33 of file qvcomplex.cpp.
QVComplex::QVComplex | ( | const QPointF & | point | ) |
Constructor from a QPointF.
Creates a new complex number object, obtaining its components from a point object. The real part of the complex number will be obtained from the x component of the point, and the imaginary part from the y component.
point | Point containing the components of the new complex number. |
Definition at line 34 of file qvcomplex.cpp.
Copy operator.
complex | complex to be copied. |
Definition at line 36 of file qvcomplex.cpp.
bool QVComplex::operator== | ( | const QVComplex & | complex | ) | const |
Complex-complex equality operator.
complex | term for the compare operation. |
Definition at line 43 of file qvcomplex.cpp.
Complex-complex incremental operator.
complex | addendum to the actual complex |
Definition at line 44 of file qvcomplex.cpp.
bool QVComplex::operator!= | ( | const QVComplex & | complex | ) | const |
Complex-complex unequality operator.
complex | term for the compare operation. |
Definition at line 45 of file qvcomplex.cpp.
Complex-complex product operator.
complex | factor for the product operation. |
Definition at line 47 of file qvcomplex.cpp.
Complex-complex division.
complex | factor for the operation. |
Definition at line 58 of file qvcomplex.cpp.
Complex-complex addition operator.
complex | term for the operation. |
Definition at line 70 of file qvcomplex.cpp.
Complex-complex substraction operator.
complex | subtrahend for the operation. |
Definition at line 71 of file qvcomplex.cpp.
QVComplex QVComplex::operator- | ( | ) | const |
Obtains the additive inverse of the complex.
Obtains a complex changing the sign of its elements.
Definition at line 72 of file qvcomplex.cpp.
QVComplex QVComplex::operator* | ( | const double | value | ) | const |
Complex-scalar product.
value | factor for the operation. |
Definition at line 73 of file qvcomplex.cpp.
QVComplex QVComplex::operator/ | ( | const double | value | ) | const |
Complex-scalar division operator.
value | divider for the operation. |
Definition at line 74 of file qvcomplex.cpp.
QVComplex QVComplex::operator+ | ( | const double | value | ) | const |
Complex-scalar addition.
value | addendum for the operation. |
Definition at line 75 of file qvcomplex.cpp.
QVComplex QVComplex::operator- | ( | const double | value | ) | const |
Complex-scalar substraction operator.
value | value to substract. |
Definition at line 76 of file qvcomplex.cpp.
double QVComplex::norm2 | ( | ) | const |
Gets the norm2 for complex.
Definition at line 77 of file qvcomplex.cpp.
double QVComplex::real | ( | ) | const [inline] |
Get real component of complex value.
Definition at line 155 of file qvcomplex.h.
Referenced by operator<<().
double QVComplex::imaginary | ( | ) | const [inline] |
Get imaginary component of complex value.
Definition at line 158 of file qvcomplex.h.
Referenced by operator<<().
double& QVComplex::real | ( | ) | [inline] |
Get reference to the real component of complex value.
Definition at line 161 of file qvcomplex.h.
double& QVComplex::imaginary | ( | ) | [inline] |
Get reference to the imaginary component of complex value.
Definition at line 164 of file qvcomplex.h.
QVComplex QVComplex::i | ( | ) | [static] |
Creates the unit imaginary value.
Definition at line 78 of file qvcomplex.cpp.