diff options
Diffstat (limited to 'Eigen/src/Core/MathFunctions.h')
-rw-r--r-- | Eigen/src/Core/MathFunctions.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 67b1d8263..f77724052 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -260,16 +260,17 @@ struct conj_default_impl<Scalar,true> } }; -template<typename Scalar> struct conj_impl : conj_default_impl<Scalar> {}; +template<typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex> +struct conj_impl : conj_default_impl<Scalar, IsComplex> {}; #if defined(EIGEN_GPU_COMPILE_PHASE) template<typename T> -struct conj_impl<std::complex<T> > +struct conj_impl<std::complex<T>, true> { EIGEN_DEVICE_FUNC static inline std::complex<T> run(const std::complex<T>& x) { - return std::complex<T>(x.real(), -x.imag()); + return std::complex<T>(numext::real(x), -numext::imag(x)); } }; #endif |