Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71389 - trunk/boost/math/special_functions
From: pbristow_at_[hidden]
Date: 2011-04-20 04:49:04


Author: pbristow
Date: 2011-04-20 04:49:02 EDT (Wed, 20 Apr 2011)
New Revision: 71389
URL: http://svn.boost.org/trac/boost/changeset/71389

Log:
Added native_tag specialisation to try to cure failures on gcc.
Text files modified:
   trunk/boost/math/special_functions/sign.hpp | 41 ++++++++++++++++++++++++++-------------
   1 files changed, 27 insertions(+), 14 deletions(-)

Modified: trunk/boost/math/special_functions/sign.hpp
==============================================================================
--- trunk/boost/math/special_functions/sign.hpp (original)
+++ trunk/boost/math/special_functions/sign.hpp 2011-04-20 04:49:02 EDT (Wed, 20 Apr 2011)
@@ -21,6 +21,8 @@
 
 namespace detail {
 
+ // signbit
+
 #ifdef BOOST_MATH_USE_STD_FPCLASSIFY
     template<class T>
     inline int signbit_impl(T x, native_tag const&)
@@ -62,6 +64,29 @@
         return a & traits::sign ? 1 : 0;
     }
 
+ // Changesign
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+ template<class T>
+ inline int changesign_impl(T x, native_tag const&)
+ {
+ return -x;
+ }
+#endif
+
+ template<class T>
+ inline T (changesign_impl)(T x, generic_tag<true> const&)
+ {
+ return -x;
+ }
+
+ template<class T>
+ inline T (changesign_impl)(T x, generic_tag<false> const&)
+ {
+ return -x;
+ }
+
+
     template<class T>
     inline T changesign_impl(T x, ieee_copy_all_bits_tag const&)
     {
@@ -86,18 +111,6 @@
         return x;
     }
 
- template<class T>
- inline T (changesign_impl)(T x, generic_tag<true> const&)
- {
- return -x;
- }
-
- template<class T>
- inline T (changesign_impl)(T x, generic_tag<false> const&)
- {
- return -x;
- }
-
 
 } // namespace detail
 
@@ -123,12 +136,12 @@
 }
 
 template<class T> T (changesign)(T x)
-{
+{ //!< \brief return unchanged binary pattern of x, except for change of sign bit.
    typedef typename detail::fp_traits<T>::type traits;
    typedef typename traits::method method;
    typedef typename boost::is_floating_point<T>::type fp_tag;
 
- return boost::math::detail::changesign_impl(x, method());
+ return detail::changesign_impl(x, method());
 }
 
 } // namespace math


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