#include <Complex.h>
Inheritance diagram for util::Complex< T >:

Compared to the STL correspondent, this class provides more support for mathematical operations and XML serialization.
Public Methods | |
| Complex (T r=0, T i=0) | |
| Create a new complex number with the given real and imaginary parts. | |
| Complex (const Complex &other) | |
| Create a copy of a complex number. | |
| template<class U> | Complex (const Complex< U > &other) |
| Create a typecast copy of a complex number. | |
| Complex & | conjugate (void) |
| Convert this number to its complex conjugate. | |
| Complex | getConjugate (void) const |
| Get a new complex number that is the conjucate of this number. | |
| T | getModulus (void) const |
| Get the modulus of this complex number (sqrt(real^2 + imag^2)). | |
| T | getPhase (void) const |
| Get the phase of this complex number (tan^-1(imag/real)). | |
| Complex & | operator= (const Complex &other) |
| Copy a complex number. | |
| template<class U> Complex & | operator= (const Complex< U > &other) |
| Compare two complex numbers. | |
| template<class U> | operator Complex () |
| Cast this number to another type. | |
| Complex & | operator= (T value) |
| Insert value T to complex number. | |
| void | operator+= (const Complex &other) |
| Add a complex number to this number. | |
| void | operator-= (const Complex &other) |
| Subtract a complex number from this number. | |
| void | operator+= (T value) |
| Add a real number to this complex number (affects only real part):. | |
| void | operator-= (T value) |
| Subtract a real number from this complex number (affects only real part):. | |
| void | operator *= (T value) |
| Multiply this complex number by a real value. | |
| void | operator/= (T value) |
| Divide this complex number by a real value. | |
| void | operator *= (const Complex &other) |
| Multiply this complex number by a complex value. | |
| void | operator/= (const Complex &other) |
| Divide this complex number by a complex value. | |
Public Attributes | |
| T | real |
| The real part of this complex number. | |
| T | imag |
| The imaginary part of this complex number. | |
|
||||||||||
|
Insert value T to complex number. Means that the value is given for the real part of complex number and the imag is set to zero. |