Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83360 - in trunk: boost/math/concepts boost/math/policies boost/math/special_functions libs/math/test libs/math/test/test_rational_instances
From: john_at_[hidden]
Date: 2013-03-08 07:16:14


Author: johnmaddock
Date: 2013-03-08 07:16:13 EST (Fri, 08 Mar 2013)
New Revision: 83360
URL: http://svn.boost.org/trac/boost/changeset/83360

Log:
Adjust tgamma_ratio failure rates, fix some clang warnings, plus a bug in error_handling.hpp that causes unitialized variable use in some situations.
Text files modified:
   trunk/boost/math/concepts/real_concept.hpp | 4
   trunk/boost/math/policies/error_handling.hpp | 199 ++++++++++++++++++++-------------------
   trunk/boost/math/special_functions/fpclassify.hpp | 73 +++++++-------
   trunk/libs/math/test/test_jacobi.hpp | 3
   trunk/libs/math/test/test_long_double_support.cpp | 108 ++++++++++----------
   trunk/libs/math/test/test_rational_instances/test_rational.hpp | 10 +-
   trunk/libs/math/test/test_tgamma_ratio.hpp | 22 ++--
   7 files changed, 212 insertions(+), 207 deletions(-)

Modified: trunk/boost/math/concepts/real_concept.hpp
==============================================================================
--- trunk/boost/math/concepts/real_concept.hpp (original)
+++ trunk/boost/math/concepts/real_concept.hpp 2013-03-08 07:16:13 EST (Fri, 08 Mar 2013)
@@ -369,7 +369,7 @@
 
 template <>
 inline int digits<concepts::real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::real_concept))
-{
+{
    // Assume number of significand bits is same as real_concept_base_type,
    // unless std::numeric_limits<T>::is_specialized to provide digits.
    return tools::digits<concepts::real_concept_base_type>();
@@ -435,7 +435,7 @@
 
 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
 //
-// For some strange reason ADL sometimes fails to find the
+// For some strange reason ADL sometimes fails to find the
 // correct overloads, unless we bring these declarations into scope:
 //
 using concepts::itrunc;

Modified: trunk/boost/math/policies/error_handling.hpp
==============================================================================
--- trunk/boost/math/policies/error_handling.hpp (original)
+++ trunk/boost/math/policies/error_handling.hpp 2013-03-08 07:16:13 EST (Fri, 08 Mar 2013)
@@ -46,7 +46,7 @@
 
 namespace policies{
 //
-// Forward declarations of user error handlers,
+// Forward declarations of user error handlers,
 // it's up to the user to provide the definition of these:
 //
 template <class T>
@@ -117,9 +117,9 @@
 
 template <class T>
 inline T raise_domain_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const ::boost::math::policies::domain_error< ::boost::math::policies::throw_on_error>&)
 {
    raise_error<std::domain_error, T>(function, message, val);
@@ -129,9 +129,9 @@
 
 template <class T>
 inline T raise_domain_error(
- const char* ,
- const char* ,
- const T& ,
+ const char* ,
+ const char* ,
+ const T& ,
            const ::boost::math::policies::domain_error< ::boost::math::policies::ignore_error>&)
 {
    // This may or may not do the right thing, but the user asked for the error
@@ -141,9 +141,9 @@
 
 template <class T>
 inline T raise_domain_error(
- const char* ,
- const char* ,
- const T& ,
+ const char* ,
+ const char* ,
+ const T& ,
            const ::boost::math::policies::domain_error< ::boost::math::policies::errno_on_error>&)
 {
    errno = EDOM;
@@ -154,9 +154,9 @@
 
 template <class T>
 inline T raise_domain_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const ::boost::math::policies::domain_error< ::boost::math::policies::user_error>&)
 {
    return user_domain_error(function, message, val);
@@ -164,9 +164,9 @@
 
 template <class T>
 inline T raise_pole_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const ::boost::math::policies::pole_error< ::boost::math::policies::throw_on_error>&)
 {
    return boost::math::policies::detail::raise_domain_error(function, message, val, ::boost::math::policies::domain_error< ::boost::math::policies::throw_on_error>());
@@ -174,9 +174,9 @@
 
 template <class T>
 inline T raise_pole_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const ::boost::math::policies::pole_error< ::boost::math::policies::ignore_error>&)
 {
    return ::boost::math::policies::detail::raise_domain_error(function, message, val, ::boost::math::policies::domain_error< ::boost::math::policies::ignore_error>());
@@ -184,9 +184,9 @@
 
 template <class T>
 inline T raise_pole_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const ::boost::math::policies::pole_error< ::boost::math::policies::errno_on_error>&)
 {
    return ::boost::math::policies::detail::raise_domain_error(function, message, val, ::boost::math::policies::domain_error< ::boost::math::policies::errno_on_error>());
@@ -194,9 +194,9 @@
 
 template <class T>
 inline T raise_pole_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const ::boost::math::policies::pole_error< ::boost::math::policies::user_error>&)
 {
    return user_pole_error(function, message, val);
@@ -204,8 +204,8 @@
 
 template <class T>
 inline T raise_overflow_error(
- const char* function,
- const char* message,
+ const char* function,
+ const char* message,
            const ::boost::math::policies::overflow_error< ::boost::math::policies::throw_on_error>&)
 {
    raise_error<std::overflow_error, T>(function, message ? message : "numeric overflow");
@@ -215,8 +215,8 @@
 
 template <class T>
 inline T raise_overflow_error(
- const char* ,
- const char* ,
+ const char* ,
+ const char* ,
            const ::boost::math::policies::overflow_error< ::boost::math::policies::ignore_error>&)
 {
    // This may or may not do the right thing, but the user asked for the error
@@ -226,8 +226,8 @@
 
 template <class T>
 inline T raise_overflow_error(
- const char* ,
- const char* ,
+ const char* ,
+ const char* ,
            const ::boost::math::policies::overflow_error< ::boost::math::policies::errno_on_error>&)
 {
    errno = ERANGE;
@@ -238,8 +238,8 @@
 
 template <class T>
 inline T raise_overflow_error(
- const char* function,
- const char* message,
+ const char* function,
+ const char* message,
            const ::boost::math::policies::overflow_error< ::boost::math::policies::user_error>&)
 {
    return user_overflow_error(function, message, std::numeric_limits<T>::infinity());
@@ -247,8 +247,8 @@
 
 template <class T>
 inline T raise_underflow_error(
- const char* function,
- const char* message,
+ const char* function,
+ const char* message,
            const ::boost::math::policies::underflow_error< ::boost::math::policies::throw_on_error>&)
 {
    raise_error<std::underflow_error, T>(function, message ? message : "numeric underflow");
@@ -258,8 +258,8 @@
 
 template <class T>
 inline T raise_underflow_error(
- const char* ,
- const char* ,
+ const char* ,
+ const char* ,
            const ::boost::math::policies::underflow_error< ::boost::math::policies::ignore_error>&)
 {
    // This may or may not do the right thing, but the user asked for the error
@@ -269,8 +269,8 @@
 
 template <class T>
 inline T raise_underflow_error(
- const char* /* function */,
- const char* /* message */,
+ const char* /* function */,
+ const char* /* message */,
            const ::boost::math::policies::underflow_error< ::boost::math::policies::errno_on_error>&)
 {
    errno = ERANGE;
@@ -281,8 +281,8 @@
 
 template <class T>
 inline T raise_underflow_error(
- const char* function,
- const char* message,
+ const char* function,
+ const char* message,
            const ::boost::math::policies::underflow_error< ::boost::math::policies::user_error>&)
 {
    return user_underflow_error(function, message, T(0));
@@ -290,8 +290,8 @@
 
 template <class T>
 inline T raise_denorm_error(
- const char* function,
- const char* message,
+ const char* function,
+ const char* message,
            const T& /* val */,
            const ::boost::math::policies::denorm_error< ::boost::math::policies::throw_on_error>&)
 {
@@ -302,8 +302,8 @@
 
 template <class T>
 inline T raise_denorm_error(
- const char* ,
- const char* ,
+ const char* ,
+ const char* ,
            const T& val,
            const ::boost::math::policies::denorm_error< ::boost::math::policies::ignore_error>&)
 {
@@ -314,8 +314,8 @@
 
 template <class T>
 inline T raise_denorm_error(
- const char* ,
- const char* ,
+ const char* ,
+ const char* ,
            const T& val,
            const ::boost::math::policies::denorm_error< ::boost::math::policies::errno_on_error>&)
 {
@@ -327,8 +327,8 @@
 
 template <class T>
 inline T raise_denorm_error(
- const char* function,
- const char* message,
+ const char* function,
+ const char* message,
            const T& val,
            const ::boost::math::policies::denorm_error< ::boost::math::policies::user_error>&)
 {
@@ -337,9 +337,9 @@
 
 template <class T>
 inline T raise_evaluation_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const ::boost::math::policies::evaluation_error< ::boost::math::policies::throw_on_error>&)
 {
    raise_error<boost::math::evaluation_error, T>(function, message, val);
@@ -349,9 +349,9 @@
 
 template <class T>
 inline T raise_evaluation_error(
- const char* ,
- const char* ,
- const T& val,
+ const char* ,
+ const char* ,
+ const T& val,
            const ::boost::math::policies::evaluation_error< ::boost::math::policies::ignore_error>&)
 {
    // This may or may not do the right thing, but the user asked for the error
@@ -361,9 +361,9 @@
 
 template <class T>
 inline T raise_evaluation_error(
- const char* ,
- const char* ,
- const T& val,
+ const char* ,
+ const char* ,
+ const T& val,
            const ::boost::math::policies::evaluation_error< ::boost::math::policies::errno_on_error>&)
 {
    errno = EDOM;
@@ -374,9 +374,9 @@
 
 template <class T>
 inline T raise_evaluation_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const ::boost::math::policies::evaluation_error< ::boost::math::policies::user_error>&)
 {
    return user_evaluation_error(function, message, val);
@@ -384,9 +384,9 @@
 
 template <class T, class TargetType>
 inline TargetType raise_rounding_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const TargetType&,
            const ::boost::math::policies::rounding_error< ::boost::math::policies::throw_on_error>&)
 {
@@ -397,9 +397,9 @@
 
 template <class T, class TargetType>
 inline TargetType raise_rounding_error(
- const char* ,
- const char* ,
- const T& val,
+ const char* ,
+ const char* ,
+ const T& val,
            const TargetType&,
            const ::boost::math::policies::rounding_error< ::boost::math::policies::ignore_error>&)
 {
@@ -411,9 +411,9 @@
 
 template <class T, class TargetType>
 inline TargetType raise_rounding_error(
- const char* ,
- const char* ,
- const T& val,
+ const char* ,
+ const char* ,
+ const T& val,
            const TargetType&,
            const ::boost::math::policies::rounding_error< ::boost::math::policies::errno_on_error>&)
 {
@@ -426,9 +426,9 @@
 
 template <class T, class TargetType>
 inline TargetType raise_rounding_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const TargetType& t,
            const ::boost::math::policies::rounding_error< ::boost::math::policies::user_error>&)
 {
@@ -437,9 +437,9 @@
 
 template <class T, class R>
 inline T raise_indeterminate_result_error(
- const char* function,
- const char* message,
- const T& val,
+ const char* function,
+ const char* message,
+ const T& val,
            const R& ,
            const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::throw_on_error>&)
 {
@@ -450,10 +450,10 @@
 
 template <class T, class R>
 inline T raise_indeterminate_result_error(
- const char* ,
- const char* ,
- const T& ,
- const R& result,
+ const char* ,
+ const char* ,
+ const T& ,
+ const R& result,
            const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::ignore_error>&)
 {
    // This may or may not do the right thing, but the user asked for the error
@@ -463,10 +463,10 @@
 
 template <class T, class R>
 inline T raise_indeterminate_result_error(
- const char* ,
- const char* ,
- const T& ,
- const R& result,
+ const char* ,
+ const char* ,
+ const T& ,
+ const R& result,
            const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::errno_on_error>&)
 {
    errno = EDOM;
@@ -477,10 +477,10 @@
 
 template <class T, class R>
 inline T raise_indeterminate_result_error(
- const char* function,
- const char* message,
- const T& val,
- const R& ,
+ const char* function,
+ const char* message,
+ const T& val,
+ const R& ,
            const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::user_error>&)
 {
    return user_indeterminate_result_error(function, message, val);
@@ -493,7 +493,7 @@
 {
    typedef typename Policy::domain_error_type policy_type;
    return detail::raise_domain_error(
- function, message ? message : "Domain Error evaluating function at %1%",
+ function, message ? message : "Domain Error evaluating function at %1%",
       val, policy_type());
 }
 
@@ -502,7 +502,7 @@
 {
    typedef typename Policy::pole_error_type policy_type;
    return detail::raise_pole_error(
- function, message ? message : "Evaluation of function at pole %1%",
+ function, message ? message : "Evaluation of function at pole %1%",
       val, policy_type());
 }
 
@@ -511,7 +511,7 @@
 {
    typedef typename Policy::overflow_error_type policy_type;
    return detail::raise_overflow_error<T>(
- function, message ? message : "Overflow Error",
+ function, message ? message : "Overflow Error",
       policy_type());
 }
 
@@ -520,7 +520,7 @@
 {
    typedef typename Policy::underflow_error_type policy_type;
    return detail::raise_underflow_error<T>(
- function, message ? message : "Underflow Error",
+ function, message ? message : "Underflow Error",
       policy_type());
 }
 
@@ -529,7 +529,7 @@
 {
    typedef typename Policy::denorm_error_type policy_type;
    return detail::raise_denorm_error<T>(
- function, message ? message : "Denorm Error",
+ function, message ? message : "Denorm Error",
       val,
       policy_type());
 }
@@ -539,7 +539,7 @@
 {
    typedef typename Policy::evaluation_error_type policy_type;
    return detail::raise_evaluation_error(
- function, message ? message : "Internal Evaluation Error, best value so far was %1%",
+ function, message ? message : "Internal Evaluation Error, best value so far was %1%",
       val, policy_type());
 }
 
@@ -548,7 +548,7 @@
 {
    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.",
+ function, message ? message : "Value %1% can not be represented in the target integer type.",
       val, t, policy_type());
 }
 
@@ -583,7 +583,8 @@
 {
    typedef typename R::value_type r_type;
    r_type re, im;
- bool r = check_overflow<r_type>(val.real(), &re, function, pol) || check_overflow<r_type>(val.imag(), &im, function, pol);
+ bool r = check_overflow<r_type>(val.real(), &re, function, pol);
+ r = check_overflow<r_type>(val.imag(), &im, function, pol) || r;
    *result = R(re, im);
    return r;
 }
@@ -602,7 +603,8 @@
 {
    typedef typename R::value_type r_type;
    r_type re, im;
- bool r = check_underflow<r_type>(val.real(), &re, function, pol) || check_underflow<r_type>(val.imag(), &im, function, pol);
+ bool r = check_underflow<r_type>(val.real(), &re, function, pol);
+ r = check_underflow<r_type>(val.imag(), &im, function, pol) || r;
    *result = R(re, im);
    return r;
 }
@@ -622,7 +624,8 @@
 {
    typedef typename R::value_type r_type;
    r_type re, im;
- bool r = check_denorm<r_type>(val.real(), &re, function, pol) || check_denorm<r_type>(val.imag(), &im, function, pol);
+ bool r = check_denorm<r_type>(val.real(), &re, function, pol);
+ r = check_denorm<r_type>(val.imag(), &im, function, pol) || r;
    *result = R(re, im);
    return r;
 }

Modified: trunk/boost/math/special_functions/fpclassify.hpp
==============================================================================
--- trunk/boost/math/special_functions/fpclassify.hpp (original)
+++ trunk/boost/math/special_functions/fpclassify.hpp 2013-03-08 07:16:13 EST (Fri, 08 Mar 2013)
@@ -37,13 +37,13 @@
 a floating point type (float, double or long double) can be determined
 at compile time, then the following algorithm is used:
 
- If all exponent bits, the flag bit (if there is one),
+ If all exponent bits, the flag bit (if there is one),
         and all significand bits are 0, then the number is zero.
 
- If all exponent bits and the flag bit (if there is one) are 0,
+ If all exponent bits and the flag bit (if there is one) are 0,
         and at least one significand bit is 1, then the number is subnormal.
 
- If all exponent bits are 1 and all significand bits are 0,
+ If all exponent bits are 1 and all significand bits are 0,
         then the number is infinity.
 
         If all exponent bits are 1 and at least one significand bit is 1,
@@ -56,7 +56,7 @@
 
     Most formats have the structure
         sign bit + exponent bits + significand bits.
-
+
     A few have the structure
         sign bit + exponent bits + flag bit + significand bits.
     The flag bit is 0 for zero and subnormal numbers,
@@ -85,7 +85,7 @@
   namespace std{ using ::abs; using ::fabs; }
 #endif
 
-namespace boost{
+namespace boost{
 
 //
 // This must not be located in any namespace under boost::math
@@ -100,6 +100,7 @@
 #ifdef isnan
    return isnan(t);
 #elif defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY) || !defined(BOOST_HAS_FPCLASSIFY)
+ (void)t;
    return false;
 #else // BOOST_HAS_FPCLASSIFY
    return (BOOST_FPCLASSIFY_PREFIX fpclassify(t) == (int)FP_NAN);
@@ -169,7 +170,7 @@
    if(std::numeric_limits<T>::is_specialized)
       return fpclassify_imp(t, generic_tag<true>());
 #endif
- //
+ //
    // An unknown type with no numeric_limits support,
    // so what are we supposed to do we do here?
    //
@@ -178,7 +179,7 @@
    return t == 0 ? FP_ZERO : FP_NORMAL;
 }
 
-template<class T>
+template<class T>
 int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_all_bits_tag)
 {
    typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
@@ -207,7 +208,7 @@
    return FP_NAN;
 }
 
-template<class T>
+template<class T>
 int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_leading_bits_tag)
 {
    typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
@@ -215,7 +216,7 @@
    BOOST_MATH_INSTRUMENT_VARIABLE(x);
 
    BOOST_DEDUCED_TYPENAME traits::bits a;
- traits::get_bits(x,a);
+ traits::get_bits(x,a);
    a &= traits::exponent | traits::flag | traits::significand;
 
    if(a <= traits::significand) {
@@ -278,21 +279,21 @@
 namespace detail {
 
 #ifdef BOOST_MATH_USE_STD_FPCLASSIFY
- template<class T>
+ template<class T>
     inline bool isfinite_impl(T x, native_tag const&)
     {
         return (std::isfinite)(x);
     }
 #endif
 
- template<class T>
+ template<class T>
     inline bool isfinite_impl(T x, generic_tag<true> const&)
     {
         return x >= -(std::numeric_limits<T>::max)()
             && x <= (std::numeric_limits<T>::max)();
     }
 
- template<class T>
+ template<class T>
     inline bool isfinite_impl(T x, generic_tag<false> const&)
     {
 #ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
@@ -303,7 +304,7 @@
        return true;
     }
 
- template<class T>
+ template<class T>
     inline bool isfinite_impl(T x, ieee_tag const&)
     {
         typedef BOOST_DEDUCED_TYPENAME detail::fp_traits<T>::type traits;
@@ -322,7 +323,7 @@
 
 }
 
-template<class T>
+template<class T>
 inline bool (isfinite)(T x)
 { //!< \brief return true if floating-point type t is finite.
    typedef typename detail::fp_traits<T>::type traits;
@@ -333,7 +334,7 @@
 }
 
 #ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
-template<>
+template<>
 inline bool (isfinite)(long double x)
 { //!< \brief return true if floating-point type t is finite.
    typedef detail::fp_traits<long double>::type traits;
@@ -349,14 +350,14 @@
 namespace detail {
 
 #ifdef BOOST_MATH_USE_STD_FPCLASSIFY
- template<class T>
+ template<class T>
     inline bool isnormal_impl(T x, native_tag const&)
     {
         return (std::isnormal)(x);
     }
 #endif
 
- template<class T>
+ template<class T>
     inline bool isnormal_impl(T x, generic_tag<true> const&)
     {
         if(x < 0) x = -x;
@@ -364,7 +365,7 @@
             && x <= (std::numeric_limits<T>::max)();
     }
 
- template<class T>
+ template<class T>
     inline bool isnormal_impl(T x, generic_tag<false> const&)
     {
 #ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
@@ -374,7 +375,7 @@
        return !(x == 0);
     }
 
- template<class T>
+ template<class T>
     inline bool isnormal_impl(T x, ieee_tag const&)
     {
         typedef BOOST_DEDUCED_TYPENAME detail::fp_traits<T>::type traits;
@@ -393,7 +394,7 @@
 
 }
 
-template<class T>
+template<class T>
 inline bool (isnormal)(T x)
 {
    typedef typename detail::fp_traits<T>::type traits;
@@ -404,7 +405,7 @@
 }
 
 #ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
-template<>
+template<>
 inline bool (isnormal)(long double x)
 {
    typedef detail::fp_traits<long double>::type traits;
@@ -420,23 +421,23 @@
 namespace detail {
 
 #ifdef BOOST_MATH_USE_STD_FPCLASSIFY
- template<class T>
+ template<class T>
     inline bool isinf_impl(T x, native_tag const&)
     {
         return (std::isinf)(x);
     }
 #endif
 
- template<class T>
+ template<class T>
     inline bool isinf_impl(T x, generic_tag<true> const&)
     {
         (void)x; // in case the compiler thinks that x is unused because std::numeric_limits<T>::has_infinity is false
- return std::numeric_limits<T>::has_infinity
+ return std::numeric_limits<T>::has_infinity
             && ( x == std::numeric_limits<T>::infinity()
                  || x == -std::numeric_limits<T>::infinity());
     }
 
- template<class T>
+ template<class T>
     inline bool isinf_impl(T x, generic_tag<false> const&)
     {
 #ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
@@ -447,7 +448,7 @@
         return false;
     }
 
- template<class T>
+ template<class T>
     inline bool isinf_impl(T x, ieee_copy_all_bits_tag const&)
     {
         typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
@@ -458,7 +459,7 @@
         return a == traits::exponent;
     }
 
- template<class T>
+ template<class T>
     inline bool isinf_impl(T x, ieee_copy_leading_bits_tag const&)
     {
         typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
@@ -482,7 +483,7 @@
 
 } // namespace detail
 
-template<class T>
+template<class T>
 inline bool (isinf)(T x)
 {
    typedef typename detail::fp_traits<T>::type traits;
@@ -493,7 +494,7 @@
 }
 
 #ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
-template<>
+template<>
 inline bool (isinf)(long double x)
 {
    typedef detail::fp_traits<long double>::type traits;
@@ -509,14 +510,14 @@
 namespace detail {
 
 #ifdef BOOST_MATH_USE_STD_FPCLASSIFY
- template<class T>
+ template<class T>
     inline bool isnan_impl(T x, native_tag const&)
     {
         return (std::isnan)(x);
     }
 #endif
 
- template<class T>
+ template<class T>
     inline bool isnan_impl(T x, generic_tag<true> const&)
     {
         return std::numeric_limits<T>::has_infinity
@@ -524,7 +525,7 @@
             : x != x;
     }
 
- template<class T>
+ template<class T>
     inline bool isnan_impl(T x, generic_tag<false> const&)
     {
 #ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
@@ -535,7 +536,7 @@
         return false;
     }
 
- template<class T>
+ template<class T>
     inline bool isnan_impl(T x, ieee_copy_all_bits_tag const&)
     {
         typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
@@ -546,7 +547,7 @@
         return a > traits::exponent;
     }
 
- template<class T>
+ template<class T>
     inline bool isnan_impl(T x, ieee_copy_leading_bits_tag const&)
     {
         typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
@@ -565,7 +566,7 @@
 
 } // namespace detail
 
-template<class T>
+template<class T>
 inline bool (isnan)(T x)
 { //!< \brief return true if floating-point type t is NaN (Not A Number).
    typedef typename detail::fp_traits<T>::type traits;
@@ -579,7 +580,7 @@
 template <> inline bool isnan BOOST_NO_MACRO_EXPAND<double>(double t){ return ::boost::math_detail::is_nan_helper(t, boost::true_type()); }
 template <> inline bool isnan BOOST_NO_MACRO_EXPAND<long double>(long double t){ return ::boost::math_detail::is_nan_helper(t, boost::true_type()); }
 #elif defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
-template<>
+template<>
 inline bool (isnan)(long double x)
 { //!< \brief return true if floating-point type t is NaN (Not A Number).
    typedef detail::fp_traits<long double>::type traits;

Modified: trunk/libs/math/test/test_jacobi.hpp
==============================================================================
--- trunk/libs/math/test/test_jacobi.hpp (original)
+++ trunk/libs/math/test/test_jacobi.hpp 2013-03-08 07:16:13 EST (Fri, 08 Mar 2013)
@@ -79,6 +79,7 @@
 template <typename T>
 void test_spots(T, const char* type_name)
 {
+ BOOST_MATH_STD_USING
     // Function values calculated on http://functions.wolfram.com/
     // Note that Mathematica's Sn/Cn/Dn accepts k^2 as the second parameter.
     // Arguments here are theta, k, sn, cn, dn
@@ -138,7 +139,7 @@
     //
     // Sanity checks for all the various derived functions - these are all
     // trivial wrappers around the main three that are tested above - so just
- // use a simple sanity check for each one.
+ // use a simple sanity check for each one.
     // Test values are from functions.wolfram.com:
     //
     T tol = boost::math::tools::epsilon<T>() * 100;

Modified: trunk/libs/math/test/test_long_double_support.cpp
==============================================================================
--- trunk/libs/math/test/test_long_double_support.cpp (original)
+++ trunk/libs/math/test/test_long_double_support.cpp 2013-03-08 07:16:13 EST (Fri, 08 Mar 2013)
@@ -87,10 +87,10 @@
    // COS:
    //
    boost::array<boost::array<long double, 2>, 4> cos_test_data = {{
- 0, 1,
- 0.125L, 0.992197667229329053149096907788250869543327304736601263468910L,
- 1.125L, 0.431176516798666176551969042921689826840697850225767471037314L,
- 1.75L, -0.178246055649492090382676943942631358969920851291548272886063L,
+ {{ 0, 1, }},
+ {{ 0.125L, 0.992197667229329053149096907788250869543327304736601263468910L, }},
+ {{ 1.125L, 0.431176516798666176551969042921689826840697850225767471037314L, }},
+ {{ 1.75L, -0.178246055649492090382676943942631358969920851291548272886063L, }},
    }};
    unary_proc = std::cos;
    inv_unary_proc = std::acos;
@@ -102,16 +102,16 @@
    // SIN:
    //
    boost::array<boost::array<long double, 2>, 6> sin_test_data = {{
- 0, 0,
- 0.125L, 0.124674733385227689957442708712108467587834905641679257885515L,
- -0.125L, -0.124674733385227689957442708712108467587834905641679257885515L,
- 1.125L, 0.902267594099095162918416128654829100758989018716070814389152L,
+ {{ 0, 0, }},
+ {{ 0.125L, 0.124674733385227689957442708712108467587834905641679257885515L, }},
+ {{ -0.125L, -0.124674733385227689957442708712108467587834905641679257885515L, }},
+ {{ 1.125L, 0.902267594099095162918416128654829100758989018716070814389152L, }},
 #if LDBL_MAX_EXP > DBL_MAX_EXP
- 1e-500L, 1e-500L,
- 1e-1500L, 1e-1500L,
+ {{ 1e-500L, 1e-500L, }},
+ {{ 1e-1500L, 1e-1500L, }},
 #else
- 0, 0,
- 0, 0,
+ {{ 0, 0, }},
+ {{ 0, 0, }},
 #endif
    }};
    unary_proc = std::sin;
@@ -124,16 +124,16 @@
    // TAN:
    //
    boost::array<boost::array<long double, 2>, 6> tan_test_data = {{
- 0, 0,
- 0.125L, 0.125655136575130967792678218629774000758665763892225542668867L,
- -0.125L, -0.125655136575130967792678218629774000758665763892225542668867L,
- 1.125L, 2.09257127637217900442373398123488678225994171614872057291399L,
+ {{ 0, 0, }},
+ {{ 0.125L, 0.125655136575130967792678218629774000758665763892225542668867L, }},
+ {{ -0.125L, -0.125655136575130967792678218629774000758665763892225542668867L, }},
+ {{ 1.125L, 2.09257127637217900442373398123488678225994171614872057291399L, }},
 #if LDBL_MAX_EXP > DBL_MAX_EXP
- 1e-500L, 1e-500L,
- 1e-1500L, 1e-1500L,
+ {{ 1e-500L, 1e-500L, }},
+ {{ 1e-1500L, 1e-1500L, }},
 #else
- 0, 0,
- 0, 0,
+ {{ 0, 0, }},
+ {{ 0, 0, }},
 #endif
    }};
    unary_proc = std::tan;
@@ -146,30 +146,30 @@
    // EXP:
    //
    boost::array<boost::array<long double, 2>, 16> exp_test_data = {{
- 0, 1,
- 0.125L, 1.13314845306682631682900722781179387256550313174518162591282L,
- -0.125L, 0.882496902584595402864892143229050736222004824990650741770309L,
- 1.125L, 3.08021684891803124500466787877703957705899375982613074033239L,
- 4.60517018598809136803598290936872841520220297725754595206666L, 100L,
- 23.0258509299404568401799145468436420760110148862877297603333L, 1e10L,
- 230.258509299404568401799145468436420760110148862877297603333L, 1e100L,
- -230.258509299404568401799145468436420760110148862877297603333L, 1e-100L,
- -23.0258509299404568401799145468436420760110148862877297603333L, 1e-10L,
- -4.60517018598809136803598290936872841520220297725754595206666L, 0.01L,
+ {{ 0, 1, }},
+ {{ 0.125L, 1.13314845306682631682900722781179387256550313174518162591282L, }},
+ {{ -0.125L, 0.882496902584595402864892143229050736222004824990650741770309L, }},
+ {{ 1.125L, 3.08021684891803124500466787877703957705899375982613074033239L, }},
+ {{ 4.60517018598809136803598290936872841520220297725754595206666L, 100L, }},
+ {{ 23.0258509299404568401799145468436420760110148862877297603333L, 1e10L, }},
+ {{ 230.258509299404568401799145468436420760110148862877297603333L, 1e100L, }},
+ {{ -230.258509299404568401799145468436420760110148862877297603333L, 1e-100L, }},
+ {{ -23.0258509299404568401799145468436420760110148862877297603333L, 1e-10L, }},
+ {{ -4.60517018598809136803598290936872841520220297725754595206666L, 0.01L, }},
 #if LDBL_MAX_EXP > DBL_MAX_EXP
- 1151.5L, 1.23054049904018215810329849694e+500L,
- 2302.5, 9.1842687219959504902800771504e+999L,
- 11351.5, 7.83089362896060182981072520459e+4929L,
- -11351.5, 1.27699346636729947157842192471e-4930L,
- -2302.5, 1.0888183156107362404277325218e-1000L,
- -1151.5, 8.12651026747999724274336150307e-501L,
+ {{ 1151.5L, 1.23054049904018215810329849694e+500L, }},
+ {{ 2302.5, 9.1842687219959504902800771504e+999L, }},
+ {{ 11351.5, 7.83089362896060182981072520459e+4929L, }},
+ {{ -11351.5, 1.27699346636729947157842192471e-4930L, }},
+ {{ -2302.5, 1.0888183156107362404277325218e-1000L, }},
+ {{ -1151.5, 8.12651026747999724274336150307e-501L, }},
 #else
- 0, 1,
- 0, 1,
- 0, 1,
- 0, 1,
- 0, 1,
- 0, 1,
+ {{ 0, 1, }},
+ {{ 0, 1, }},
+ {{ 0, 1, }},
+ {{ 0, 1, }},
+ {{ 0, 1, }},
+ {{ 0, 1, }},
 #endif
    }};
    unary_proc = std::exp;
@@ -182,19 +182,19 @@
    // SQRT:
    //
    boost::array<boost::array<long double, 2>, 8> sqrt_test_data = {{
- 1, 1,
- 0.125L, 0.353553390593273762200422181052424519642417968844237018294170L,
- 1.125L, 1.06066017177982128660126654315727355892725390653271105488251L,
- 1e10L, 1e5L,
- 1e100L, 1e50L,
+ {{ 1, 1, }},
+ {{ 0.125L, 0.353553390593273762200422181052424519642417968844237018294170L, }},
+ {{ 1.125L, 1.06066017177982128660126654315727355892725390653271105488251L, }},
+ {{ 1e10L, 1e5L, }},
+ {{ 1e100L, 1e50L, }},
 #if LDBL_MAX_EXP > DBL_MAX_EXP
- 1e500L, 1e250L,
- 1e1000L, 1e500L,
- 1e4930L, 1e2465L
+ {{ 1e500L, 1e250L, }},
+ {{ 1e1000L, 1e500L, }},
+ {{ 1e4930L, 1e2465L }},
 #else
- 1, 1,
- 1, 1,
- 1, 1,
+ {{ 1, 1, }},
+ {{ 1, 1, }},
+ {{ 1, 1, }},
 #endif
    }};
    unary_proc = std::sqrt;
@@ -219,6 +219,6 @@
    // (Parameter value, arbitrarily zero, only communicates the floating point type).
    test_spots(); // Test long double.
 
-
+
 } // BOOST_AUTO_TEST_CASE( test_main )
 

Modified: trunk/libs/math/test/test_rational_instances/test_rational.hpp
==============================================================================
--- trunk/libs/math/test/test_rational_instances/test_rational.hpp (original)
+++ trunk/libs/math/test/test_rational_instances/test_rational.hpp 2013-03-08 07:16:13 EST (Fri, 08 Mar 2013)
@@ -30,7 +30,7 @@
    // Polynomials of order 0
    //
    static const U n1c[1] = { 2 };
- static const boost::array<U, 1> n1a = { 2 };
+ static const boost::array<U, 1> n1a = {{ 2 }};
    BOOST_CHECK_CLOSE(
       boost::math::tools::evaluate_polynomial(n1c, static_cast<T>(0.125), 1),
       static_cast<T>(0.2e1L),
@@ -185,7 +185,7 @@
    // Rational functions of order 0
    //
    static const U d1c[1] = { 3 };
- static const boost::array<U, 1> d1a = { 3 };
+ static const boost::array<U, 1> d1a = {{ 3 }};
    BOOST_CHECK_CLOSE(
       boost::math::tools::evaluate_rational(n1c, d1c, static_cast<T>(0.125), 1),
       static_cast<T>(0.6666666666666666666666666666666666666667e0L),
@@ -265,7 +265,7 @@
    // Polynomials of order 1
    //
    static const U n2c[2] = { 3, 1 };
- static const boost::array<U, 2> n2a = { 3, 1 };
+ static const boost::array<U, 2> n2a = {{ 3, 1 }};
    BOOST_CHECK_CLOSE(
       boost::math::tools::evaluate_polynomial(n2c, static_cast<T>(0.125), 2),
       static_cast<T>(0.3125e1L),
@@ -495,7 +495,7 @@
    // Rational functions of order 1
    //
    static const U d2c[2] = { 5, 9 };
- static const boost::array<U, 2> d2a = { 5, 9 };
+ static const boost::array<U, 2> d2a = {{ 5, 9 }};
    BOOST_CHECK_CLOSE(
       boost::math::tools::evaluate_rational(n2c, d2c, static_cast<T>(0.125), 2),
       static_cast<T>(0.5102040816326530612244897959183673469388e0L),
@@ -584,7 +584,7 @@
    // Polynomials of order 2
    //
    static const U n3c[3] = { 10, 6, 11 };
- static const boost::array<U, 3> n3a = { 10, 6, 11 };
+ static const boost::array<U, 3> n3a = {{ 10, 6, 11 }};
    BOOST_CHECK_CLOSE(
       boost::math::tools::evaluate_polynomial(n3c, static_cast<T>(0.125), 3),
       static_cast<T>(0.10921875e2L),

Modified: trunk/libs/math/test/test_tgamma_ratio.hpp
==============================================================================
--- trunk/libs/math/test/test_tgamma_ratio.hpp (original)
+++ trunk/libs/math/test/test_tgamma_ratio.hpp 2013-03-08 07:16:13 EST (Fri, 08 Mar 2013)
@@ -55,13 +55,13 @@
    // test tgamma_delta_ratio against data:
    //
    result = boost::math::tools::test_hetero<Real>(
- data,
- bind_func<Real>(funcp, 0, 1),
+ data,
+ bind_func<Real>(funcp, 0, 1),
       extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma_delta_ratio(a, delta)", test_name);
    result = boost::math::tools::test_hetero<Real>(
- data,
- negative_tgamma_ratio<Real>(),
+ data,
+ negative_tgamma_ratio<Real>(),
       extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma_delta_ratio(a -delta)", test_name);
 }
@@ -88,8 +88,8 @@
    // test tgamma_ratio against data:
    //
    result = boost::math::tools::test_hetero<Real>(
- data,
- bind_func<Real>(funcp, 0, 1),
+ data,
+ bind_func<Real>(funcp, 0, 1),
       extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma_ratio(a, b)", test_name);
 }
@@ -132,11 +132,11 @@
    T tol = boost::math::tools::epsilon<T>() * 20;
    if(std::numeric_limits<T>::max_exponent > 200)
    {
- BOOST_CHECK_CLOSE_FRACTION(boost::math::tgamma_ratio(ldexp(T(1), -500), T(180.25)), T(8.0113754557649679470816892372669519037339812035512e-178L), tol);
- BOOST_CHECK_CLOSE_FRACTION(boost::math::tgamma_ratio(ldexp(T(1), -525), T(192.25)), T(1.5966560279353205461166489184101261541784867035063e-197L), tol);
- BOOST_CHECK_CLOSE_FRACTION(boost::math::tgamma_ratio(T(182.25), ldexp(T(1), -500)), T(4.077990437521002194346763299159975185747917450788e+181L), tol);
- BOOST_CHECK_CLOSE_FRACTION(boost::math::tgamma_ratio(T(193.25), ldexp(T(1), -525)), T(1.2040790040958522422697601672703926839178050326148e+199L), tol);
- BOOST_CHECK_CLOSE_FRACTION(boost::math::tgamma_ratio(T(193.25), T(194.75)), T(0.00037151765099653237632823607820104961270831942138159L), tol);
+ BOOST_CHECK_CLOSE_FRACTION(boost::math::tgamma_ratio(ldexp(T(1), -500), T(180.25)), T(8.0113754557649679470816892372669519037339812035512e-178L), 3 * tol);
+ BOOST_CHECK_CLOSE_FRACTION(boost::math::tgamma_ratio(ldexp(T(1), -525), T(192.25)), T(1.5966560279353205461166489184101261541784867035063e-197L), 3 * tol);
+ BOOST_CHECK_CLOSE_FRACTION(boost::math::tgamma_ratio(T(182.25), ldexp(T(1), -500)), T(4.077990437521002194346763299159975185747917450788e+181L), 3 * tol);
+ BOOST_CHECK_CLOSE_FRACTION(boost::math::tgamma_ratio(T(193.25), ldexp(T(1), -525)), T(1.2040790040958522422697601672703926839178050326148e+199L), 3 * tol);
+ BOOST_CHECK_CLOSE_FRACTION(boost::math::tgamma_ratio(T(193.25), T(194.75)), T(0.00037151765099653237632823607820104961270831942138159L), 3 * tol);
    }
    BOOST_CHECK_THROW(boost::math::tgamma_ratio(0, 2), std::domain_error);
    BOOST_CHECK_THROW(boost::math::tgamma_ratio(2, 0), std::domain_error);


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