Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2007-11-03 14:32:55


Author: johnmaddock
Date: 2007-11-03 14:32:54 EDT (Sat, 03 Nov 2007)
New Revision: 40727
URL: http://svn.boost.org/trac/boost/changeset/40727

Log:
Added workaround for Sunpro not compiling the traits classes.
Added workaround for platforms where numeric_limits<>::denorm_min() does not return a denorm!
Updated Solaris error rates.
Text files modified:
   trunk/boost/math/distributions/find_location.hpp | 7 +++++--
   trunk/boost/math/distributions/find_scale.hpp | 2 ++
   trunk/libs/math/test/test_bessel_j.cpp | 31 ++++++++++++++++++++++++++++++-
   trunk/libs/math/test/test_bessel_y.cpp | 6 +++---
   trunk/libs/math/test/test_classify.cpp | 2 +-
   trunk/libs/math/test/test_gamma.cpp | 2 +-
   trunk/libs/math/test/test_ibeta.cpp | 2 +-
   trunk/libs/math/test/test_ibeta_inv.cpp | 8 ++++----
   8 files changed, 47 insertions(+), 13 deletions(-)

Modified: trunk/boost/math/distributions/find_location.hpp
==============================================================================
--- trunk/boost/math/distributions/find_location.hpp (original)
+++ trunk/boost/math/distributions/find_location.hpp 2007-11-03 14:32:54 EDT (Sat, 03 Nov 2007)
@@ -36,10 +36,13 @@
       const Policy& pol
       )
     {
+#if !defined(BOOST_NO_SFINAE) && !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+ // Will fail to compile here if try to use with a distribution without scale & location,
+ // for example pareto, and many others. These tests are disabled by the pp-logic
+ // above if the compiler doesn't support the SFINAE tricks used in the traits class.
       BOOST_STATIC_ASSERT(::boost::math::tools::is_distribution<Dist>::value);
       BOOST_STATIC_ASSERT(::boost::math::tools::is_scaled_distribution<Dist>::value);
- // Will fail to compile here if try to use with a distribution without scale & location,
- // for example pareto, and many others.
+#endif
       static const char* function = "boost::math::find_location<Dist, Policy>&, %1%)";
 
       if(!(boost::math::isfinite)(p) || (p < 0) || (p > 1))

Modified: trunk/boost/math/distributions/find_scale.hpp
==============================================================================
--- trunk/boost/math/distributions/find_scale.hpp (original)
+++ trunk/boost/math/distributions/find_scale.hpp 2007-11-03 14:32:54 EDT (Sat, 03 Nov 2007)
@@ -37,8 +37,10 @@
       const Policy& pol
       )
     {
+#if !defined(BOOST_NO_SFINAE) && !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
       BOOST_STATIC_ASSERT(::boost::math::tools::is_distribution<Dist>::value);
       BOOST_STATIC_ASSERT(::boost::math::tools::is_scaled_distribution<Dist>::value);
+#endif
       static const char* function = "boost::math::find_scale<Dist, Policy>(%1%, %1%, %1%, Policy)";
 
       if(!(boost::math::isfinite)(p) || (p < 0) || (p > 1))

Modified: trunk/libs/math/test/test_bessel_j.cpp
==============================================================================
--- trunk/libs/math/test/test_bessel_j.cpp (original)
+++ trunk/libs/math/test/test_bessel_j.cpp 2007-11-03 14:32:54 EDT (Sat, 03 Nov 2007)
@@ -59,7 +59,9 @@
    //
    // HP-UX specific rates:
    //
- // Does this need more investigation or is test data limited????
+ // Error rate for double precision are limited by the accuracy of
+ // the approximations use, which bracket rather than preserve the root.
+ //
    add_expected_result(
       ".*", // compiler
       ".*", // stdlib
@@ -106,6 +108,33 @@
       ".*Tricky large.*", // test data group
       ".*", 3000, 1000); // test function
    //
+ // HP-UX specific rates:
+ //
+ // Error rate for double precision are limited by the accuracy of
+ // the approximations use, which bracket rather than preserve the root.
+ //
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ "Sun Solaris", // platform
+ largest_type, // test type(s)
+ "Bessel J: Random Data.*Tricky.*", // test data group
+ ".*", 3000, 500); // test function
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ "Sun Solaris", // platform
+ "double", // test type(s)
+ ".*Tricky.*", // test data group
+ ".*", 100000, 100000); // test function
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ "Sun Solaris", // platform
+ largest_type, // test type(s)
+ ".*J.*tricky.*", // test data group
+ ".*", 100, 50); // test function
+ //
    // Mac OS X:
    //
    add_expected_result(

Modified: trunk/libs/math/test/test_bessel_y.cpp
==============================================================================
--- trunk/libs/math/test/test_bessel_y.cpp (original)
+++ trunk/libs/math/test/test_bessel_y.cpp 2007-11-03 14:32:54 EDT (Sat, 03 Nov 2007)
@@ -59,19 +59,19 @@
 #endif
 
    //
- // HP-UX rates are very slightly higher:
+ // HP-UX and Solaris rates are very slightly higher:
    //
    add_expected_result(
       ".*", // compiler
       ".*", // stdlib
- "HP-UX", // platform
+ "HP-UX|Sun Solaris", // platform
       largest_type, // test type(s)
       ".*(Y[nv]|y).*Random.*", // test data group
       ".*", 30000, 30000); // test function
    add_expected_result(
       ".*", // compiler
       ".*", // stdlib
- "HP-UX", // platform
+ "HP-UX|Sun Solaris", // platform
       largest_type, // test type(s)
       ".*Y[01Nv].*", // test data group
       ".*", 400, 200); // test function

Modified: trunk/libs/math/test/test_classify.cpp
==============================================================================
--- trunk/libs/math/test/test_classify.cpp (original)
+++ trunk/libs/math/test/test_classify.cpp 2007-11-03 14:32:54 EDT (Sat, 03 Nov 2007)
@@ -41,7 +41,7 @@
          BOOST_CHECK_EQUAL((::boost::math::fpclassify)(-t), (int)FP_SUBNORMAL);
       }
       t = std::numeric_limits<T>::denorm_min();
- if(t != 0)
+ if((t != 0) && (t < (std::numeric_limits<T>::min)()))
       {
          BOOST_CHECK_EQUAL((::boost::math::fpclassify)(t), (int)FP_SUBNORMAL);
          BOOST_CHECK_EQUAL((::boost::math::fpclassify)(-t), (int)FP_SUBNORMAL);

Modified: trunk/libs/math/test/test_gamma.cpp
==============================================================================
--- trunk/libs/math/test/test_gamma.cpp (original)
+++ trunk/libs/math/test/test_gamma.cpp 2007-11-03 14:32:54 EDT (Sat, 03 Nov 2007)
@@ -261,7 +261,7 @@
       ".*", // platform
       "real_concept", // test type(s)
       "factorials", // test data group
- "boost::math::lgamma", 30, 4); // test function
+ "boost::math::lgamma", 40, 4); // test function
    add_expected_result(
       ".*", // compiler
       ".*", // stdlib

Modified: trunk/libs/math/test/test_ibeta.cpp
==============================================================================
--- trunk/libs/math/test/test_ibeta.cpp (original)
+++ trunk/libs/math/test/test_ibeta.cpp 2007-11-03 14:32:54 EDT (Sat, 03 Nov 2007)
@@ -160,7 +160,7 @@
       "Sun.*", // platform
       largest_type, // test type(s)
       "(?i).*large.*", // test data group
- ".*", 110000, 10000); // test function
+ ".*", 130000, 10000); // test function
    add_expected_result(
       "[^|]*", // compiler
       "[^|]*", // stdlib

Modified: trunk/libs/math/test/test_ibeta_inv.cpp
==============================================================================
--- trunk/libs/math/test/test_ibeta_inv.cpp (original)
+++ trunk/libs/math/test/test_ibeta_inv.cpp 2007-11-03 14:32:54 EDT (Sat, 03 Nov 2007)
@@ -128,17 +128,17 @@
       ".*", 300000, 20000); // test function
 
    //
- // HP-UX
+ // HP-UX and Solaris:
    // Extended exponent range of long double
    // causes more extreme test cases to be executed:
    //
    add_expected_result(
       ".*", // compiler
       ".*", // stdlib
- "HP-UX", // platform
- "long double", // test type(s)
+ "HP-UX|Sun Solaris", // platform
+ "long double", // test type(s)
       ".*", // test data group
- ".*", 200000, 100000); // test function
+ ".*", 200000, 100000); // test function
 
    //
    // Catch all cases come last:


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