Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2007-08-16 08:22:23


Author: johnmaddock
Date: 2007-08-16 08:22:22 EDT (Thu, 16 Aug 2007)
New Revision: 38712
URL: http://svn.boost.org/trac/boost/changeset/38712

Log:
Fixed a few more regressions, and quashed a few warnings.
Text files modified:
   sandbox/math_toolkit/boost/math/policy/policy.hpp | 12 ++++++------
   sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp | 2 ++
   sandbox/math_toolkit/boost/math/special_functions/math_fwd.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp | 2 ++
   sandbox/math_toolkit/boost/math/tools/test_data.hpp | 4 +++-
   sandbox/math_toolkit/libs/math/test/compile_test/tools_test_data_inc_test.cpp | 2 +-
   sandbox/math_toolkit/libs/math/test/test_pareto.cpp | 19 ++++++++++---------
   sandbox/math_toolkit/libs/math/test/test_poisson.cpp | 5 +++--
   sandbox/math_toolkit/libs/math/test/test_policy.cpp | 3 ++-
   9 files changed, 31 insertions(+), 22 deletions(-)

Modified: sandbox/math_toolkit/boost/math/policy/policy.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/policy/policy.hpp (original)
+++ sandbox/math_toolkit/boost/math/policy/policy.hpp 2007-08-16 08:22:22 EDT (Thu, 16 Aug 2007)
@@ -170,9 +170,9 @@
 //
 // Policy types for internal promotion:
 //
-BOOST_MATH_META_BOOL(promote_float, BOOST_MATH_PROMOTE_FLOAT_POLICY);
-BOOST_MATH_META_BOOL(promote_double, BOOST_MATH_PROMOTE_DOUBLE_POLICY);
-BOOST_MATH_META_BOOL(assert_undefined, BOOST_MATH_ASSERT_UNDEFINED_POLICY);
+BOOST_MATH_META_BOOL(promote_float, BOOST_MATH_PROMOTE_FLOAT_POLICY)
+BOOST_MATH_META_BOOL(promote_double, BOOST_MATH_PROMOTE_DOUBLE_POLICY)
+BOOST_MATH_META_BOOL(assert_undefined, BOOST_MATH_ASSERT_UNDEFINED_POLICY)
 //
 // Policy types for discrete quantiles:
 //
@@ -186,12 +186,12 @@
    integer_round_nearest
 };
 
-BOOST_MATH_META_INT(discrete_quantile_policy_type, discrete_quantile, BOOST_MATH_DISCRETE_QUANTILE_POLICY);
+BOOST_MATH_META_INT(discrete_quantile_policy_type, discrete_quantile, BOOST_MATH_DISCRETE_QUANTILE_POLICY)
 //
 // Precision:
 //
-BOOST_MATH_META_INT(int, digits10, BOOST_MATH_DIGITS10_POLICY);
-BOOST_MATH_META_INT(int, digits2, 0);
+BOOST_MATH_META_INT(int, digits10, BOOST_MATH_DIGITS10_POLICY)
+BOOST_MATH_META_INT(int, digits2, 0)
 //
 // Define the names for each possible policy:
 //

Modified: sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp 2007-08-16 08:22:22 EDT (Thu, 16 Aug 2007)
@@ -6,6 +6,8 @@
 #ifndef BOOST_MATH_COS_PI_HPP
 #define BOOST_MATH_COS_PI_HPP
 
+#include <cmath>
+#include <boost/math/tools/config.hpp>
 #include <boost/math/tools/real_cast.hpp>
 #include <boost/math/constants/constants.hpp>
 

Modified: sandbox/math_toolkit/boost/math/special_functions/math_fwd.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/math_fwd.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/math_fwd.hpp 2007-08-16 08:22:22 EDT (Thu, 16 Aug 2007)
@@ -342,10 +342,10 @@
    typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n, const Policy& pol);
 
    template <class RT>
- typename tools::promote_args<RT>::type rising_factorial(RT x, unsigned n);
+ typename tools::promote_args<RT>::type rising_factorial(RT x, int n);
 
    template <class RT, class Policy>
- typename tools::promote_args<RT>::type rising_factorial(RT x, unsigned n, const Policy& pol);
+ typename tools::promote_args<RT>::type rising_factorial(RT x, int n, const Policy& pol);
 
    // Fpclassify - classify floating-point as NaN or infinity...
    template <class T>

Modified: sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp 2007-08-16 08:22:22 EDT (Thu, 16 Aug 2007)
@@ -6,6 +6,8 @@
 #ifndef BOOST_MATH_SIN_PI_HPP
 #define BOOST_MATH_SIN_PI_HPP
 
+#include <cmath>
+#include <boost/math/tools/config.hpp>
 #include <boost/math/tools/real_cast.hpp>
 #include <boost/math/constants/constants.hpp>
 

Modified: sandbox/math_toolkit/boost/math/tools/test_data.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/test_data.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/test_data.hpp 2007-08-16 08:22:22 EDT (Thu, 16 Aug 2007)
@@ -456,7 +456,7 @@
       return false;
    }while(true);
 
- switch(info.type)
+ switch(info.type & ~dummy_param)
    {
    case random_in_range:
    case periodic_in_range:
@@ -648,6 +648,8 @@
       }while(true);
 
       break;
+ default:
+ BOOST_ASSERT(0); // should never get here!!
    }
 
    return true;

Modified: sandbox/math_toolkit/libs/math/test/compile_test/tools_test_data_inc_test.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/compile_test/tools_test_data_inc_test.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/compile_test/tools_test_data_inc_test.cpp 2007-08-16 08:22:22 EDT (Thu, 16 Aug 2007)
@@ -14,7 +14,7 @@
 template boost::math::tools::parameter_info<T> boost::math::tools::make_periodic_param<T>(T start_range, T end_range, int n_points);
 template boost::math::tools::parameter_info<T> boost::math::tools::make_power_param<T>(T basis, int start_exponent, int end_exponent);
 
-template boost::math::tools::test_data<T>;
+template class boost::math::tools::test_data<T>;
 
 template bool boost::math::tools::get_user_parameter_info<T>(boost::math::tools::parameter_info<T>& info, const char* param_name);
 

Modified: sandbox/math_toolkit/libs/math/test/test_pareto.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_pareto.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_pareto.cpp 2007-08-16 08:22:22 EDT (Thu, 16 Aug 2007)
@@ -68,15 +68,16 @@
 template <class RealType>
 void test_spots(RealType)
 {
- // Basic sanity checks.
- //RealType tolerance = static_cast<RealType>(std::pow(10., -(4))); // 1e-4 (as fraction, NOT %)
- //cout << "tolerance for type " << typeid(T).name() << " is " << tolerance << "." << endl;
- // Not used so far: use epsilon tolerances.
-
- RealType tol5eps = boost::math::tools::epsilon<RealType>() * 5;
- RealType tol10eps = boost::math::tools::epsilon<RealType>() * 10;
- RealType tol100eps = boost::math::tools::epsilon<RealType>() * 100;
- RealType tol1000eps = boost::math::tools::epsilon<RealType>() * 1000;
+ // Basic sanity checks.
+ //
+ // Tolerance are based on units of epsilon, but capped at
+ // double precision, since that's the limit of out test data:
+ //
+ RealType tol = (std::max)((RealType)boost::math::tools::epsilon<double>(), boost::math::tools::epsilon<RealType>());
+ RealType tol5eps = tol * 5;
+ RealType tol10eps = tol * 10;
+ RealType tol100eps = tol * 100;
+ RealType tol1000eps = tol * 1000;
 
    check_pareto(
       static_cast<RealType>(1.1L), //

Modified: sandbox/math_toolkit/libs/math/test/test_poisson.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_poisson.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_poisson.cpp 2007-08-16 08:22:22 EDT (Thu, 16 Aug 2007)
@@ -579,7 +579,8 @@
 
         // (Parameter value, arbitrarily zero, only communicates the floating-point type).
   test_spots(0.0F); // Test float.
- test_spots(0.0); // Test double.
+ test_spots(0.0); // Test double.
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
   if (numeric_limits<long double>::digits10 > numeric_limits<double>::digits10)
   { // long double is better than double (so not MSVC where they are same).
           test_spots(0.0L); // Test long double.
@@ -588,7 +589,7 @@
   #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
   test_spots(boost::math::concepts::real_concept(0.)); // Test real concept.
   #endif
-
+#endif
         return 0;
 } // int test_main(int, char* [])
 

Modified: sandbox/math_toolkit/libs/math/test/test_policy.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_policy.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_policy.cpp 2007-08-16 08:22:22 EDT (Thu, 16 Aug 2007)
@@ -220,9 +220,10 @@
    BOOST_CHECK(check_same(make_policy(domain_error<ignore_error>(), pole_error<ignore_error>(), overflow_error<ignore_error>(), underflow_error<throw_on_error>(), denorm_error<throw_on_error>(), evaluation_error<ignore_error>(), digits2<10>()), policy<domain_error<ignore_error>, pole_error<ignore_error>, overflow_error<ignore_error>, underflow_error<throw_on_error>, denorm_error<throw_on_error>, evaluation_error<ignore_error>, digits2<10> >()));
    BOOST_CHECK(check_same(make_policy(domain_error<ignore_error>(), pole_error<ignore_error>(), overflow_error<ignore_error>(), underflow_error<throw_on_error>(), denorm_error<throw_on_error>(), evaluation_error<ignore_error>(), digits10<5>()), policy<domain_error<ignore_error>, pole_error<ignore_error>, overflow_error<ignore_error>, underflow_error<throw_on_error>, denorm_error<throw_on_error>, evaluation_error<ignore_error>, digits2<19> >()));
    BOOST_CHECK(check_same(make_policy(domain_error<ignore_error>(), pole_error<ignore_error>(), overflow_error<ignore_error>(), underflow_error<throw_on_error>(), denorm_error<throw_on_error>(), evaluation_error<ignore_error>(), digits2<10>(), promote_float<false>()), policy<domain_error<ignore_error>, pole_error<ignore_error>, overflow_error<ignore_error>, underflow_error<throw_on_error>, denorm_error<throw_on_error>, evaluation_error<ignore_error>, digits2<10>, promote_float<false> >()));
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    BOOST_CHECK(check_same(make_policy(domain_error<ignore_error>(), pole_error<ignore_error>(), overflow_error<ignore_error>(), underflow_error<throw_on_error>(), denorm_error<throw_on_error>(), evaluation_error<ignore_error>(), digits2<10>(), promote_float<false>(), promote_double<false>()), policy<domain_error<ignore_error>, pole_error<ignore_error>, overflow_error<ignore_error>, underflow_error<throw_on_error>, denorm_error<throw_on_error>, evaluation_error<ignore_error>, digits2<10>, promote_float<false>, promote_double<false> >()));
    BOOST_CHECK(check_same(make_policy(domain_error<ignore_error>(), pole_error<ignore_error>(), overflow_error<ignore_error>(), underflow_error<throw_on_error>(), denorm_error<throw_on_error>(), evaluation_error<ignore_error>(), digits2<10>(), promote_float<false>(), promote_double<false>(), discrete_quantile<integer_round_down>()), policy<domain_error<ignore_error>, pole_error<ignore_error>, overflow_error<ignore_error>, underflow_error<throw_on_error>, denorm_error<throw_on_error>, evaluation_error<ignore_error>, digits2<10>, promote_float<false>, promote_double<false>, discrete_quantile<integer_round_down> >()));
-
+#endif
    return 0;
 } // int test_main(int, char* [])
 


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