Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66958 - in sandbox/math_constants: boost/math/constants libs/math/test
From: john_at_[hidden]
Date: 2010-12-01 13:48:55


Author: johnmaddock
Date: 2010-12-01 13:48:54 EST (Wed, 01 Dec 2010)
New Revision: 66958
URL: http://svn.boost.org/trac/boost/changeset/66958

Log:
Get the remaining tests into the Jamfile, and fix gcc build errors.
Text files modified:
   sandbox/math_constants/boost/math/constants/constants.hpp | 4 ++--
   sandbox/math_constants/boost/math/constants/info.hpp | 8 +++++++-
   sandbox/math_constants/libs/math/test/Jamfile.v2 | 31 ++++++++++++++++++++++++++++++-
   sandbox/math_constants/libs/math/test/test_constants.cpp | 4 ++--
   4 files changed, 41 insertions(+), 6 deletions(-)

Modified: sandbox/math_constants/boost/math/constants/constants.hpp
==============================================================================
--- sandbox/math_constants/boost/math/constants/constants.hpp (original)
+++ sandbox/math_constants/boost/math/constants/constants.hpp 2010-12-01 13:48:54 EST (Wed, 01 Dec 2010)
@@ -49,7 +49,7 @@
       construct_from_float = 1,
       construct_from_double = 2,
       construct_from_long_double = 3,
- construct_from_string = 4,
+ construct_from_string = 4
    };
 
    //
@@ -118,7 +118,7 @@
    { return BOOST_JOIN(BOOST_JOIN(x, BOOST_JOIN(e, exp)), L); }\
    /* This one is for very high precision that is none the less known at compile time: */ \
    template <class T, int N> inline T BOOST_JOIN(compute_get_, name)(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>) BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))\
- { static const T result = BOOST_JOIN(calculate_, name)<T>(n); return result; }\
+ { static const T result = BOOST_JOIN(calculate_, name)<T>(mpl::int_<N>()); return result; }\
    template <class T, int N> inline T BOOST_JOIN(get_, name)(const mpl::int_<N>& n BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))\
    {\
       BOOST_MATH_CONSTANT_THREAD_HELPER(name, compute_)\

Modified: sandbox/math_constants/boost/math/constants/info.hpp
==============================================================================
--- sandbox/math_constants/boost/math/constants/info.hpp (original)
+++ sandbox/math_constants/boost/math/constants/info.hpp 2010-12-01 13:48:54 EST (Wed, 01 Dec 2010)
@@ -42,7 +42,10 @@
 void print_info_on_type(std::ostream& os = std::cout BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T) BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(Policy))
 {
    using detail::nameof;
-
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
    os <<
       "Information on the Implementation and Handling of \n"
       "Mathematical Constants for Type " << nameof<T>() <<
@@ -107,6 +110,9 @@
       break;
    }
    os << std::endl;
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
 }
 
 template <class T>

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-01 13:48:54 EST (Wed, 01 Dec 2010)
@@ -37,4 +37,33 @@
       <include>$(gmp_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx
     ;
 
-run test_constants.cpp $(boost-path)/libs/test/build//boost_test_exec_monitor ;
+if $(ntl-path)
+{
+ lib ntl : [ GLOB $(ntl-path)/src : *.cpp ] ;
+}
+else
+{
+ lib ntl ;
+}
+
+explicit ntl ;
+
+if $(gmp_path)
+{
+ lib mpfr_class : $(gmp_path)/gmpfrxx/gmpfrxx.cpp ;
+}
+else
+{
+ lib mpfr_class ;
+}
+
+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 ;
+
+
+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 ;

Modified: sandbox/math_constants/libs/math/test/test_constants.cpp
==============================================================================
--- sandbox/math_constants/libs/math/test/test_constants.cpp (original)
+++ sandbox/math_constants/libs/math/test/test_constants.cpp 2010-12-01 13:48:54 EST (Wed, 01 Dec 2010)
@@ -23,8 +23,8 @@
 BOOST_STATIC_ASSERT((boost::is_same<boost::math::constants::construction_traits<long double, boost::math::policies::policy<> >::type, boost::mpl::int_<(sizeof(double) == sizeof(long double) ? boost::math::constants::construct_from_double : boost::math::constants::construct_from_long_double)> >::value));
 BOOST_STATIC_ASSERT((boost::is_same<boost::math::constants::construction_traits<boost::math::concepts::real_concept, boost::math::policies::policy<> >::type, boost::mpl::int_<0> >::value));
 
-typedef boost::math::policies::policy<boost::math::policies::digits2<LDBL_MANT_DIG> > real_concept_policy_1;
-typedef boost::math::policies::policy<boost::math::policies::digits2<LDBL_MANT_DIG + 2> > real_concept_policy_2;
+typedef boost::math::policies::policy<boost::math::policies::digits2<std::numeric_limits<long double>::digits> > real_concept_policy_1;
+typedef boost::math::policies::policy<boost::math::policies::digits2<std::numeric_limits<long double>::digits + 2> > real_concept_policy_2;
 
 BOOST_STATIC_ASSERT((boost::is_same<boost::math::constants::construction_traits<boost::math::concepts::real_concept, real_concept_policy_1 >::type, boost::mpl::int_<(sizeof(double) == sizeof(long double) ? boost::math::constants::construct_from_double : boost::math::constants::construct_from_long_double) > >::value));
 BOOST_STATIC_ASSERT((boost::is_same<boost::math::constants::construction_traits<boost::math::concepts::real_concept, real_concept_policy_2 >::type, boost::mpl::int_<boost::math::constants::construct_from_string> >::value));


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