Complex number (need to define our own because we need operators for gpu code as well) More...
#include <scalar.h>
Public Member Functions | |
__hostanddev__ double & | real () |
real part | |
__hostanddev__ double & | imag () |
imaginary part | |
__hostanddev__ const double & | real () const |
real part | |
__hostanddev__ const double & | imag () const |
imaginary part | |
__hostanddev__ | complex (double x=0, double y=0) |
construct from real and imaginary parts | |
__hostanddev__ complex & | operator+= (const complex &c) |
__hostanddev__ complex & | operator+= (double r) |
__hostanddev__ complex | operator+ (const complex &c) const |
__hostanddev__ complex | operator+ (double r) const |
__hostanddev__ complex & | operator-= (const complex &c) |
__hostanddev__ complex & | operator-= (double r) |
__hostanddev__ complex | operator- (const complex &c) const |
__hostanddev__ complex | operator- (double r) const |
__hostanddev__ complex | operator- () const |
__hostanddev__ complex & | operator*= (const complex &c) |
__hostanddev__ complex & | operator*= (double r) |
__hostanddev__ complex | operator* (const complex &c) const |
__hostanddev__ complex | operator* (double r) const |
__hostanddev__ complex & | operator/= (const complex &c) |
__hostanddev__ complex & | operator/= (double r) |
__hostanddev__ complex | operator/ (const complex &c) const |
__hostanddev__ complex | operator/ (double r) const |
__hostanddev__ double | norm () const |
absolute value squared | |
__hostanddev__ double | abs () const |
absolute value | |
__hostanddev__ double | arg () const |
argument (phase angle) | |
__hostanddev__ complex | conj () const |
complex conjugate | |
Public Attributes | |
double | x |
double | y |
Complex number (need to define our own because we need operators for gpu code as well)