| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #pragma once |
|
|
| #include <thrust/detail/config.h> |
|
|
| #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) |
| # pragma GCC system_header |
| #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) |
| # pragma clang system_header |
| #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) |
| # pragma system_header |
| #endif |
|
|
| #include <thrust/complex.h> |
| #include <thrust/detail/type_traits.h> |
|
|
| THRUST_NAMESPACE_BEGIN |
|
|
| template <typename T0, typename T1> |
| __host__ __device__ |
| complex<typename detail::promoted_numerical_type<T0, T1>::type> |
| pow(const complex<T0>& x, const complex<T1>& y) |
| { |
| typedef typename detail::promoted_numerical_type<T0, T1>::type T; |
| return exp(log(complex<T>(x)) * complex<T>(y)); |
| } |
|
|
| template <typename T0, typename T1> |
| __host__ __device__ |
| complex<typename detail::promoted_numerical_type<T0, T1>::type> |
| pow(const complex<T0>& x, const T1& y) |
| { |
| typedef typename detail::promoted_numerical_type<T0, T1>::type T; |
| return exp(log(complex<T>(x)) * T(y)); |
| } |
|
|
| template <typename T0, typename T1> |
| __host__ __device__ |
| complex<typename detail::promoted_numerical_type<T0, T1>::type> |
| pow(const T0& x, const complex<T1>& y) |
| { |
| typedef typename detail::promoted_numerical_type<T0, T1>::type T; |
| |
| using std::log; |
| return exp(log(T(x)) * complex<T>(y)); |
| } |
|
|
| THRUST_NAMESPACE_END |
|
|
|
|