mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 19:59:05 +08:00
Avoid unnecessary C++11 dependency
This commit is contained in:
parent
b3fd93207b
commit
e5f9f4768f
@ -1282,17 +1282,17 @@ double exp(const double &x) { return ::exp(x); }
|
|||||||
|
|
||||||
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
|
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
|
||||||
std::complex<float> exp(const std::complex<float>& x) {
|
std::complex<float> exp(const std::complex<float>& x) {
|
||||||
auto com = ::expf(x.real());
|
float com = ::expf(x.real());
|
||||||
auto res_real = com * ::cosf(x.imag());
|
float res_real = com * ::cosf(x.imag());
|
||||||
auto res_imag = com * ::sinf(x.imag());
|
float res_imag = com * ::sinf(x.imag());
|
||||||
return std::complex<float>(res_real, res_imag);
|
return std::complex<float>(res_real, res_imag);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
|
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
|
||||||
std::complex<double> exp(const std::complex<double>& x) {
|
std::complex<double> exp(const std::complex<double>& x) {
|
||||||
auto com = ::exp(x.real());
|
double com = ::exp(x.real());
|
||||||
auto res_real = com * ::cos(x.imag());
|
double res_real = com * ::cos(x.imag());
|
||||||
auto res_imag = com * ::sin(x.imag());
|
double res_imag = com * ::sin(x.imag());
|
||||||
return std::complex<double>(res_real, res_imag);
|
return std::complex<double>(res_real, res_imag);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user