Go to the source code of this file.
Macros | |
#define | fromComplex(comp) qcomp(comp.real, comp.imag) |
#define | qcomp |
#define | toComplex(scalar) ((Complex) {.real = creal(scalar), .imag = cimag(scalar)}) |
Detailed Description
Specifies a precision-agnostic type qcomp, which resolves to a complex<T> in C++ and a complex T in C (that provided by complex.h), and which supports operator overloading for easy complex algebra. This allows users to calculate with a natural complex type before passinfg instances to the QuEST API as a Complex through toComplex and fromComplex
Adapted from the header originally written by Randy Meyers and Dr. Thomas Plum, accessed at http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/CUJ/2003/0303/cuj0303meyers/index.htm Original header doc: Compatibility file for C99 and C++ complex. This header can be included by either C99 or ANSI C++ programs to allow complex arithmetic to be written in a common subset. Note that C overloads for both the real and complex math functions are available after this header has been included.
Definition in file QuEST_complex.h.