4 #ifndef CPPQEDCORE_UTILS_COMPLEXEXTENSIONS_H_INCLUDED
5 #define CPPQEDCORE_UTILS_COMPLEXEXTENSIONS_H_INCLUDED
7 #include "core_config.h"
11 #ifndef DO_NOT_USE_BOOST_SERIALIZATION
12 #include <boost/serialization/complex.hpp>
13 #endif // DO_NOT_USE_BOOST_SERIALIZATION
18 typedef std::complex<double>
dcomp;
23 inline bool isNonZero(
const dcomp& c) {
return bool(real(c)) || bool(imag(c));}
25 inline bool hasRealPart(
const dcomp& c) {
return bool(real(c));}
26 inline bool hasImagPart(
const dcomp& c) {
return bool(imag(c));}
28 inline bool absCompare(
const dcomp& c1,
const dcomp& c2) {
return abs(c1)< abs(c2);}
29 inline bool realCompare(
const dcomp& c1,
const dcomp& c2) {
return real(c1)<real(c2);}
31 #endif // CPPQEDCORE_UTILS_COMPLEXEXTENSIONS_H_INCLUDED
const dcomp DCOMP_I(0, 1)
Imaginary unit.
std::complex< double > dcomp
Double-precision complex number.