Make EIGEN_HAS_C99_MATH user configurable

This commit is contained in:
Gael Guennebaud
2016-05-20 14:58:19 +02:00
parent 48bf5ec216
commit 1395056fc0
5 changed files with 17 additions and 13 deletions

View File

@@ -217,7 +217,7 @@ template<typename ArrayType> void array_real(const ArrayType& m)
VERIFY_IS_APPROX(m1.sinh(), sinh(m1));
VERIFY_IS_APPROX(m1.cosh(), cosh(m1));
VERIFY_IS_APPROX(m1.tanh(), tanh(m1));
#ifdef EIGEN_HAS_C99_MATH
#if EIGEN_HAS_C99_MATH
VERIFY_IS_APPROX(m1.lgamma(), lgamma(m1));
VERIFY_IS_APPROX(m1.digamma(), digamma(m1));
VERIFY_IS_APPROX(m1.erf(), erf(m1));
@@ -312,7 +312,7 @@ template<typename ArrayType> void array_real(const ArrayType& m)
#ifdef EIGEN_HAS_C99_MATH
#if EIGEN_HAS_C99_MATH
// check special functions (comparing against numpy implementation)
if (!NumTraits<Scalar>::IsComplex)
{
@@ -582,7 +582,7 @@ template<typename ArrayType> void array_special_functions()
}
#ifdef EIGEN_HAS_C99_MATH
#if EIGEN_HAS_C99_MATH
{
ArrayType n(11), x(11), res(11), ref(11);
n << 1, 1, 1, 1.5, 17, 31, 28, 8, 42, 147, 170;

View File

@@ -367,7 +367,7 @@ template<typename Scalar> void packetmath_real()
VERIFY((numext::isnan)(data2[0]));
}
#ifdef EIGEN_HAS_C99_MATH
#if EIGEN_HAS_C99_MATH
{
data1[0] = std::numeric_limits<Scalar>::quiet_NaN();
packet_helper<internal::packet_traits<Scalar>::HasLGamma,Packet> h;
@@ -398,7 +398,7 @@ template<typename Scalar> void packetmath_real()
data1[internal::random<int>(0, PacketSize)] = 0;
CHECK_CWISE1_IF(PacketTraits::HasSqrt, std::sqrt, internal::psqrt);
CHECK_CWISE1_IF(PacketTraits::HasLog, std::log, internal::plog);
#if defined(EIGEN_HAS_C99_MATH) && (__cplusplus > 199711L)
#if EIGEN_HAS_C99_MATH && (__cplusplus > 199711L)
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasLGamma, std::lgamma, internal::plgamma);
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasErf, std::erf, internal::perf);
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasErfc, std::erfc, internal::perfc);