#include <Complex.hpp>
Public Member Functions | |
Complex (const T &part_re=T(0.0), const T &part_im=T(0.0)) | |
Constructor taking both real and imaginary parts. | |
Complex (const Complex< T > &c) | |
Copy constructor. | |
~Complex (void) | |
Destructor. | |
Complex< T > & | operator= (const Complex< T > &c) |
Changes the current real and imaginary parts values with those of the given other complex. | |
bool | operator== (const Complex< T > &c) const |
Tests if the current complex number is equal to the given another complex number. | |
bool | operator!= (const Complex< T > &c) const |
Tests if the current complex number is different to the given another complex number. | |
Complex< T > | operator+ (const Complex< T > &c) const |
Adds two complexes. | |
Complex< T > | operator- (const Complex< T > &c) const |
Substracts two complexes. | |
Complex< T > | operator* (const Complex< T > &c) const |
Multiplies two complexes. | |
Complex< T > | operator/ (const Complex< T > &c) const |
Divides two complexes. | |
Complex< T > & | operator+= (const Complex< T > &c) |
Adds two complexes, then overwrite the current instance with the result of the operation. | |
Complex< T > & | operator-= (const Complex< T > &c) |
Substracts two complexes, then overwrite the current instance with the result of the operation. | |
Complex< T > & | operator*= (const Complex< T > &c) |
Multiplies two complexes, then overwrite the current instance with the result of the operation. | |
Complex< T > & | operator/= (const Complex< T > &c) |
Divides two complexes, then overwrite the current instance with the result of the operation. | |
T | module () const |
Computes the module of the complex. | |
Complex< T > | conjugate () const |
Computes the conjugate of the complex. | |
Public Attributes | |
T | re |
Real part of the complex number. | |
T | im |
Imaginary part of the complex number. |
Definition at line 55 of file Complex.hpp.
kn::Complex< T >::Complex | ( | const T & | part_re = T(0.0) , |
|
const T & | part_im = T(0.0) | |||
) | [inline] |
Constructor taking both real and imaginary parts.
part_real | Real part of the complex | |
part_imag | Imaginary part of the complex |
Definition at line 222 of file Complex.hpp.
kn::Complex< T >::Complex | ( | const Complex< T > & | c | ) | [inline] |
Copy constructor.
c | The complex to copy from |
Definition at line 225 of file Complex.hpp.
kn::Complex< T >::~Complex | ( | void | ) | [inline] |
Complex< T > kn::Complex< T >::conjugate | ( | ) | const [inline] |
Computes the conjugate of the complex.
Definition at line 324 of file Complex.hpp.
T kn::Complex< T >::module | ( | ) | const [inline] |
Computes the module of the complex.
Definition at line 320 of file Complex.hpp.
bool kn::Complex< T >::operator!= | ( | const Complex< T > & | c | ) | const [inline] |
Tests if the current complex number is different to the given another complex number.
c | The other complex to be compared |
Definition at line 253 of file Complex.hpp.
Complex< T > kn::Complex< T >::operator* | ( | const Complex< T > & | c | ) | const [inline] |
Multiplies two complexes.
c | The complex to be multiplied to the current instance |
Definition at line 274 of file Complex.hpp.
Complex< T > & kn::Complex< T >::operator*= | ( | const Complex< T > & | c | ) | [inline] |
Multiplies two complexes, then overwrite the current instance with the result of the operation.
c | The complex to be multiplied to the current instance |
Definition at line 302 of file Complex.hpp.
Complex< T > kn::Complex< T >::operator+ | ( | const Complex< T > & | c | ) | const [inline] |
Adds two complexes.
c | The complex to be added to the current instance |
Definition at line 264 of file Complex.hpp.
Complex< T > & kn::Complex< T >::operator+= | ( | const Complex< T > & | c | ) | [inline] |
Adds two complexes, then overwrite the current instance with the result of the operation.
c | The complex to be added to the current instance |
Definition at line 290 of file Complex.hpp.
Complex< T > kn::Complex< T >::operator- | ( | const Complex< T > & | c | ) | const [inline] |
Substracts two complexes.
c | The complex to be substracted to the current instance |
Definition at line 269 of file Complex.hpp.
Complex< T > & kn::Complex< T >::operator-= | ( | const Complex< T > & | c | ) | [inline] |
Substracts two complexes, then overwrite the current instance with the result of the operation.
c | The complex to be substracted to the current instance |
Definition at line 296 of file Complex.hpp.
Complex< T > kn::Complex< T >::operator/ | ( | const Complex< T > & | c | ) | const [inline] |
Divides two complexes.
c | The complex to divide the current instance by |
Definition at line 279 of file Complex.hpp.
Complex< T > & kn::Complex< T >::operator/= | ( | const Complex< T > & | c | ) | [inline] |
Divides two complexes, then overwrite the current instance with the result of the operation.
c | The complex to divide the current instance by |
Definition at line 308 of file Complex.hpp.
Complex< T > & kn::Complex< T >::operator= | ( | const Complex< T > & | c | ) | [inline] |
Changes the current real and imaginary parts values with those of the given other complex.
c | The other complex to set the current instance with |
Definition at line 236 of file Complex.hpp.
bool kn::Complex< T >::operator== | ( | const Complex< T > & | c | ) | const [inline] |
Tests if the current complex number is equal to the given another complex number.
c | The other complex to be compared |
Definition at line 248 of file Complex.hpp.
T kn::Complex< T >::im |
T kn::Complex< T >::re |