24 #if ! defined (octave_oct_cmplx_h)
25 #define octave_oct_cmplx_h 1
27 #include "octave-config.h"
45 #define DEF_COMPLEXR_COMP(OP, OPS) \
46 template <typename T> \
47 inline bool operator OP (const std::complex<T>& a, const std::complex<T>& b) \
49 OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \
50 OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \
53 OCTAVE_FLOAT_TRUNCATE const T ay = std::arg (a); \
54 OCTAVE_FLOAT_TRUNCATE const T by = std::arg (b); \
55 if (ay == static_cast<T> (-M_PI)) \
57 if (by != static_cast<T> (-M_PI)) \
58 return static_cast<T> (M_PI) OP by; \
60 else if (by == static_cast<T> (-M_PI)) \
62 return ay OP static_cast<T> (M_PI); \
69 template <typename T> \
70 inline bool operator OP (const std::complex<T>& a, T b) \
72 OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \
73 OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \
76 OCTAVE_FLOAT_TRUNCATE const T ay = std::arg (a); \
77 if (ay == static_cast<T> (-M_PI)) \
78 return static_cast<T> (M_PI) OP 0; \
84 template <typename T> \
85 inline bool operator OP (T a, const std::complex<T>& b) \
87 OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \
88 OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \
91 OCTAVE_FLOAT_TRUNCATE const T by = std::arg (b); \
92 if (by == static_cast<T> (-M_PI)) \
93 return 0 OP static_cast<T> (M_PI); \
#define DEF_COMPLEXR_COMP(OP, OPS)
std::complex< float > FloatComplex
std::complex< double > Complex