aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MathFunctions.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-09-22 13:17:25 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-09-22 13:17:25 -0700
commit50e3bbfc90e6f7c90a0b3fd046e09a1bb80b28a5 (patch)
treea09db696d8aaab33a31991970895d4e0fdf77555 /Eigen/src/Core/MathFunctions.h
parent8bde7da0862ca0fcd1b643170b69eba245a1750c (diff)
Calls x.imag() instead of imag(x) when x is a complex number since the former
is a constexpr while the later isn't. This fixes compilation errors triggered by nvcc on Mac.
Diffstat (limited to 'Eigen/src/Core/MathFunctions.h')
-rw-r--r--Eigen/src/Core/MathFunctions.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h
index fa322aca7..4d8f8970e 100644
--- a/Eigen/src/Core/MathFunctions.h
+++ b/Eigen/src/Core/MathFunctions.h
@@ -1049,12 +1049,12 @@ double abs(const double &x) { return ::fabs(x); }
template <> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
float abs(const std::complex<float>& x) {
- return ::hypotf(real(x), imag(x));
+ return ::hypotf(x.real(), x.imag());
}
template <> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
double abs(const std::complex<double>& x) {
- return ::hypot(real(x), imag(x));
+ return ::hypot(x.real(), x.imag());
}
#endif