![]() |
Eigen-unsupported
3.3.3
|
00001 // This file is part of Eigen, a lightweight C++ template library 00002 // for linear algebra. 00003 // 00004 // This Source Code Form is subject to the terms of the Mozilla 00005 // Public License v. 2.0. If a copy of the MPL was not distributed 00006 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 00007 00008 #ifndef EIGEN_SPECIALFUNCTIONS_HALF_H 00009 #define EIGEN_SPECIALFUNCTIONS_HALF_H 00010 00011 namespace Eigen { 00012 namespace numext { 00013 00014 #if EIGEN_HAS_C99_MATH 00015 template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half lgamma(const Eigen::half& a) { 00016 return Eigen::half(Eigen::numext::lgamma(static_cast<float>(a))); 00017 } 00018 template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half digamma(const Eigen::half& a) { 00019 return Eigen::half(Eigen::numext::digamma(static_cast<float>(a))); 00020 } 00021 template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half zeta(const Eigen::half& x, const Eigen::half& q) { 00022 return Eigen::half(Eigen::numext::zeta(static_cast<float>(x), static_cast<float>(q))); 00023 } 00024 template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half polygamma(const Eigen::half& n, const Eigen::half& x) { 00025 return Eigen::half(Eigen::numext::polygamma(static_cast<float>(n), static_cast<float>(x))); 00026 } 00027 template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half erf(const Eigen::half& a) { 00028 return Eigen::half(Eigen::numext::erf(static_cast<float>(a))); 00029 } 00030 template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half erfc(const Eigen::half& a) { 00031 return Eigen::half(Eigen::numext::erfc(static_cast<float>(a))); 00032 } 00033 template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half igamma(const Eigen::half& a, const Eigen::half& x) { 00034 return Eigen::half(Eigen::numext::igamma(static_cast<float>(a), static_cast<float>(x))); 00035 } 00036 template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half igammac(const Eigen::half& a, const Eigen::half& x) { 00037 return Eigen::half(Eigen::numext::igammac(static_cast<float>(a), static_cast<float>(x))); 00038 } 00039 template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half betainc(const Eigen::half& a, const Eigen::half& b, const Eigen::half& x) { 00040 return Eigen::half(Eigen::numext::betainc(static_cast<float>(a), static_cast<float>(b), static_cast<float>(x))); 00041 } 00042 #endif 00043 00044 } // end namespace numext 00045 } // end namespace Eigen 00046 00047 #endif // EIGEN_SPECIALFUNCTIONS_HALF_H