mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-07 18:27:40 +08:00
zeta and digamma do not require C++11/C99
This commit is contained in:
parent
ce12562710
commit
7a54032408
@ -98,7 +98,7 @@ struct polevl<Scalar, 0> {
|
||||
} // end namespace cephes
|
||||
|
||||
/****************************************************************************
|
||||
* Implementation of lgamma *
|
||||
* Implementation of lgamma, requires C++11/C99 *
|
||||
****************************************************************************/
|
||||
|
||||
template <typename Scalar>
|
||||
@ -131,7 +131,7 @@ struct lgamma_impl<double> {
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Implementation of digamma (psi) *
|
||||
* Implementation of digamma (psi), based on Cephes *
|
||||
****************************************************************************/
|
||||
|
||||
template <typename Scalar>
|
||||
@ -139,20 +139,6 @@ struct digamma_retval {
|
||||
typedef Scalar type;
|
||||
};
|
||||
|
||||
#ifndef EIGEN_HAS_C99_MATH
|
||||
|
||||
template <typename Scalar>
|
||||
struct digamma_impl {
|
||||
EIGEN_DEVICE_FUNC
|
||||
static EIGEN_STRONG_INLINE Scalar run(Scalar x) {
|
||||
EIGEN_STATIC_ASSERT((internal::is_same<Scalar, Scalar>::value == false),
|
||||
THIS_TYPE_IS_NOT_SUPPORTED);
|
||||
return Scalar(0);
|
||||
}
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
*
|
||||
* Polynomial evaluation helper for the Psi (digamma) function.
|
||||
@ -331,10 +317,8 @@ struct digamma_impl {
|
||||
}
|
||||
};
|
||||
|
||||
#endif // EIGEN_HAS_C99_MATH
|
||||
|
||||
/****************************************************************************
|
||||
* Implementation of erf *
|
||||
* Implementation of erf, requires C++11/C99 *
|
||||
****************************************************************************/
|
||||
|
||||
template <typename Scalar>
|
||||
@ -367,7 +351,7 @@ struct erf_impl<double> {
|
||||
#endif // EIGEN_HAS_C99_MATH
|
||||
|
||||
/***************************************************************************
|
||||
* Implementation of erfc *
|
||||
* Implementation of erfc, requires C++11/C99 *
|
||||
****************************************************************************/
|
||||
|
||||
template <typename Scalar>
|
||||
@ -399,31 +383,16 @@ struct erfc_impl<double> {
|
||||
};
|
||||
#endif // EIGEN_HAS_C99_MATH
|
||||
|
||||
/****************************************************************************
|
||||
* Implementation of igammac (complemented incomplete gamma integral) *
|
||||
****************************************************************************/
|
||||
/**************************************************************************************************************
|
||||
* Implementation of igammac (complemented incomplete gamma integral), based on Cephes but requires C++11/C99 *
|
||||
**************************************************************************************************************/
|
||||
|
||||
template <typename Scalar>
|
||||
struct igammac_retval {
|
||||
typedef Scalar type;
|
||||
};
|
||||
|
||||
#ifndef EIGEN_HAS_C99_MATH
|
||||
|
||||
template <typename Scalar>
|
||||
struct igammac_impl {
|
||||
EIGEN_DEVICE_FUNC
|
||||
static Scalar run(Scalar a, Scalar x) {
|
||||
EIGEN_STATIC_ASSERT((internal::is_same<Scalar, Scalar>::value == false),
|
||||
THIS_TYPE_IS_NOT_SUPPORTED);
|
||||
return Scalar(0);
|
||||
}
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template <typename Scalar> struct igamma_impl; // predeclare igamma_impl
|
||||
|
||||
// NOTE: igamma_helper is also used to implement zeta
|
||||
template <typename Scalar>
|
||||
struct igamma_helper {
|
||||
EIGEN_DEVICE_FUNC
|
||||
@ -457,6 +426,22 @@ struct igamma_helper<double> {
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef EIGEN_HAS_C99_MATH
|
||||
|
||||
template <typename Scalar>
|
||||
struct igammac_impl {
|
||||
EIGEN_DEVICE_FUNC
|
||||
static Scalar run(Scalar a, Scalar x) {
|
||||
EIGEN_STATIC_ASSERT((internal::is_same<Scalar, Scalar>::value == false),
|
||||
THIS_TYPE_IS_NOT_SUPPORTED);
|
||||
return Scalar(0);
|
||||
}
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template <typename Scalar> struct igamma_impl; // predeclare igamma_impl
|
||||
|
||||
template <typename Scalar>
|
||||
struct igammac_impl {
|
||||
EIGEN_DEVICE_FUNC
|
||||
@ -614,9 +599,9 @@ struct igammac_impl {
|
||||
|
||||
#endif // EIGEN_HAS_C99_MATH
|
||||
|
||||
/****************************************************************************
|
||||
* Implementation of igamma (incomplete gamma integral) *
|
||||
****************************************************************************/
|
||||
/************************************************************************************************
|
||||
* Implementation of igamma (incomplete gamma integral), based on Cephes but requires C++11/C99 *
|
||||
************************************************************************************************/
|
||||
|
||||
template <typename Scalar>
|
||||
struct igamma_retval {
|
||||
@ -778,20 +763,6 @@ template <typename Scalar>
|
||||
struct zeta_retval {
|
||||
typedef Scalar type;
|
||||
};
|
||||
|
||||
#ifndef EIGEN_HAS_C99_MATH
|
||||
|
||||
template <typename Scalar>
|
||||
struct zeta_impl {
|
||||
EIGEN_DEVICE_FUNC
|
||||
static EIGEN_STRONG_INLINE Scalar run(Scalar x, Scalar q) {
|
||||
EIGEN_STATIC_ASSERT((internal::is_same<Scalar, Scalar>::value == false),
|
||||
THIS_TYPE_IS_NOT_SUPPORTED);
|
||||
return Scalar(0);
|
||||
}
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template <typename Scalar>
|
||||
struct zeta_impl_series {
|
||||
@ -986,11 +957,9 @@ struct zeta_impl {
|
||||
return s;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // EIGEN_HAS_C99_MATH
|
||||
|
||||
/****************************************************************************
|
||||
* Implementation of polygamma function *
|
||||
* Implementation of polygamma function, requires C++11/C99 *
|
||||
****************************************************************************/
|
||||
|
||||
template <typename Scalar>
|
||||
|
Loading…
Reference in New Issue
Block a user