Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50161 - in trunk/boost/math: special_functions tools
From: john_at_[hidden]
Date: 2008-12-06 11:06:16


Author: johnmaddock
Date: 2008-12-06 11:06:15 EST (Sat, 06 Dec 2008)
New Revision: 50161
URL: http://svn.boost.org/trac/boost/changeset/50161

Log:
Fix Intel/Linux compile failures, and reinstate some old workarounds for broken std::fpclassify implementations.
Text files modified:
   trunk/boost/math/special_functions/fpclassify.hpp | 49 +++++++++++++++++++++++----------------
   trunk/boost/math/tools/config.hpp | 6 ++++
   2 files changed, 35 insertions(+), 20 deletions(-)

Modified: trunk/boost/math/special_functions/fpclassify.hpp
==============================================================================
--- trunk/boost/math/special_functions/fpclassify.hpp (original)
+++ trunk/boost/math/special_functions/fpclassify.hpp 2008-12-06 11:06:15 EST (Sat, 06 Dec 2008)
@@ -224,29 +224,14 @@
    return FP_NAN;
 }
 
-#if defined(BOOST_HAS_FPCLASSIFY)
-template<class T, class U>
-inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, const U&)
+#if defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+template <>
+inline int fpclassify_imp<long double> BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
 {
- return BOOST_FPCLASSIFY_PREFIX fpclassify BOOST_NO_MACRO_EXPAND(x);
+ return boost::math::detail::fpclassify_imp(t, generic_tag<true>());
 }
-#if defined(__CYGWIN__) || defined(__HP_aCC) || defined(BOOST_INTEL) \
- || defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) \
- || (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))
-// The native fpclassify broken for long doubles
-// use portable one instead....
-template<class U>
-inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(long double t, const U&)
-{
-#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
- typedef generic_tag<std::numeric_limits<T>::is_specialized> method;
-#else
- typedef generic_tag<false> method;
-#endif
- return fpclassify_imp BOOST_NO_MACRO_EXPAND(t, method(), t);
-}
-#endif
 #endif
+
 } // namespace detail
 
 template <class T>
@@ -299,6 +284,14 @@
         return a != traits::exponent;
     }
 
+#if defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+template <>
+inline bool isfinite_impl<long double> BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+ return boost::math::detail::isfinite_impl(t, generic_tag<true>());
+}
+#endif
+
 }
 
 template<class T>
@@ -348,6 +341,14 @@
         return (a != 0) && (a < traits::exponent);
     }
 
+#if defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+template <>
+inline bool isnormal_impl<long double> BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+ return boost::math::detail::isnormal_impl(t, generic_tag<true>());
+}
+#endif
+
 }
 
 template<class T>
@@ -414,6 +415,14 @@
         return x == 0;
     }
 
+#if defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+template <>
+inline bool isinf_impl<long double> BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+ return boost::math::detail::isinf_impl(t, generic_tag<true>());
+}
+#endif
+
 } // namespace detail
 
 template<class T>

Modified: trunk/boost/math/tools/config.hpp
==============================================================================
--- trunk/boost/math/tools/config.hpp (original)
+++ trunk/boost/math/tools/config.hpp 2008-12-06 11:06:15 EST (Sat, 06 Dec 2008)
@@ -82,6 +82,12 @@
 # define BOOST_MATH_USE_C99
 #endif
 
+#if defined(__CYGWIN__) || defined(__HP_aCC) || defined(BOOST_INTEL) \
+ || defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) \
+ || (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))
+# define BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY
+#endif
+
 #if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) || BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
 
 # include "boost/type.hpp"


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk