2013-07-17 19:24:07 +02:00
|
|
|
#ifndef TRIQS_UTILITY_COMPLEX_OPS_H
|
|
|
|
#define TRIQS_UTILITY_COMPLEX_OPS_H
|
|
|
|
#include <complex>
|
|
|
|
|
2013-07-19 13:25:31 +02:00
|
|
|
inline std::complex<double> operator"" _j ( long double x ) { return std::complex<double>(0,x); }
|
|
|
|
inline std::complex<double> operator"" _j ( unsigned long long x ) { return std::complex<double>(0,x); }
|
|
|
|
|
2013-07-17 19:24:07 +02:00
|
|
|
namespace std { // has to be in the right namespace for ADL !
|
|
|
|
|
2013-07-19 13:25:31 +02:00
|
|
|
template<typename T> std::complex<T> operator+(std::complex<T> const & a, long b) { return a+T(b);}
|
|
|
|
template<typename T> std::complex<T> operator+(long a, std::complex<T> const & b) { return T(a)+b;}
|
|
|
|
template<typename T> std::complex<T> operator-(std::complex<T> const & a, long b) { return a-T(b);}
|
|
|
|
template<typename T> std::complex<T> operator-(long a, std::complex<T> const & b) { return T(a)-b;}
|
|
|
|
template<typename T> std::complex<T> operator*(std::complex<T> const & a, long b) { return a*T(b);}
|
|
|
|
template<typename T> std::complex<T> operator*(long a, std::complex<T> const & b) { return T(a)*b;}
|
|
|
|
template<typename T> std::complex<T> operator/(std::complex<T> const & a, long b) { return a/T(b);}
|
|
|
|
template<typename T> std::complex<T> operator/(long a, std::complex<T> const & b) { return T(a)/b;}
|
2013-07-17 19:24:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|