JDFTx  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
complex Struct Reference

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__ complexoperator+= (const complex &c)
 
__hostanddev__ complexoperator+= (double r)
 
__hostanddev__ complex operator+ (const complex &c) const
 
__hostanddev__ complex operator+ (double r) const
 
__hostanddev__ complexoperator-= (const complex &c)
 
__hostanddev__ complexoperator-= (double r)
 
__hostanddev__ complex operator- (const complex &c) const
 
__hostanddev__ complex operator- (double r) const
 
__hostanddev__ complex operator- () const
 
__hostanddev__ complexoperator*= (const complex &c)
 
__hostanddev__ complexoperator*= (double r)
 
__hostanddev__ complex operator* (const complex &c) const
 
__hostanddev__ complex operator* (double r) const
 
__hostanddev__ complexoperator/= (const complex &c)
 
__hostanddev__ complexoperator/= (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
 

Detailed Description

Complex number (need to define our own because we need operators for gpu code as well)


The documentation for this struct was generated from the following file: