Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2008-04-21 09:04:35


Author: johnmaddock
Date: 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
New Revision: 44695
URL: http://svn.boost.org/trac/boost/changeset/44695

Log:
Merged patches from Trunk.
Added:
   sandbox/math_toolkit/boost/math/special_functions/detail/round_fwd.hpp
      - copied unchanged from r44692, /trunk/boost/math/special_functions/detail/round_fwd.hpp
Text files modified:
   sandbox/math_toolkit/boost/math/concepts/real_concept.hpp | 120 ++++++++++++++++++++-------------
   sandbox/math_toolkit/boost/math/concepts/std_real_concept.hpp | 142 ++++++++++++++++++++--------------------
   sandbox/math_toolkit/boost/math/distributions/fwd.hpp | 12 +++
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_ik.hpp | 1
   sandbox/math_toolkit/boost/math/special_functions/fpclassify.hpp | 10 +-
   sandbox/math_toolkit/boost/math/special_functions/gamma.hpp | 6
   sandbox/math_toolkit/boost/math/special_functions/math_fwd.hpp | 25 +++---
   sandbox/math_toolkit/boost/math/tools/config.hpp | 10 ++
   sandbox/math_toolkit/boost/math/tools/polynomial.hpp | 2
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/roadmap.qbk | 2
   sandbox/math_toolkit/libs/math/test/Jamfile.v2 | 6 -
   sandbox/math_toolkit/libs/math/test/compile_test/dist_nc_beta_incl_test.cpp | 30 +++++---
   sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp | 30 +++++---
   sandbox/math_toolkit/libs/math/test/compile_test/sf_modf_incl_test.cpp | 2
   sandbox/math_toolkit/libs/math/test/expinti_data.ipp | 5
   sandbox/math_toolkit/libs/math/test/handle_test_result.hpp | 5 +
   sandbox/math_toolkit/libs/math/test/pow_test.cpp | 4 +
   sandbox/math_toolkit/libs/math/test/test_expint.cpp | 38 ++++++++++
   sandbox/math_toolkit/libs/math/test/test_nc_beta.cpp | 2
   sandbox/math_toolkit/libs/math/test/test_nc_chi_squared.cpp | 11 ++
   sandbox/math_toolkit/libs/math/test/test_nc_f.cpp | 4
   sandbox/math_toolkit/libs/math/test/test_round.cpp | 2
   sandbox/math_toolkit/libs/math/test/test_zeta.cpp | 10 +
   23 files changed, 300 insertions(+), 179 deletions(-)

Modified: sandbox/math_toolkit/boost/math/concepts/real_concept.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/concepts/real_concept.hpp (original)
+++ sandbox/math_toolkit/boost/math/concepts/real_concept.hpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -27,6 +27,9 @@
 #include <boost/math/special_functions/modf.hpp>
 #include <boost/math/tools/precision.hpp>
 #include <boost/math/policies/policy.hpp>
+#if defined(__SGI_STL_PORT)
+# include <boost/math/tools/real_cast.hpp>
+#endif
 #include <ostream>
 #include <istream>
 #include <cmath>
@@ -234,6 +237,47 @@
 inline real_concept tanh(real_concept a)
 { return std::tanh(a.value()); }
 
+//
+// Conversion and truncation routines:
+//
+template <class Policy>
+inline int iround(const concepts::real_concept& v, const Policy& pol)
+{ return boost::math::iround(v.value(), pol); }
+inline int iround(const concepts::real_concept& v)
+{ return boost::math::iround(v.value(), policies::policy<>()); }
+template <class Policy>
+inline long lround(const concepts::real_concept& v, const Policy& pol)
+{ return boost::math::lround(v.value(), pol); }
+inline long lround(const concepts::real_concept& v)
+{ return boost::math::lround(v.value(), policies::policy<>()); }
+
+#ifdef BOOST_HAS_LONG_LONG
+template <class Policy>
+inline long long llround(const concepts::real_concept& v, const Policy& pol)
+{ return boost::math::llround(v.value(), pol); }
+inline long long llround(const concepts::real_concept& v)
+{ return boost::math::llround(v.value(), policies::policy<>()); }
+#endif
+
+template <class Policy>
+inline int itrunc(const concepts::real_concept& v, const Policy& pol)
+{ return boost::math::itrunc(v.value(), pol); }
+inline int itrunc(const concepts::real_concept& v)
+{ return boost::math::itrunc(v.value(), policies::policy<>()); }
+template <class Policy>
+inline long ltrunc(const concepts::real_concept& v, const Policy& pol)
+{ return boost::math::ltrunc(v.value(), pol); }
+inline long ltrunc(const concepts::real_concept& v)
+{ return boost::math::ltrunc(v.value(), policies::policy<>()); }
+
+#ifdef BOOST_HAS_LONG_LONG
+template <class Policy>
+inline long long lltrunc(const concepts::real_concept& v, const Policy& pol)
+{ return boost::math::lltrunc(v.value(), pol); }
+inline long long lltrunc(const concepts::real_concept& v)
+{ return boost::math::lltrunc(v.value(), policies::policy<>()); }
+#endif
+
 // Streaming:
 template <class charT, class traits>
 inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const real_concept& a)
@@ -321,74 +365,54 @@
 
 } // namespace tools
 
+#if defined(__SGI_STL_PORT)
 //
-// Conversion and truncation routines:
+// We shouldn't really need these type casts any more, but there are some
+// STLport iostream bugs we work around by using them....
 //
-template <class Policy>
-inline int iround(const concepts::real_concept& v, const Policy& pol)
-{
- return iround(v.value(), pol);
-}
-inline int iround(const concepts::real_concept& v)
+namespace tools
 {
- return iround(v.value(), policies::policy<>());
-}
+// real_cast converts from T to integer and narrower floating-point types.
 
-template <class Policy>
-inline long lround(const concepts::real_concept& v, const Policy& pol)
-{
- return lround(v.value(), pol);
-}
-inline long lround(const concepts::real_concept& v)
+// Convert from T to integer types.
+
+template <>
+inline unsigned int real_cast<unsigned int, concepts::real_concept>(concepts::real_concept r)
 {
- return lround(v.value(), policies::policy<>());
+ return static_cast<unsigned int>(r.value());
 }
 
-#ifdef BOOST_HAS_LONG_LONG
-
-template <class Policy>
-inline long long llround(const concepts::real_concept& v, const Policy& pol)
+template <>
+inline int real_cast<int, concepts::real_concept>(concepts::real_concept r)
 {
- return llround(v.value(), pol);
+ return static_cast<int>(r.value());
 }
-inline long long llround(const concepts::real_concept& v)
+
+template <>
+inline long real_cast<long, concepts::real_concept>(concepts::real_concept r)
 {
- return llround(v.value(), policies::policy<>());
+ return static_cast<long>(r.value());
 }
 
-#endif
+// Converts from T to narrower floating-point types, float, double & long double.
 
-template <class Policy>
-inline int itrunc(const concepts::real_concept& v, const Policy& pol)
-{
- return itrunc(v.value(), pol);
-}
-inline int itrunc(const concepts::real_concept& v)
+template <>
+inline float real_cast<float, concepts::real_concept>(concepts::real_concept r)
 {
- return itrunc(v.value(), policies::policy<>());
+ return static_cast<float>(r.value());
 }
-
-template <class Policy>
-inline long ltrunc(const concepts::real_concept& v, const Policy& pol)
+template <>
+inline double real_cast<double, concepts::real_concept>(concepts::real_concept r)
 {
- return ltrunc(v.value(), pol);
+ return static_cast<double>(r.value());
 }
-inline long ltrunc(const concepts::real_concept& v)
+template <>
+inline long double real_cast<long double, concepts::real_concept>(concepts::real_concept r)
 {
- return ltrunc(v.value(), policies::policy<>());
+ return r.value();
 }
 
-#ifdef BOOST_HAS_LONG_LONG
-
-template <class Policy>
-inline long long lltrunc(const concepts::real_concept& v, const Policy& pol)
-{
- return lltrunc(v.value(), pol);
-}
-inline long long lltrunc(const concepts::real_concept& v)
-{
- return lltrunc(v.value(), policies::policy<>());
-}
+} // STLPort
 
 #endif
 

Modified: sandbox/math_toolkit/boost/math/concepts/std_real_concept.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/concepts/std_real_concept.hpp (original)
+++ sandbox/math_toolkit/boost/math/concepts/std_real_concept.hpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -223,86 +223,27 @@
 
 namespace boost{ namespace math{ namespace concepts{
 
-// Streaming:
-template <class charT, class traits>
-inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const std_real_concept& a)
-{
- return os << a.value();
-}
-template <class charT, class traits>
-inline std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, traits>& is, std_real_concept& a)
-{
- std_real_concept_base_type v;
- is >> v;
- a = v;
- return is;
-}
-
-} // namespace concepts
-
-namespace tools
-{
-
-template <>
-inline concepts::std_real_concept max_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
-{
- return max_value<concepts::std_real_concept_base_type>();
-}
-
-template <>
-inline concepts::std_real_concept min_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
-{
- return min_value<concepts::std_real_concept_base_type>();
-}
-
-template <>
-inline concepts::std_real_concept log_max_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
-{
- return log_max_value<concepts::std_real_concept_base_type>();
-}
-
-template <>
-inline concepts::std_real_concept log_min_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
-{
- return log_min_value<concepts::std_real_concept_base_type>();
-}
-
-template <>
-inline concepts::std_real_concept epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
-{
- return tools::epsilon<concepts::std_real_concept_base_type>();
-}
-
-template <>
-inline int digits<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
-{ // Assume number of significand bits is same as std_real_concept_base_type,
- // unless std::numeric_limits<T>::is_specialized to provide digits.
- return digits<concepts::std_real_concept_base_type>();
-}
-
-} // namespace tools
-
 //
 // Conversion and truncation routines:
 //
 template <class Policy>
 inline int iround(const concepts::std_real_concept& v, const Policy& pol)
 {
- return iround(v.value(), pol);
+ return boost::math::iround(v.value(), pol);
 }
 inline int iround(const concepts::std_real_concept& v)
 {
- return iround(v.value(), policies::policy<>());
+ return boost::math::iround(v.value(), policies::policy<>());
 }
 
 template <class Policy>
 inline long lround(const concepts::std_real_concept& v, const Policy& pol)
 {
- return lround(v.value(), pol);
+ return boost::math::lround(v.value(), pol);
 }
 inline long lround(const concepts::std_real_concept& v)
 {
- return lround(v.value(), policies::policy<>());
+ return boost::math::lround(v.value(), policies::policy<>());
 }
 
 #ifdef BOOST_HAS_LONG_LONG
@@ -310,11 +251,11 @@
 template <class Policy>
 inline long long llround(const concepts::std_real_concept& v, const Policy& pol)
 {
- return llround(v.value(), pol);
+ return boost::math::llround(v.value(), pol);
 }
 inline long long llround(const concepts::std_real_concept& v)
 {
- return llround(v.value(), policies::policy<>());
+ return boost::math::llround(v.value(), policies::policy<>());
 }
 
 #endif
@@ -322,21 +263,21 @@
 template <class Policy>
 inline int itrunc(const concepts::std_real_concept& v, const Policy& pol)
 {
- return itrunc(v.value(), pol);
+ return boost::math::itrunc(v.value(), pol);
 }
 inline int itrunc(const concepts::std_real_concept& v)
 {
- return itrunc(v.value(), policies::policy<>());
+ return boost::math::itrunc(v.value(), policies::policy<>());
 }
 
 template <class Policy>
 inline long ltrunc(const concepts::std_real_concept& v, const Policy& pol)
 {
- return ltrunc(v.value(), pol);
+ return boost::math::ltrunc(v.value(), pol);
 }
 inline long ltrunc(const concepts::std_real_concept& v)
 {
- return ltrunc(v.value(), policies::policy<>());
+ return boost::math::ltrunc(v.value(), policies::policy<>());
 }
 
 #ifdef BOOST_HAS_LONG_LONG
@@ -344,15 +285,74 @@
 template <class Policy>
 inline long long lltrunc(const concepts::std_real_concept& v, const Policy& pol)
 {
- return lltrunc(v.value(), pol);
+ return boost::math::lltrunc(v.value(), pol);
 }
 inline long long lltrunc(const concepts::std_real_concept& v)
 {
- return lltrunc(v.value(), policies::policy<>());
+ return boost::math::lltrunc(v.value(), policies::policy<>());
 }
 
 #endif
 
+// Streaming:
+template <class charT, class traits>
+inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const std_real_concept& a)
+{
+ return os << a.value();
+}
+template <class charT, class traits>
+inline std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, traits>& is, std_real_concept& a)
+{
+ std_real_concept_base_type v;
+ is >> v;
+ a = v;
+ return is;
+}
+
+} // namespace concepts
+
+namespace tools
+{
+
+template <>
+inline concepts::std_real_concept max_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
+{
+ return max_value<concepts::std_real_concept_base_type>();
+}
+
+template <>
+inline concepts::std_real_concept min_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
+{
+ return min_value<concepts::std_real_concept_base_type>();
+}
+
+template <>
+inline concepts::std_real_concept log_max_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
+{
+ return log_max_value<concepts::std_real_concept_base_type>();
+}
+
+template <>
+inline concepts::std_real_concept log_min_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
+{
+ return log_min_value<concepts::std_real_concept_base_type>();
+}
+
+template <>
+inline concepts::std_real_concept epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
+{
+ return tools::epsilon<concepts::std_real_concept_base_type>();
+}
+
+template <>
+inline int digits<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
+{ // Assume number of significand bits is same as std_real_concept_base_type,
+ // unless std::numeric_limits<T>::is_specialized to provide digits.
+ return digits<concepts::std_real_concept_base_type>();
+}
+
+} // namespace tools
+
 } // namespace math
 } // namespace boost
 

Modified: sandbox/math_toolkit/boost/math/distributions/fwd.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/fwd.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/fwd.hpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -45,6 +45,18 @@
 class negative_binomial_distribution;
 
 template <class RealType, class Policy>
+class non_central_chi_squared_distribution;
+
+template <class RealType, class Policy>
+class non_central_beta_distribution;
+
+template <class RealType, class Policy>
+class non_central_f_distribution;
+
+template <class RealType, class Policy>
+class non_central_t_distribution;
+
+template <class RealType, class Policy>
 class normal_distribution;
 
 template <class RealType, class Policy>

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_ik.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_ik.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_ik.hpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -10,6 +10,7 @@
 #pragma once
 #endif
 
+#include <boost/math/special_functions/round.hpp>
 #include <boost/math/special_functions/gamma.hpp>
 #include <boost/math/special_functions/sin_pi.hpp>
 #include <boost/math/constants/constants.hpp>

Modified: sandbox/math_toolkit/boost/math/special_functions/fpclassify.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/fpclassify.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/fpclassify.hpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -73,7 +73,7 @@
 #ifdef isnan
    return isnan(t);
 #else // BOOST_HAS_FPCLASSIFY
- return (BOOST_FPCLASSIFY_PREFIX fpclassify(t) == FP_NAN);
+ return (BOOST_FPCLASSIFY_PREFIX fpclassify(t) == (int)FP_NAN);
 #endif
 }
 
@@ -200,19 +200,19 @@
 inline bool isfinite BOOST_NO_MACRO_EXPAND(T z)
 {
    int t = (::boost::math::fpclassify)(z);
- return (t != FP_NAN) && (t != FP_INFINITE);
+ return (t != (int)FP_NAN) && (t != (int)FP_INFINITE);
 }
 
 template <class T>
 inline bool isinf BOOST_NO_MACRO_EXPAND(T t)
 {
- return (::boost::math::fpclassify)(t) == FP_INFINITE;
+ return (::boost::math::fpclassify)(t) == (int)FP_INFINITE;
 }
 
 template <class T>
 inline bool isnan BOOST_NO_MACRO_EXPAND(T t)
 {
- return (::boost::math::fpclassify)(t) == FP_NAN;
+ return (::boost::math::fpclassify)(t) == (int)FP_NAN;
 }
 #ifdef isnan
 template <> inline bool isnan BOOST_NO_MACRO_EXPAND<float>(float t){ return ::boost::math_detail::is_nan_helper(t, boost::true_type()); }
@@ -232,7 +232,7 @@
 template <class T>
 inline bool isnormal BOOST_NO_MACRO_EXPAND(T t)
 {
- return (::boost::math::fpclassify)(t) == FP_NORMAL;
+ return (::boost::math::fpclassify)(t) == (int)FP_NORMAL;
 }
 
 } // namespace math

Modified: sandbox/math_toolkit/boost/math/special_functions/gamma.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/gamma.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/gamma.hpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -152,7 +152,7 @@
       result = -boost::math::constants::pi<T>() / result;
       if(result == 0)
          return policies::raise_underflow_error<T>(function, "Result of tgamma is too small to represent.", pol);
- if((boost::math::fpclassify)(result) == FP_SUBNORMAL)
+ if((boost::math::fpclassify)(result) == (int)FP_SUBNORMAL)
          return policies::raise_denorm_error<T>(function, "Result of tgamma is denormalized.", result, pol);
       return result;
    }
@@ -352,7 +352,7 @@
       result = -boost::math::constants::pi<T>() / result;
       if(result == 0)
          return policies::raise_underflow_error<T>(function, "Result of tgamma is too small to represent.", pol);
- if((boost::math::fpclassify)(result) == FP_SUBNORMAL)
+ if((boost::math::fpclassify)(result) == (int)FP_SUBNORMAL)
          return policies::raise_denorm_error<T>(function, "Result of tgamma is denormalized.", result, pol);
       return result;
    }
@@ -584,7 +584,7 @@
    // This error handling isn't very good: it happens after the fact
    // rather than before it...
    //
- if((boost::math::fpclassify)(prefix) == FP_INFINITE)
+ if((boost::math::fpclassify)(prefix) == (int)FP_INFINITE)
       policies::raise_overflow_error<T>("boost::math::detail::full_igamma_prefix<%1%>(%1%, %1%)", "Result of incomplete gamma function is too large to represent.", pol);
 
    return prefix;

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 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -23,6 +23,7 @@
 #pragma once
 #endif
 
+#include <boost/math/special_functions/detail/round_fwd.hpp>
 #include <boost/math/tools/promotion.hpp> // for argument promotion.
 #include <boost/math/policies/policy.hpp>
 #include <boost/mpl/comparison.hpp>
@@ -663,13 +664,13 @@
 #define BOOST_MATH_DETAIL_LL_FUNC(Policy)\
    \
    template <class T>\
- inline T modf(const T& v, long long* ipart){ return boost::math::modf(v, ipart, Policy()); }\
+ inline T modf(const T& v, long long* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
    \
    template <class T>\
- inline long long lltrunc(const T& v){ return boost::math::lltrunc(v, Policy()); }\
+ inline long long lltrunc(const T& v){ using boost::math::lltrunc; return lltrunc(v, Policy()); }\
    \
    template <class T>\
- inline long long llround(const T& v){ return boost::math::llround(v, Policy()); }\
+ inline long long llround(const T& v){ using boost::math::llround; return llround(v, Policy()); }\
 
 #else
 #define BOOST_MATH_DETAIL_LL_FUNC(Policy)
@@ -974,31 +975,31 @@
    inline typename boost::math::tools::promote_args<T>::type zeta(T s){ return boost::math::zeta(s, Policy()); }\
    \
    template <class T>\
- inline T round(const T& v){ return boost::math::round(v, Policy()); }\
+ inline T round(const T& v){ using boost::math::round; return round(v, Policy()); }\
    \
    template <class T>\
- inline int iround(const T& v){ return boost::math::iround(v, Policy()); }\
+ inline int iround(const T& v){ using boost::math::iround; return iround(v, Policy()); }\
    \
    template <class T>\
- inline long lround(const T& v){ return boost::math::lround(v, Policy()); }\
+ inline long lround(const T& v){ using boost::math::lround; return lround(v, Policy()); }\
    \
    template <class T>\
- inline T trunc(const T& v){ return boost::math::trunc(v, Policy()); }\
+ inline T trunc(const T& v){ using boost::math::trunc; return trunc(v, Policy()); }\
    \
    template <class T>\
- inline int itrunc(const T& v){ return boost::math::itrunc(v, Policy()); }\
+ inline int itrunc(const T& v){ using boost::math::itrunc; return itrunc(v, Policy()); }\
    \
    template <class T>\
- inline long ltrunc(const T& v){ return boost::math::ltrunc(v, Policy()); }\
+ inline long ltrunc(const T& v){ using boost::math::ltrunc; return ltrunc(v, Policy()); }\
    \
    template <class T>\
- inline T modf(const T& v, T* ipart){ return boost::math::modf(v, ipart, Policy()); }\
+ inline T modf(const T& v, T* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
    \
    template <class T>\
- inline T modf(const T& v, int* ipart){ return boost::math::modf(v, ipart, Policy()); }\
+ inline T modf(const T& v, int* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
    \
    template <class T>\
- inline T modf(const T& v, long* ipart){ return boost::math::modf(v, ipart, Policy()); }\
+ inline T modf(const T& v, long* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
    \
    template <int N, class T>\
    inline typename boost::math::tools::promote_args<T>::type pow(T v){ return boost::math::pow<N>(v, Policy()); }\

Modified: sandbox/math_toolkit/boost/math/tools/config.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/config.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/config.hpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -21,6 +21,7 @@
 #endif
 
 #include <boost/math/tools/user.hpp>
+#include <boost/math/special_functions/detail/round_fwd.hpp>
 
 #if defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__hppa)
 # define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
@@ -189,7 +190,14 @@
    using std::ceil;\
    using std::floor;\
    using std::log10;\
- using std::sqrt;
+ 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;
 
 
 namespace boost{ namespace math{

Modified: sandbox/math_toolkit/boost/math/tools/polynomial.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/polynomial.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/polynomial.hpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -16,6 +16,8 @@
 #include <boost/math/special_functions/binomial.hpp>
 
 #include <vector>
+#include <ostream>
+#include <algorithm>
 
 namespace boost{ namespace math{ namespace tools{
 

Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/roadmap.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/roadmap.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/roadmap.qbk 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -71,7 +71,7 @@
 
 SVN Revisions:
 
-Sandbox and trunk last synchonised at revision: 44092.
+Sandbox and trunk last synchonised at revision: 44695.
 
 ]
 [/

Modified: sandbox/math_toolkit/libs/math/test/Jamfile.v2
==============================================================================
--- sandbox/math_toolkit/libs/math/test/Jamfile.v2 (original)
+++ sandbox/math_toolkit/libs/math/test/Jamfile.v2 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -13,10 +13,8 @@
       <toolset>gcc:<cxxflags>-Wno-missing-braces
       <toolset>darwin:<cxxflags>-Wno-missing-braces
       <toolset>acc:<cxxflags>+W2068,2461,2236,4070,4069
- <toolset>intel:<cxxflags>-Qwd264,239
- <toolset>intel:<cxxflags>/nologo
- <toolset>intel-linux:<cxxflags>-wd239
- <toolset>intel:<linkflags>/nologo
+ <toolset>intel:<cxxflags>-nologo
+ <toolset>intel:<linkflags>-nologo
       <toolset>msvc:<warnings>all
       <toolset>msvc:<asynch-exceptions>on
       <toolset>msvc:<cxxflags>/wd4996

Modified: sandbox/math_toolkit/libs/math/test/compile_test/dist_nc_beta_incl_test.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/compile_test/dist_nc_beta_incl_test.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/compile_test/dist_nc_beta_incl_test.cpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -6,17 +6,13 @@
 // Basic sanity check that header <boost/math/distributions/non_central_beta.hpp>
 // #includes all the files that it needs to.
 //
-#include <boost/math/distributions/non_central_beta.hpp>
-//
-// Note this header includes no other headers, this is
-// important if this test is to be meaningful:
-//
-#include "test_compile_result.hpp"
-
-void check()
-{
- TEST_DIST_FUNC(non_central_beta)
-}
+// In order to pass our conceptual tests, we need to forward declare
+// those functoins that the non-central beta (deliberately) doesn't
+// implement. These declarations have to appear *before* the
+// non central beta is defined, otherwise two-phase lookup
+// won't find them :-(
+//
+#include <boost/math/distributions/fwd.hpp>
 
 namespace boost{ namespace math{
 
@@ -37,6 +33,18 @@
 
 }}
 
+#include <boost/math/distributions/non_central_beta.hpp>
+//
+// Note this header includes no other headers, this is
+// important if this test is to be meaningful:
+//
+#include "test_compile_result.hpp"
+
+void check()
+{
+ TEST_DIST_FUNC(non_central_beta)
+}
+
 template class boost::math::non_central_beta_distribution<float, boost::math::policies::policy<> >;
 template class boost::math::non_central_beta_distribution<double, boost::math::policies::policy<> >;
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS

Modified: sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp (original)
+++ sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -347,19 +347,25 @@
    boost::math::expint(i, i, pol);
    boost::math::zeta(v1, pol);
    boost::math::zeta(i, pol);
- boost::math::trunc(v1, pol);
- boost::math::itrunc(v1, pol);
- boost::math::ltrunc(v1, pol);
- boost::math::round(v1, pol);
- boost::math::iround(v1, pol);
- boost::math::lround(v1, pol);
- boost::math::modf(v1, &v1, pol);
- boost::math::modf(v1, &i, pol);
- boost::math::modf(v1, &l, pol);
+ //
+ // These next functions are intended to be found via ADL:
+ //
+ BOOST_MATH_STD_USING
+ trunc(v1, pol);
+ itrunc(v1, pol);
+ ltrunc(v1, pol);
+ round(v1, pol);
+ iround(v1, pol);
+ lround(v1, pol);
+ modf(v1, &v1, pol);
+ modf(v1, &i, pol);
+ modf(v1, &l, pol);
 #ifdef BOOST_HAS_LONG_LONG
- boost::math::lltrunc(v1, pol);
- boost::math::llround(v1, pol);
- boost::math::modf(v1, &ll, pol);
+ using boost::math::lltrunc;
+ using boost::math::llround;
+ lltrunc(v1, pol);
+ llround(v1, pol);
+ modf(v1, &ll, pol);
 #endif
    boost::math::pow<2>(v1, pol);
    //

Modified: sandbox/math_toolkit/libs/math/test/compile_test/sf_modf_incl_test.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/compile_test/sf_modf_incl_test.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/compile_test/sf_modf_incl_test.cpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -40,9 +40,11 @@
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    check_result<long double>(boost::math::modf(l, &ll));
 #endif
+#ifdef BOOST_HAS_LONG_LONG
    check_result<float>(boost::math::modf(f, &llll));
    check_result<double>(boost::math::modf(d, &llll));
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    check_result<long double>(boost::math::modf(l, &llll));
 #endif
+#endif
 }

Modified: sandbox/math_toolkit/libs/math/test/expinti_data.ipp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/expinti_data.ipp (original)
+++ sandbox/math_toolkit/libs/math/test/expinti_data.ipp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -1,5 +1,5 @@
 #define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 2>, 337> expinti_data = {{
+ static const boost::array<boost::array<T, 2>, 336> expinti_data = {{
       { SC_(-49.689971923828125), SC_(-0.5189914452467706181911213069148082266893e-23) },
       { SC_(-49.490234375), SC_(-0.6362401135264284153452455085506782750647e-23) },
       { SC_(-49.47381591796875), SC_(-0.6469829627301154800340680350229540167762e-23) },
@@ -335,8 +335,7 @@
       { SC_(59.21694183349609375), SC_(896756596017748427943431.7704197691518272) },
       { SC_(59.3475341796875), SC_(1019568455497745443792447.961272554810421) },
       { SC_(59.574817657470703125), SC_(1274778904679711262832523.146694528881756) },
- { SC_(59.610748291015625), SC_(1320604762679106118330023.701104305685706) },
- { SC_(114.701263427734375), SC_(0.5733168299717727201285049464972941664115e48) }
+ { SC_(59.610748291015625), SC_(1320604762679106118330023.701104305685706) }
    }};
 #undef SC_
 

Modified: sandbox/math_toolkit/libs/math/test/handle_test_result.hpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/handle_test_result.hpp (original)
+++ sandbox/math_toolkit/libs/math/test/handle_test_result.hpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -12,6 +12,11 @@
 #include <boost/regex.hpp>
 #include <boost/test/test_tools.hpp>
 
+#if defined(BOOST_INTEL)
+# pragma warning(disable:239)
+# pragma warning(disable:264)
+#endif
+
 //
 // Every client of this header has to define this function,
 // and initialise the table of expected results:

Modified: sandbox/math_toolkit/libs/math/test/pow_test.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/pow_test.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/pow_test.cpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -106,7 +106,9 @@
     BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(pow<2>(5ul)), double>::value));
     BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(pow<2>(6.0f)), float>::value));
     BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(pow<2>(7.0)), double>::value));
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
     BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(pow<2>(7.0l)), long double>::value));
+#endif
 };
 
 
@@ -157,6 +159,7 @@
     cout << "Testing with double precision bases and negative big exponents" << endl;
     test_with_big_exponents<double, -1>();
 
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
     cout << "Testing with long double precision bases and positive small exponents" << endl;
     test_with_small_exponents<long double, 1>();
     cout << "Testing with long double precision bases and negative small exponents" << endl;
@@ -176,6 +179,7 @@
     test_with_big_exponents<concepts::real_concept, 1>();
     cout << "Testing with concepts::real_concept precision bases and negative big exponents" << endl;
     test_with_big_exponents<concepts::real_concept, -1>();
+#endif
 
     test_return_types();
 

Modified: sandbox/math_toolkit/libs/math/test/test_expint.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_expint.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_expint.cpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -60,6 +60,36 @@
    largest_type = "(long\\s+)?double";
 #endif
 
+ //
+ // On MacOS X erfc has much higher error levels than
+ // expected: given that the implementation is basically
+ // just a rational function evaluation combined with
+ // exponentiation, we conclude that exp and pow are less
+ // accurate on this platform, especially when the result
+ // is outside the range of a double.
+ //
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ "Mac OS", // platform
+ "float|double|long double", // test type(s)
+ ".*E1.*", // test data group
+ ".*", 30, 10); // test function
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ "Mac OS", // platform
+ "float|double|long double", // test type(s)
+ ".*Ei.*", // test data group
+ ".*", 300, 200); // test function
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ "Mac OS", // platform
+ ".*", // test type(s)
+ ".*", // test data group
+ ".*", 40, 15); // test function
+
    add_expected_result(
       ".*", // compiler
       ".*", // stdlib
@@ -131,7 +161,11 @@
    std::cout << test_name << " with type " << type_name << std::endl;
 
    typedef value_type (*pg)(value_type, value_type);
+#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
+ pg funcp = expint_wrapper<value_type>;
+#else
    pg funcp = expint_wrapper;
+#endif
 
    boost::math::tools::test_result<value_type> result;
    //
@@ -172,7 +206,11 @@
    std::cout << test_name << " with type " << type_name << std::endl;
 
    typedef value_type (*pg)(value_type);
+#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
+ pg funcp = boost::math::expint<value_type>;
+#else
    pg funcp = boost::math::expint;
+#endif
 
    boost::math::tools::test_result<value_type> result;
    //

Modified: sandbox/math_toolkit/libs/math/test/test_nc_beta.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_nc_beta.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_nc_beta.cpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -80,6 +80,7 @@
    largest_type = "(long\\s+)?double|real_concept";
 #endif
 
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    if(boost::math::tools::digits<long double>() == 64)
    {
       //
@@ -111,6 +112,7 @@
          "[^|]*large[^|]*", // test data group
          "[^|]*", 40000, 5500); // test function
    }
+#endif
    //
    // Catch all cases come last:
    //

Modified: sandbox/math_toolkit/libs/math/test/test_nc_chi_squared.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_nc_chi_squared.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_nc_chi_squared.cpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -80,6 +80,13 @@
    largest_type = "(long\\s+)?double|real_concept";
 #endif
 
+ add_expected_result(
+ "[^|]*", // compiler
+ "[^|]*", // stdlib
+ "Mac OS", // platform
+ largest_type, // test type(s)
+ "[^|]*medium[^|]*", // test data group
+ "[^|]*", 550, 100); // test function
    //
    // Catch all cases come last:
    //
@@ -96,7 +103,7 @@
       "[^|]*", // platform
       largest_type, // test type(s)
       "[^|]*large[^|]*", // test data group
- "[^|]*", 15000, 3000); // test function
+ "[^|]*", 17000, 3000); // test function
 
    //
    // Allow some long double error to creep into
@@ -312,7 +319,7 @@
    // mode:
    BOOST_CHECK_CLOSE(
       mode(dist)
- , static_cast<RealType>(17.184201184730857030170788677340294070728990862663L), sqrt(tolerance * 10));
+ , static_cast<RealType>(17.184201184730857030170788677340294070728990862663L), sqrt(tolerance * 20));
    BOOST_CHECK_CLOSE(
       median(dist),
       quantile(

Modified: sandbox/math_toolkit/libs/math/test/test_nc_f.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_nc_f.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_nc_f.cpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -227,9 +227,9 @@
    BOOST_MATH_STD_USING
 
    //
- // 2 eps expressed as a persentage, otherwise the limit of the test data:
+ // 5 eps expressed as a persentage, otherwise the limit of the test data:
    //
- RealType tol2 = (std::max)(boost::math::tools::epsilon<RealType>() * 200, RealType(1e-25));
+ RealType tol2 = (std::max)(boost::math::tools::epsilon<RealType>() * 500, RealType(1e-25));
    RealType x = 2;
    
    boost::math::non_central_f_distribution<RealType> dist(20, 15, 30);

Modified: sandbox/math_toolkit/libs/math/test/test_round.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_round.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_round.cpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -39,6 +39,7 @@
 template <class T, class U>
 void check_within_half(T a, U u)
 {
+ BOOST_MATH_STD_USING
    if(fabs(a-u) > 0.5f)
    {
       BOOST_ERROR("Rounded result differed by more than 0.5 from the original");
@@ -60,7 +61,6 @@
 void check_trunc_result(T a, U u)
 {
    BOOST_MATH_STD_USING
- using ::abs;
    if(fabs(a-u) >= 1)
    {
       BOOST_ERROR("Rounded result differed by more than 1 from the original");

Modified: sandbox/math_toolkit/libs/math/test/test_zeta.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_zeta.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_zeta.cpp 2008-04-21 09:04:30 EDT (Mon, 21 Apr 2008)
@@ -79,7 +79,7 @@
       ".*", // platform
       largest_type, // test type(s)
       ".*", // test data group
- ".*", 2, 1); // test function
+ ".*", 3, 1); // test function
    add_expected_result(
       ".*", // compiler
       ".*", // stdlib
@@ -105,7 +105,11 @@
    std::cout << test_name << " with type " << type_name << std::endl;
 
    typedef value_type (*pg)(value_type);
+#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
+ pg funcp = boost::math::zeta<value_type>;
+#else
    pg funcp = boost::math::zeta;
+#endif
 
    boost::math::tools::test_result<value_type> result;
    //
@@ -153,11 +157,11 @@
 {
    std::cout << "Testing basic sanity checks for type " << t << std::endl;
    //
- // Basic sanity checks, tolerance is either 2 or 10 epsilon
+ // Basic sanity checks, tolerance is either 5 or 10 epsilon
    // expressed as a percentage:
    //
    T tolerance = boost::math::tools::epsilon<T>() * 100 *
- (boost::is_floating_point<T>::value ? 2 : 10);
+ (boost::is_floating_point<T>::value ? 5 : 10);
    BOOST_CHECK_CLOSE(::boost::math::zeta(static_cast<T>(0.125)), static_cast<T>(-0.63277562349869525529352526763564627152686379131122L), tolerance);
    BOOST_CHECK_CLOSE(::boost::math::zeta(static_cast<T>(1023) / static_cast<T>(1024)), static_cast<T>(-1023.4228554489429786541032870895167448906103303056L), tolerance);
    BOOST_CHECK_CLOSE(::boost::math::zeta(static_cast<T>(1025) / static_cast<T>(1024)), static_cast<T>(1024.5772867695045940578681624248887776501597556226L), tolerance);


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