Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67273 - in sandbox/math_constants: boost/math/policies libs/math/config libs/math/test
From: john_at_[hidden]
Date: 2010-12-16 07:10:19


Author: johnmaddock
Date: 2010-12-16 07:10:18 EST (Thu, 16 Dec 2010)
New Revision: 67273
URL: http://svn.boost.org/trac/boost/changeset/67273

Log:
Update policy code to match Trunk.
Update mpfr search logic to match binaries produced by the Win32 builds here: http://www.holoborodko.com/pavel/mpfr/
Added:
   sandbox/math_constants/libs/math/config/
      - copied from r67228, /trunk/libs/math/config/
Text files modified:
   sandbox/math_constants/boost/math/policies/error_handling.hpp | 28 ++++++++++++++++------------
   sandbox/math_constants/libs/math/config/Jamfile.v2 | 16 ++++++++++++++--
   sandbox/math_constants/libs/math/test/Jamfile.v2 | 18 +++++++++++++-----
   3 files changed, 43 insertions(+), 19 deletions(-)

Modified: sandbox/math_constants/boost/math/policies/error_handling.hpp
==============================================================================
--- sandbox/math_constants/boost/math/policies/error_handling.hpp (original)
+++ sandbox/math_constants/boost/math/policies/error_handling.hpp 2010-12-16 07:10:18 EST (Thu, 16 Dec 2010)
@@ -60,8 +60,8 @@
 T user_denorm_error(const char* function, const char* message, const T& val);
 template <class T>
 T user_evaluation_error(const char* function, const char* message, const T& val);
-template <class T>
-T user_rounding_error(const char* function, const char* message, const T& val);
+template <class T, class TargetType>
+T user_rounding_error(const char* function, const char* message, const T& val, const TargetType& t);
 template <class T>
 T user_indeterminate_result_error(const char* function, const char* message, const T& val);
 
@@ -381,11 +381,12 @@
    return user_evaluation_error(function, message, val);
 }
 
-template <class T>
+template <class T, class TargetType>
 inline T raise_rounding_error(
            const char* function,
            const char* message,
            const T& val,
+ const TargetType&,
            const ::boost::math::policies::rounding_error< ::boost::math::policies::throw_on_error>&)
 {
    raise_error<boost::math::rounding_error, T>(function, message, val);
@@ -393,39 +394,42 @@
    return T(0);
 }
 
-template <class T>
+template <class T, class TargetType>
 inline T raise_rounding_error(
            const char* ,
            const char* ,
            const T& val,
+ const TargetType&,
            const ::boost::math::policies::rounding_error< ::boost::math::policies::ignore_error>&)
 {
    // This may or may not do the right thing, but the user asked for the error
    // to be ignored so here we go anyway:
- return val;
+ return std::numeric_limits<T>::is_specialized ? (val > 0 ? std::numeric_limits<T>::max() : -std::numeric_limits<T>::max()): val;
 }
 
-template <class T>
+template <class T, class TargetType>
 inline T raise_rounding_error(
            const char* ,
            const char* ,
            const T& val,
+ const TargetType&,
            const ::boost::math::policies::rounding_error< ::boost::math::policies::errno_on_error>&)
 {
    errno = ERANGE;
    // This may or may not do the right thing, but the user asked for the error
    // to be silent so here we go anyway:
- return val;
+ return std::numeric_limits<T>::is_specialized ? (val > 0 ? std::numeric_limits<T>::max() : -std::numeric_limits<T>::max()): val;
 }
 
-template <class T>
+template <class T, class TargetType>
 inline T raise_rounding_error(
            const char* function,
            const char* message,
            const T& val,
+ const TargetType& t,
            const ::boost::math::policies::rounding_error< ::boost::math::policies::user_error>&)
 {
- return user_rounding_error(function, message, val);
+ return user_rounding_error(function, message, val, t);
 }
 
 template <class T, class R>
@@ -536,13 +540,13 @@
       val, policy_type());
 }
 
-template <class T, class Policy>
-inline T raise_rounding_error(const char* function, const char* message, const T& val, const Policy&)
+template <class T, class TargetType, class Policy>
+inline T raise_rounding_error(const char* function, const char* message, const T& val, const TargetType& t, const Policy&)
 {
    typedef typename Policy::rounding_error_type policy_type;
    return detail::raise_rounding_error(
       function, message ? message : "Value %1% can not be represented in the target integer type.",
- val, policy_type());
+ val, t, policy_type());
 }
 
 template <class T, class R, class Policy>

Modified: sandbox/math_constants/libs/math/config/Jamfile.v2
==============================================================================
--- /trunk/libs/math/config/Jamfile.v2 (original)
+++ sandbox/math_constants/libs/math/config/Jamfile.v2 2010-12-16 07:10:18 EST (Thu, 16 Dec 2010)
@@ -11,10 +11,22 @@
 
 obj has_long_double_support : has_long_double_support.cpp ;
 obj has_mpfr_class : has_mpfr_class.cpp :
- <include>$(gmp_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx ;
+ <include>$(gmp_path)
+ <include>$(gmp_path)/win32/release
+ <include>$(gmp_path)/mpfr
+ <include>$(gmp_path)/mpfr/win32/release
+ <include>$(gmp_path)/../mpfr/win32/release
+ <include>$(gmp_path)/gmpfrxx
+ ;
 obj has_ntl_rr : has_ntl_rr.cpp : <include>$(ntl-path)/include ;
 obj has_gmpxx : has_gmpxx.cpp :
- <include>$(gmp_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx ;
+ <include>$(gmp_path)
+ <include>$(gmp_path)/win32/release
+ <include>$(gmp_path)/mpfr
+ <include>$(gmp_path)/mpfr/win32/release
+ <include>$(gmp_path)/../mpfr/win32/release
+ <include>$(gmp_path)/gmpfrxx
+ ;
 obj has_gcc_visibility : has_gcc_visibility.cpp :
       <toolset>gcc:<cxxflags>-fvisibility=hidden <toolset>gcc:<cxxflags>-Werror ;
 

Modified: sandbox/math_constants/libs/math/test/Jamfile.v2
==============================================================================
--- sandbox/math_constants/libs/math/test/Jamfile.v2 (original)
+++ sandbox/math_constants/libs/math/test/Jamfile.v2 2010-12-16 07:10:18 EST (Thu, 16 Dec 2010)
@@ -34,7 +34,12 @@
       <include>.
       <include>$(boost-path)/libs/math/test
       <include>$(ntl-path)/include
- <include>$(gmp_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx
+ <include>$(gmp_path)
+ <include>$(gmp_path)/win32/release
+ <include>$(gmp_path)/mpfr
+ <include>$(gmp_path)/mpfr/win32/release
+ <include>$(gmp_path)/../mpfr/win32/release
+ <include>$(gmp_path)/gmpfrxx
     ;
 
 if $(ntl-path)
@@ -59,11 +64,14 @@
 
 explicit mpfr_class ;
 
-lib gmp : : <search>$(gmp_path)/lib <search>$(gmp_path)/bin ;
-lib mpfr : : <search>$(gmp_path)/mpfr/lib <search>$(gmp_path)/mpfr/bin ;
+lib gmp : : <search>$(gmp_path)/lib <search>$(gmp_path)/bin
+ <variant>debug:<search>$(gmp_path)/win32/debug <variant>release:<search>$(gmp_path)/win32/release ;
+lib mpfr : : <search>$(gmp_path)/mpfr/lib <search>$(gmp_path)/mpfr/bin
+ <variant>debug:<search>$(gmp_path)/mpfr/win32/debug <variant>release:<search>$(gmp_path)/mpfr/win32/release
+ <variant>debug:<search>$(gmp_path)/../mpfr/win32/debug <variant>release:<search>$(gmp_path)/../mpfr/win32/release ;
 
 
 run test_constants.cpp $(boost-path)/libs/test/build//boost_test_exec_monitor $(boost-path)/libs/thread/build//boost_thread ;
 run test_print_info_on_type.cpp ;
-run test_constant_generate.cpp ntl/<link>static $(boost-path)/libs/regex/build//boost_regex : : : [ check-target-builds $(boost-path)/libs/math/config//has_ntl_rr : : <build>no ] : test_constant_generate_ntl ;
-run test_constant_generate.cpp mpfr_class/<link>static mpfr gmp $(boost-path)/libs/regex/build//boost_regex : : : [ check-target-builds $(boost-path)/libs/math/config//has_mpfr_class : : <build>no ] <define>USE_MPFR : test_constant_generate_mpfr ;
+run test_constant_generate.cpp ntl/<link>static $(boost-path)/libs/regex/build//boost_regex : : : [ check-target-builds ../config//has_ntl_rr : : <build>no ] : test_constant_generate_ntl ;
+run test_constant_generate.cpp mpfr_class/<link>static mpfr gmp $(boost-path)/libs/regex/build//boost_regex : : : [ check-target-builds ../config//has_mpfr_class : : <build>no ] <define>USE_MPFR : test_constant_generate_mpfr ;


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