mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-23 01:59:38 +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
|
} // end namespace cephes
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation of lgamma *
|
* Implementation of lgamma, requires C++11/C99 *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
@ -131,7 +131,7 @@ struct lgamma_impl<double> {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation of digamma (psi) *
|
* Implementation of digamma (psi), based on Cephes *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
@ -139,20 +139,6 @@ struct digamma_retval {
|
|||||||
typedef Scalar type;
|
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.
|
* 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>
|
template <typename Scalar>
|
||||||
@ -367,7 +351,7 @@ struct erf_impl<double> {
|
|||||||
#endif // EIGEN_HAS_C99_MATH
|
#endif // EIGEN_HAS_C99_MATH
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Implementation of erfc *
|
* Implementation of erfc, requires C++11/C99 *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
@ -399,31 +383,16 @@ struct erfc_impl<double> {
|
|||||||
};
|
};
|
||||||
#endif // EIGEN_HAS_C99_MATH
|
#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>
|
template <typename Scalar>
|
||||||
struct igammac_retval {
|
struct igammac_retval {
|
||||||
typedef Scalar type;
|
typedef Scalar type;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef EIGEN_HAS_C99_MATH
|
// NOTE: igamma_helper is also used to implement zeta
|
||||||
|
|
||||||
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>
|
template <typename Scalar>
|
||||||
struct igamma_helper {
|
struct igamma_helper {
|
||||||
EIGEN_DEVICE_FUNC
|
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>
|
template <typename Scalar>
|
||||||
struct igammac_impl {
|
struct igammac_impl {
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
@ -614,9 +599,9 @@ struct igammac_impl {
|
|||||||
|
|
||||||
#endif // EIGEN_HAS_C99_MATH
|
#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>
|
template <typename Scalar>
|
||||||
struct igamma_retval {
|
struct igamma_retval {
|
||||||
@ -779,20 +764,6 @@ struct zeta_retval {
|
|||||||
typedef Scalar type;
|
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>
|
template <typename Scalar>
|
||||||
struct zeta_impl_series {
|
struct zeta_impl_series {
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
@ -987,10 +958,8 @@ struct zeta_impl {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // EIGEN_HAS_C99_MATH
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation of polygamma function *
|
* Implementation of polygamma function, requires C++11/C99 *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user