diff options
Diffstat (limited to '3rdParty/Boost/src/boost/math/tools')
| -rw-r--r-- | 3rdParty/Boost/src/boost/math/tools/config.hpp | 107 | ||||
| -rw-r--r-- | 3rdParty/Boost/src/boost/math/tools/promotion.hpp | 27 | ||||
| -rw-r--r-- | 3rdParty/Boost/src/boost/math/tools/user.hpp | 8 | 
3 files changed, 121 insertions, 21 deletions
| diff --git a/3rdParty/Boost/src/boost/math/tools/config.hpp b/3rdParty/Boost/src/boost/math/tools/config.hpp index b1fcd13..4ec5768 100644 --- a/3rdParty/Boost/src/boost/math/tools/config.hpp +++ b/3rdParty/Boost/src/boost/math/tools/config.hpp @@ -14,4 +14,5 @@  #include <boost/cstdint.hpp> // for boost::uintmax_t  #include <boost/detail/workaround.hpp> +#include <boost/type_traits/is_integral.hpp>  #include <algorithm>  // for min and max  #include <boost/config/no_tr1/cmath.hpp> @@ -21,7 +22,9 @@  #  include <math.h>  #endif +#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#  include <limits> +#endif  #include <boost/math/tools/user.hpp> -#include <boost/math/special_functions/detail/round_fwd.hpp>  #if (defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) \ @@ -100,11 +103,16 @@  #endif +#if defined(_LIBCPP_VERSION) && !defined(_MSC_VER) +#  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)) +  || (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))\ +  || defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)  #  define BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY  #endif -#if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) || BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) +#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)  #  include "boost/type.hpp" @@ -140,10 +148,10 @@ -#endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS +#endif // __SUNPRO_CC  #if (defined(__SUNPRO_CC) || defined(__hppa) || defined(__GNUC__)) && !defined(BOOST_MATH_SMALL_CONSTANT)  // Sun's compiler emits a hard error if a constant underflows,  // as does aCC on PA-RISC, while gcc issues a large number of warnings: -#  define BOOST_MATH_SMALL_CONSTANT(x) 0 +#  define BOOST_MATH_SMALL_CONSTANT(x) 0.0  #else  #  define BOOST_MATH_SMALL_CONSTANT(x) x @@ -204,4 +212,35 @@  #  define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##SUF  #endif +// +// Test whether to support __float128: +// +#if defined(_GLIBCXX_USE_FLOAT128) && defined(BOOST_GCC) && !defined(__STRICT_ANSI__) \ +   && !defined(BOOST_MATH_DISABLE_FLOAT128) || defined(BOOST_MATH_USE_FLOAT128) +// +// Only enable this when the compiler really is GCC as clang and probably  +// intel too don't support __float128 yet :-( +// +#ifndef BOOST_MATH_USE_FLOAT128 +#  define BOOST_MATH_USE_FLOAT128 +#endif + +#  if defined(BOOST_INTEL) && defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION >= 1310) && defined(__GNUC__) +#    if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) +#      define BOOST_MATH_FLOAT128_TYPE __float128 +#    endif +#  elif defined(__GNUC__) +#      define BOOST_MATH_FLOAT128_TYPE __float128 +#  endif + +#  ifndef BOOST_MATH_FLOAT128_TYPE +#      define BOOST_MATH_FLOAT128_TYPE _Quad +#  endif +#endif +// +// Check for WinCE with no iostream support: +// +#if defined(_WIN32_WCE) && !defined(__SGI_STL_PORT) +#  define BOOST_MATH_NO_LEXICAL_CAST +#endif  // @@ -214,5 +253,5 @@  // Helper macro for using statements:  // -#define BOOST_MATH_STD_USING \ +#define BOOST_MATH_STD_USING_CORE \     using std::abs;\     using std::acos;\ @@ -237,13 +276,7 @@     using std::floor;\     using std::log10;\ -   using std::sqrt;\ -   using boost::math::round;\ -   using boost::math::iround;\ -   using boost::math::lround;\ -   using boost::math::trunc;\ -   using boost::math::itrunc;\ -   using boost::math::ltrunc;\ -   using boost::math::modf; +   using std::sqrt; +#define BOOST_MATH_STD_USING BOOST_MATH_STD_USING_CORE  namespace boost{ namespace math{ @@ -270,7 +303,33 @@ void suppress_unused_variable_warning(const T&)  } +namespace detail{ + +template <class T> +struct is_integer_for_rounding +{ +   static const bool value = boost::is_integral<T>::value +#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +      || (std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::is_integer) +#endif +      ; +}; + +} +  }} // namespace boost namespace math -#if ((defined(__linux__) && !defined(__UCLIBC__)) || defined(__QNX__) || defined(__IBMCPP__)) && !defined(BOOST_NO_FENV_H) +#ifdef __GLIBC_PREREQ +#  if __GLIBC_PREREQ(2,14) +#     define BOOST_MATH_HAVE_FIXED_GLIBC +#  endif +#endif + +#if ((defined(__linux__) && !defined(__UCLIBC__) && !defined(BOOST_MATH_HAVE_FIXED_GLIBC)) || defined(__QNX__) || defined(__IBMCPP__)) && !defined(BOOST_NO_FENV_H) +// +// This code was introduced in response to this glibc bug: http://sourceware.org/bugzilla/show_bug.cgi?id=2445 +// Basically powl and expl can return garbage when the result is small and certain exception flags are set +// on entrance to these functions.  This appears to have been fixed in Glibc 2.14 (May 2011). +// Much more information in this message thread: https://groups.google.com/forum/#!topic/boost-list/ZT99wtIFlb4 +//     #include <boost/detail/fenv.hpp> @@ -315,10 +374,18 @@ namespace boost{ namespace math{  #ifdef BOOST_MATH_INSTRUMENT -#define BOOST_MATH_INSTRUMENT_CODE(x) \ -   std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl; -#define BOOST_MATH_INSTRUMENT_VARIABLE(name) BOOST_MATH_INSTRUMENT_CODE(BOOST_STRINGIZE(name) << " = " << name) + +#  include <iostream> +#  include <iomanip> +#  include <typeinfo> + +#  define BOOST_MATH_INSTRUMENT_CODE(x) \ +      std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl; +#  define BOOST_MATH_INSTRUMENT_VARIABLE(name) BOOST_MATH_INSTRUMENT_CODE(BOOST_STRINGIZE(name) << " = " << name) +  #else -#define BOOST_MATH_INSTRUMENT_CODE(x) -#define BOOST_MATH_INSTRUMENT_VARIABLE(name) + +#  define BOOST_MATH_INSTRUMENT_CODE(x) +#  define BOOST_MATH_INSTRUMENT_VARIABLE(name) +  #endif diff --git a/3rdParty/Boost/src/boost/math/tools/promotion.hpp b/3rdParty/Boost/src/boost/math/tools/promotion.hpp index 728aaf1..b3ad204 100644 --- a/3rdParty/Boost/src/boost/math/tools/promotion.hpp +++ b/3rdParty/Boost/src/boost/math/tools/promotion.hpp @@ -139,8 +139,33 @@ namespace boost           // Guard against use of long double if it's not supported:           // -         BOOST_STATIC_ASSERT((0 == ::boost::is_same<type, long double>::value)); +         BOOST_STATIC_ASSERT_MSG((0 == ::boost::is_same<type, long double>::value), "Sorry, but this platform does not have sufficient long double support for the special functions to be reliably implemented.");  #endif        }; +      // +      // This struct is the same as above, but has no static assert on long double usage, +      // it should be used only on functions that can be implemented for long double +      // even when std lib support is missing or broken for that type. +      // +      template <class T1, class T2=float, class T3=float, class T4=float, class T5=float, class T6=float> +      struct promote_args_permissive +      { +         typedef typename promote_args_2< +            typename remove_cv<T1>::type, +            typename promote_args_2< +               typename remove_cv<T2>::type, +               typename promote_args_2< +                  typename remove_cv<T3>::type, +                  typename promote_args_2< +                     typename remove_cv<T4>::type, +                     typename promote_args_2< +                        typename remove_cv<T5>::type, typename remove_cv<T6>::type +                     >::type +                  >::type +               >::type +            >::type +         >::type type; +      }; +      } // namespace tools    } // namespace math diff --git a/3rdParty/Boost/src/boost/math/tools/user.hpp b/3rdParty/Boost/src/boost/math/tools/user.hpp index c1bdaf7..08a7e53 100644 --- a/3rdParty/Boost/src/boost/math/tools/user.hpp +++ b/3rdParty/Boost/src/boost/math/tools/user.hpp @@ -92,4 +92,12 @@  //  // define BOOST_MATH_MAX_ROOT_ITERATION_POLICY 200 +// +// Enable use of __float128 in numeric constants: +// +// #define BOOST_MATH_USE_FLOAT128 +// +// Disable use of __float128 in numeric_constants even if the compiler looks to support it: +// +// #define BOOST_MATH_DISABLE_FLOAT128  #endif // BOOST_MATH_TOOLS_USER_HPP | 
 Swift
 Swift