|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r82656 - in trunk: boost/math/bindings boost/math/special_functions boost/math/special_functions/detail libs/math/doc/sf_and_dist libs/math/test libs/math/test/compile_test
From: john_at_[hidden]
Date: 2013-01-28 04:32:34
Author: johnmaddock
Date: 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
New Revision: 82656
URL: http://svn.boost.org/trac/boost/changeset/82656
Log:
Add Boost.Multiprecision integration concept checks.
Fix errors that result.
Added:
trunk/libs/math/test/multiprc_concept_check_1.cpp (contents, props changed)
trunk/libs/math/test/multiprc_concept_check_2.cpp (contents, props changed)
trunk/libs/math/test/multiprc_concept_check_3.cpp (contents, props changed)
trunk/libs/math/test/multiprc_concept_check_4.cpp (contents, props changed)
Text files modified:
trunk/boost/math/bindings/mpfr.hpp | 66 +++++++++++++
trunk/boost/math/special_functions/detail/ibeta_inverse.hpp | 14 +-
trunk/boost/math/special_functions/detail/round_fwd.hpp | 9 +
trunk/boost/math/special_functions/jacobi_elliptic.hpp | 8
trunk/boost/math/special_functions/math_fwd.hpp | 42 ++++---
trunk/boost/math/special_functions/next.hpp | 73 +++++++++++---
trunk/boost/math/special_functions/round.hpp | 9 +
trunk/boost/math/special_functions/sign.hpp | 17 ++-
trunk/boost/math/special_functions/trunc.hpp | 22 ++-
trunk/libs/math/doc/sf_and_dist/jacobi_elliptic.qbk | 8
trunk/libs/math/doc/sf_and_dist/sign.qbk | 16 +-
trunk/libs/math/test/Jamfile.v2 | 14 +-
trunk/libs/math/test/compile_test/instantiate.hpp | 195 ++++++++++++++++++++++++++++++++++++++-
13 files changed, 401 insertions(+), 92 deletions(-)
Modified: trunk/boost/math/bindings/mpfr.hpp
==============================================================================
--- trunk/boost/math/bindings/mpfr.hpp (original)
+++ trunk/boost/math/bindings/mpfr.hpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -40,14 +40,25 @@
{
return abs(v);
}
+template <class T, class U>
+inline mpfr_class fabs(const __gmp_expr<T,U>& v)
+{
+ return abs(static_cast<mpfr_class>(v));
+}
-inline mpfr_class pow(const mpfr_class& b, const mpfr_class e)
+inline mpfr_class pow(const mpfr_class& b, const mpfr_class& e)
{
mpfr_class result;
mpfr_pow(result.__get_mp(), b.__get_mp(), e.__get_mp(), GMP_RNDN);
return result;
}
-
+/*
+template <class T, class U, class V, class W>
+inline mpfr_class pow(const __gmp_expr<T,U>& b, const __gmp_expr<V,W>& e)
+{
+ return pow(static_cast<mpfr_class>(b), static_cast<mpfr_class>(e));
+}
+*/
inline mpfr_class ldexp(const mpfr_class& v, int e)
{
//int e = mpfr_get_exp(*v.__get_mp());
@@ -55,6 +66,11 @@
mpfr_set_exp(result.__get_mp(), e);
return result;
}
+template <class T, class U>
+inline mpfr_class ldexp(const __gmp_expr<T,U>& v, int e)
+{
+ return ldexp(static_cast<mpfr_class>(v), e);
+}
inline mpfr_class frexp(const mpfr_class& v, int* expon)
{
@@ -64,6 +80,11 @@
*expon = e;
return result;
}
+template <class T, class U>
+inline mpfr_class frexp(const __gmp_expr<T,U>& v, int* expon)
+{
+ return frexp(static_cast<mpfr_class>(v), expon);
+}
inline mpfr_class fmod(const mpfr_class& v1, const mpfr_class& v2)
{
@@ -74,6 +95,11 @@
n = floor(v1 / v2);
return v1 - n * v2;
}
+template <class T, class U, class V, class W>
+inline mpfr_class fmod(const __gmp_expr<T,U>& v1, const __gmp_expr<V,W>& v2)
+{
+ return fmod(static_cast<mpfr_class>(v1), static_cast<mpfr_class>(v2));
+}
template <class Policy>
inline mpfr_class modf(const mpfr_class& v, long long* ipart, const Policy& pol)
@@ -81,41 +107,77 @@
*ipart = lltrunc(v, pol);
return v - boost::math::tools::real_cast<mpfr_class>(*ipart);
}
+template <class T, class U, class Policy>
+inline mpfr_class modf(const __gmp_expr<T,U>& v, long long* ipart, const Policy& pol)
+{
+ return modf(static_cast<mpfr_class>(v), ipart, pol);
+}
+
template <class Policy>
inline int iround(mpfr_class const& x, const Policy& pol)
{
return boost::math::tools::real_cast<int>(boost::math::round(x, pol));
}
+template <class T, class U, class Policy>
+inline int iround(__gmp_expr<T,U> const& x, const Policy& pol)
+{
+ return iround(static_cast<mpfr_class>(x), pol);
+}
template <class Policy>
inline long lround(mpfr_class const& x, const Policy& pol)
{
return boost::math::tools::real_cast<long>(boost::math::round(x, pol));
}
+template <class T, class U, class Policy>
+inline long lround(__gmp_expr<T,U> const& x, const Policy& pol)
+{
+ return lround(static_cast<mpfr_class>(x), pol);
+}
template <class Policy>
inline long long llround(mpfr_class const& x, const Policy& pol)
{
return boost::math::tools::real_cast<long long>(boost::math::round(x, pol));
}
+template <class T, class U, class Policy>
+inline long long llround(__gmp_expr<T,U> const& x, const Policy& pol)
+{
+ return llround(static_cast<mpfr_class>(x), pol);
+}
template <class Policy>
inline int itrunc(mpfr_class const& x, const Policy& pol)
{
return boost::math::tools::real_cast<int>(boost::math::trunc(x, pol));
}
+template <class T, class U, class Policy>
+inline int itrunc(__gmp_expr<T,U> const& x, const Policy& pol)
+{
+ return itrunc(static_cast<mpfr_class>(x), pol);
+}
template <class Policy>
inline long ltrunc(mpfr_class const& x, const Policy& pol)
{
return boost::math::tools::real_cast<long>(boost::math::trunc(x, pol));
}
+template <class T, class U, class Policy>
+inline long ltrunc(__gmp_expr<T,U> const& x, const Policy& pol)
+{
+ return ltrunc(static_cast<mpfr_class>(x), pol);
+}
template <class Policy>
inline long long lltrunc(mpfr_class const& x, const Policy& pol)
{
return boost::math::tools::real_cast<long long>(boost::math::trunc(x, pol));
}
+template <class T, class U, class Policy>
+inline long long lltrunc(__gmp_expr<T,U> const& x, const Policy& pol)
+{
+ return lltrunc(static_cast<mpfr_class>(x), pol);
+}
namespace boost{ namespace math{
Modified: trunk/boost/math/special_functions/detail/ibeta_inverse.hpp
==============================================================================
--- trunk/boost/math/special_functions/detail/ibeta_inverse.hpp (original)
+++ trunk/boost/math/special_functions/detail/ibeta_inverse.hpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -866,14 +866,16 @@
inline typename tools::promote_args<T1, T2, T3>::type
ibeta_inv(T1 a, T2 b, T3 p)
{
- return ibeta_inv(a, b, p, static_cast<T1*>(0), policies::policy<>());
+ typedef typename tools::promote_args<T1, T2, T3>::type result_type;
+ return ibeta_inv(a, b, p, static_cast<result_type*>(0), policies::policy<>());
}
template <class T1, class T2, class T3, class Policy>
inline typename tools::promote_args<T1, T2, T3>::type
ibeta_inv(T1 a, T2 b, T3 p, const Policy& pol)
{
- return ibeta_inv(a, b, p, static_cast<T1*>(0), pol);
+ typedef typename tools::promote_args<T1, T2, T3>::type result_type;
+ return ibeta_inv(a, b, p, static_cast<result_type*>(0), pol);
}
template <class T1, class T2, class T3, class T4, class Policy>
@@ -922,16 +924,16 @@
inline typename tools::promote_args<RT1, RT2, RT3>::type
ibetac_inv(RT1 a, RT2 b, RT3 q)
{
- typedef typename remove_cv<RT1>::type dummy;
- return ibetac_inv(a, b, q, static_cast<dummy*>(0), policies::policy<>());
+ typedef typename tools::promote_args<RT1, RT2, RT3>::type result_type;
+ return ibetac_inv(a, b, q, static_cast<result_type*>(0), policies::policy<>());
}
template <class RT1, class RT2, class RT3, class Policy>
inline typename tools::promote_args<RT1, RT2, RT3>::type
ibetac_inv(RT1 a, RT2 b, RT3 q, const Policy& pol)
{
- typedef typename remove_cv<RT1>::type dummy;
- return ibetac_inv(a, b, q, static_cast<dummy*>(0), pol);
+ typedef typename tools::promote_args<RT1, RT2, RT3>::type result_type;
+ return ibetac_inv(a, b, q, static_cast<result_type*>(0), pol);
}
} // namespace math
Modified: trunk/boost/math/special_functions/detail/round_fwd.hpp
==============================================================================
--- trunk/boost/math/special_functions/detail/round_fwd.hpp (original)
+++ trunk/boost/math/special_functions/detail/round_fwd.hpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -9,6 +9,7 @@
#define BOOST_MATH_SPECIAL_ROUND_FWD_HPP
#include <boost/config.hpp>
+#include <boost/math/tools/promotion.hpp>
#ifdef _MSC_VER
#pragma once
@@ -20,9 +21,9 @@
{
template <class T, class Policy>
- T trunc(const T& v, const Policy& pol);
+ typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol);
template <class T>
- T trunc(const T& v);
+ typename tools::promote_args<T>::type trunc(const T& v);
template <class T, class Policy>
int itrunc(const T& v, const Policy& pol);
template <class T>
@@ -38,9 +39,9 @@
boost::long_long_type lltrunc(const T& v);
#endif
template <class T, class Policy>
- T round(const T& v, const Policy& pol);
+ typename tools::promote_args<T>::type round(const T& v, const Policy& pol);
template <class T>
- T round(const T& v);
+ typename tools::promote_args<T>::type round(const T& v);
template <class T, class Policy>
int iround(const T& v, const Policy& pol);
template <class T>
Modified: trunk/boost/math/special_functions/jacobi_elliptic.hpp
==============================================================================
--- trunk/boost/math/special_functions/jacobi_elliptic.hpp (original)
+++ trunk/boost/math/special_functions/jacobi_elliptic.hpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -115,8 +115,8 @@
} // namespace detail
-template <class T, class Policy>
-inline typename tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn, const Policy&)
+template <class T, class U, class V, class Policy>
+inline typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn, V* pdn, const Policy&)
{
BOOST_FPU_EXCEPTION_GUARD
typedef typename tools::promote_args<T>::type result_type;
@@ -139,8 +139,8 @@
return policies::checked_narrowing_cast<result_type, Policy>(sn, function);;
}
-template <class T>
-inline typename tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn)
+template <class T, class U, class V>
+inline typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn, V* pdn)
{
return jacobi_elliptic(k, theta, pcn, pdn, policies::policy<>());
}
Modified: trunk/boost/math/special_functions/math_fwd.hpp
==============================================================================
--- trunk/boost/math/special_functions/math_fwd.hpp (original)
+++ trunk/boost/math/special_functions/math_fwd.hpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -639,13 +639,13 @@
typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_neuman_zero(T v, unsigned m);
template <class output_iterator, class T>
- inline void cyl_neuman_zero(output_iterator out_it,
+ void cyl_neuman_zero(output_iterator out_it,
T v,
std::size_t number_of_zeros,
unsigned start_index);
template <class output_iterator, class T, class Policy>
- inline void cyl_neuman_zero(output_iterator out_it,
+ void cyl_neuman_zero(output_iterator out_it,
T v,
std::size_t number_of_zeros,
unsigned start_index, const Policy&);
@@ -731,11 +731,11 @@
template <class T>
int sign BOOST_NO_MACRO_EXPAND(const T& z);
- template <class T>
- T copysign BOOST_NO_MACRO_EXPAND(const T& x, const T& y);
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type copysign BOOST_NO_MACRO_EXPAND(const T& x, const U& y);
template <class T>
- T changesign BOOST_NO_MACRO_EXPAND(const T& z);
+ typename tools::promote_args<T>::type changesign BOOST_NO_MACRO_EXPAND(const T& z);
// Exponential integrals:
namespace detail{
@@ -773,11 +773,11 @@
typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a);
// Jacobi Functions:
- template <class T, class Policy>
- typename tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn, const Policy&);
+ template <class T, class U, class V, class Policy>
+ typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn, V* pdn, const Policy&);
- template <class T>
- typename tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn = 0, T* pdn = 0);
+ template <class T, class U, class V>
+ typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn = 0, V* pdn = 0);
template <class U, class T, class Policy>
typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta, const Policy& pol);
@@ -863,22 +863,26 @@
typename tools::promote_args<T>::type pow(T base);
// next:
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type nextafter(const T&, const U&, const Policy&);
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type nextafter(const T&, const U&);
template <class T, class Policy>
- T nextafter(const T&, const T&, const Policy&);
- template <class T>
- T nextafter(const T&, const T&);
- template <class T, class Policy>
- T float_next(const T&, const Policy&);
+ typename tools::promote_args<T>::type float_next(const T&, const Policy&);
template <class T>
- T float_next(const T&);
+ typename tools::promote_args<T>::type float_next(const T&);
template <class T, class Policy>
- T float_prior(const T&, const Policy&);
+ typename tools::promote_args<T>::type float_prior(const T&, const Policy&);
template <class T>
- T float_prior(const T&);
+ typename tools::promote_args<T>::type float_prior(const T&);
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type float_distance(const T&, const U&, const Policy&);
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type float_distance(const T&, const U&);
template <class T, class Policy>
- T float_distance(const T&, const T&, const Policy&);
+ typename tools::promote_args<T>::type float_advance(T val, int distance, const Policy& pol);
template <class T>
- T float_distance(const T&, const T&);
+ typename tools::promote_args<T>::type float_advance(const T& val, int distance);
} // namespace math
} // namespace boost
Modified: trunk/boost/math/special_functions/next.hpp
==============================================================================
--- trunk/boost/math/special_functions/next.hpp (original)
+++ trunk/boost/math/special_functions/next.hpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -94,10 +94,8 @@
return val;
}
-}
-
template <class T, class Policy>
-T float_next(const T& val, const Policy& pol)
+T float_next_imp(const T& val, const Policy& pol)
{
BOOST_MATH_STD_USING
int expon;
@@ -138,6 +136,15 @@
return val + diff;
}
+}
+
+template <class T, class Policy>
+inline typename tools::promote_args<T>::type float_next(const T& val, const Policy& pol)
+{
+ typedef typename tools::promote_args<T>::type result_type;
+ return detail::float_next_imp(static_cast<result_type>(val), pol);
+}
+
#if 0 //def BOOST_MSVC
//
// We used to use ::_nextafter here, but doing so fails when using
@@ -162,13 +169,15 @@
#endif
template <class T>
-inline T float_next(const T& val)
+inline typename tools::promote_args<T>::type float_next(const T& val)
{
return float_next(val, policies::policy<>());
}
+namespace detail{
+
template <class T, class Policy>
-T float_prior(const T& val, const Policy& pol)
+T float_prior_imp(const T& val, const Policy& pol)
{
BOOST_MATH_STD_USING
int expon;
@@ -210,6 +219,15 @@
return val - diff;
}
+}
+
+template <class T, class Policy>
+inline typename tools::promote_args<T>::type float_prior(const T& val, const Policy& pol)
+{
+ typedef typename tools::promote_args<T>::type result_type;
+ return detail::float_prior_imp(static_cast<result_type>(val), pol);
+}
+
#if 0 //def BOOST_MSVC
//
// We used to use ::_nextafter here, but doing so fails when using
@@ -234,25 +252,28 @@
#endif
template <class T>
-inline T float_prior(const T& val)
+inline typename tools::promote_args<T>::type float_prior(const T& val)
{
return float_prior(val, policies::policy<>());
}
-template <class T, class Policy>
-inline T nextafter(const T& val, const T& direction, const Policy& pol)
+template <class T, class U, class Policy>
+inline typename tools::promote_args<T, U>::type nextafter(const T& val, const U& direction, const Policy& pol)
{
- return val < direction ? boost::math::float_next(val, pol) : val == direction ? val : boost::math::float_prior(val, pol);
+ typedef typename tools::promote_args<T, U>::type result_type;
+ return val < direction ? boost::math::float_next<result_type>(val, pol) : val == direction ? val : boost::math::float_prior<result_type>(val, pol);
}
-template <class T>
-inline T nextafter(const T& val, const T& direction)
+template <class T, class U>
+inline typename tools::promote_args<T, U>::type nextafter(const T& val, const U& direction)
{
return nextafter(val, direction, policies::policy<>());
}
+namespace detail{
+
template <class T, class Policy>
-T float_distance(const T& a, const T& b, const Policy& pol)
+T float_distance_imp(const T& a, const T& b, const Policy& pol)
{
BOOST_MATH_STD_USING
//
@@ -350,14 +371,25 @@
return result;
}
-template <class T>
-T float_distance(const T& a, const T& b)
+}
+
+template <class T, class U, class Policy>
+inline typename tools::promote_args<T, U>::type float_distance(const T& a, const U& b, const Policy& pol)
+{
+ typedef typename tools::promote_args<T, U>::type result_type;
+ return detail::float_distance_imp(static_cast<result_type>(a), static_cast<result_type>(b), pol);
+}
+
+template <class T, class U>
+typename tools::promote_args<T, U>::type float_distance(const T& a, const U& b)
{
return boost::math::float_distance(a, b, policies::policy<>());
}
+namespace detail{
+
template <class T, class Policy>
-T float_advance(T val, int distance, const Policy& pol)
+T float_advance_imp(T val, int distance, const Policy& pol)
{
BOOST_MATH_STD_USING
//
@@ -437,8 +469,17 @@
return val += diff;
}
+}
+
+template <class T, class Policy>
+inline typename tools::promote_args<T>::type float_advance(T val, int distance, const Policy& pol)
+{
+ typedef typename tools::promote_args<T>::type result_type;
+ return detail::float_advance_imp(static_cast<result_type>(val), distance, pol);
+}
+
template <class T>
-inline T float_advance(const T& val, int distance)
+inline typename tools::promote_args<T>::type float_advance(const T& val, int distance)
{
return boost::math::float_advance(val, distance, policies::policy<>());
}
Modified: trunk/boost/math/special_functions/round.hpp
==============================================================================
--- trunk/boost/math/special_functions/round.hpp (original)
+++ trunk/boost/math/special_functions/round.hpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -17,15 +17,16 @@
namespace boost{ namespace math{
template <class T, class Policy>
-inline T round(const T& v, const Policy& pol)
+inline typename tools::promote_args<T>::type round(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
+ typedef typename tools::promote_args<T>::type result_type;
if(!(boost::math::isfinite)(v))
- return policies::raise_rounding_error("boost::math::round<%1%>(%1%)", 0, v, v, pol);
- return v < 0 ? static_cast<T>(ceil(v - 0.5f)) : static_cast<T>(floor(v + 0.5f));
+ return policies::raise_rounding_error("boost::math::round<%1%>(%1%)", 0, static_cast<result_type>(v), static_cast<result_type>(v), pol);
+ return v < 0 ? static_cast<result_type>(ceil(v - 0.5f)) : static_cast<result_type>(floor(v + 0.5f));
}
template <class T>
-inline T round(const T& v)
+inline typename tools::promote_args<T>::type round(const T& v)
{
return round(v, policies::policy<>());
}
Modified: trunk/boost/math/special_functions/sign.hpp
==============================================================================
--- trunk/boost/math/special_functions/sign.hpp (original)
+++ trunk/boost/math/special_functions/sign.hpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -111,7 +111,8 @@
typedef typename detail::fp_traits<T>::type traits;
typedef typename traits::method method;
typedef typename boost::is_floating_point<T>::type fp_tag;
- return detail::signbit_impl(x, method());
+ typedef typename tools::promote_args<T>::type result_type;
+ return detail::signbit_impl(static_cast<result_type>(x), method());
}
template <class T>
@@ -120,20 +121,24 @@
return (z == 0) ? 0 : (boost::math::signbit)(z) ? -1 : 1;
}
-template<class T> T (changesign)(const T& x)
+template <class T> typename tools::promote_args<T>::type (changesign)(const T& x)
{ //!< \brief return unchanged binary pattern of x, except for change of sign bit.
typedef typename detail::fp_traits<T>::sign_change_type traits;
typedef typename traits::method method;
typedef typename boost::is_floating_point<T>::type fp_tag;
+ typedef typename tools::promote_args<T>::type result_type;
- return detail::changesign_impl(x, method());
+ return detail::changesign_impl(static_cast<result_type>(x), method());
}
-template <class T>
-inline T copysign BOOST_NO_MACRO_EXPAND(const T& x, const T& y)
+template <class T, class U>
+inline typename tools::promote_args<T, U>::type
+ copysign BOOST_NO_MACRO_EXPAND(const T& x, const U& y)
{
BOOST_MATH_STD_USING
- return (boost::math::signbit)(x) != (boost::math::signbit)(y) ? (boost::math::changesign)(x) : x;
+ typedef typename tools::promote_args<T, U>::type result_type;
+ return (boost::math::signbit)(static_cast<result_type>(x)) != (boost::math::signbit)(static_cast<result_type>(y))
+ ? (boost::math::changesign)(static_cast<result_type>(x)) : static_cast<result_type>(x);
}
} // namespace math
Modified: trunk/boost/math/special_functions/trunc.hpp
==============================================================================
--- trunk/boost/math/special_functions/trunc.hpp (original)
+++ trunk/boost/math/special_functions/trunc.hpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -17,15 +17,16 @@
namespace boost{ namespace math{
template <class T, class Policy>
-inline T trunc(const T& v, const Policy& pol)
+inline typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
+ typedef typename tools::promote_args<T>::type result_type;
if(!(boost::math::isfinite)(v))
- return policies::raise_rounding_error("boost::math::trunc<%1%>(%1%)", 0, v, v, pol);
- return (v >= 0) ? static_cast<T>(floor(v)) : static_cast<T>(ceil(v));
+ return policies::raise_rounding_error("boost::math::trunc<%1%>(%1%)", 0, static_cast<result_type>(v), static_cast<result_type>(v), pol);
+ return (v >= 0) ? static_cast<result_type>(floor(v)) : static_cast<result_type>(ceil(v));
}
template <class T>
-inline T trunc(const T& v)
+inline typename tools::promote_args<T>::type trunc(const T& v)
{
return trunc(v, policies::policy<>());
}
@@ -42,9 +43,10 @@
inline int itrunc(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
- T r = boost::math::trunc(v, pol);
+ typedef typename tools::promote_args<T>::type result_type;
+ result_type r = boost::math::trunc(v, pol);
if((r > (std::numeric_limits<int>::max)()) || (r < (std::numeric_limits<int>::min)()))
- return static_cast<int>(policies::raise_rounding_error("boost::math::itrunc<%1%>(%1%)", 0, v, 0, pol));
+ return static_cast<int>(policies::raise_rounding_error("boost::math::itrunc<%1%>(%1%)", 0, static_cast<result_type>(v), 0, pol));
return static_cast<int>(r);
}
template <class T>
@@ -57,9 +59,10 @@
inline long ltrunc(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
- T r = boost::math::trunc(v, pol);
+ typedef typename tools::promote_args<T>::type result_type;
+ result_type r = boost::math::trunc(v, pol);
if((r > (std::numeric_limits<long>::max)()) || (r < (std::numeric_limits<long>::min)()))
- return static_cast<long>(policies::raise_rounding_error("boost::math::ltrunc<%1%>(%1%)", 0, v, 0L, pol));
+ return static_cast<long>(policies::raise_rounding_error("boost::math::ltrunc<%1%>(%1%)", 0, static_cast<result_type>(v), 0L, pol));
return static_cast<long>(r);
}
template <class T>
@@ -74,7 +77,8 @@
inline boost::long_long_type lltrunc(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
- T r = boost::math::trunc(v, pol);
+ typedef typename tools::promote_args<T>::type result_type;
+ result_type r = boost::math::trunc(v, pol);
if((r > (std::numeric_limits<boost::long_long_type>::max)()) || (r < (std::numeric_limits<boost::long_long_type>::min)()))
return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, static_cast<boost::long_long_type>(0), pol));
return static_cast<boost::long_long_type>(r);
Modified: trunk/libs/math/doc/sf_and_dist/jacobi_elliptic.qbk
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/jacobi_elliptic.qbk (original)
+++ trunk/libs/math/doc/sf_and_dist/jacobi_elliptic.qbk 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -53,11 +53,11 @@
namespace boost { namespace math {
- template <class T>
- ``__sf_result`` jacobi_elliptic(T k, T u, T* pcn, T* pdn);
+ template <class T, class U, class V>
+ ``__sf_result`` jacobi_elliptic(T k, U u, V* pcn, V* pdn);
- template <class T, class Policy>
- ``__sf_result`` jacobi_elliptic(T k, T u, T* pcn, T* pdn, const Policy&);
+ template <class T, class U, class V, class Policy>
+ ``__sf_result`` jacobi_elliptic(T k, U u, V* pcn, V* pdn, const Policy&);
}} // namespaces
Modified: trunk/libs/math/doc/sf_and_dist/sign.qbk
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/sign.qbk (original)
+++ trunk/libs/math/doc/sf_and_dist/sign.qbk 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -12,13 +12,13 @@
int signbit(T x);
template <class T>
- inline int sign (const T& z);
+ int sign (const T& z);
- template <class T>
- inline T copysign (const T& x, const T& y);
+ template <class T, class U>
+ T copysign (const T& x, const U& y);
template <class T>
- inline T changesign (const T& z);
+ ``__sf_result`` changesign (const T& z);
}} // namespaces
@@ -32,12 +32,12 @@
[important The return value from this function is zero or /not-zero/ and [*not] zero or one.]
template <class T>
- inline int sign (const T& z);
+ int sign (const T& z);
Returns `1` if /x/ `> 0`, `-1` if /x/ `< 0`, and `0` if /x/ is zero.
- template <class T>
- inline T copysign (const T& x, const T& y);
+ template <class T, class U>
+ ``__sf_result`` copysign (const T& x, const U& y);
Sets the sign of /x/ to be the same as the sign of /y/.
@@ -45,7 +45,7 @@
for more detail.
template <class T>
- inline T changesign (const T& z);
+ T changesign (const T& z);
Returns a floating point number with a binary representation
where the signbit is the opposite of the sign bit in /x/,
Modified: trunk/libs/math/test/Jamfile.v2
==============================================================================
--- trunk/libs/math/test/Jamfile.v2 (original)
+++ trunk/libs/math/test/Jamfile.v2 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -823,11 +823,15 @@
run complex_test.cpp ../../test/build//boost_test_exec_monitor ;
-compile ntl_concept_check.cpp : [ check-target-builds ../config//has_ntl_rr : : <build>no ] ;
-compile mpfr_concept_check.cpp : [ check-target-builds ../config//has_mpfr_class : : <build>no ] ;
-compile mpreal_concept_check.cpp : [ check-target-builds ../config//has_mpreal : : <build>no ] ;
-compile e_float_concept_check.cpp : [ check-target-builds ../config//has_e_float : : <build>no ] ;
-compile test_common_factor_gmpxx.cpp : [ check-target-builds ../config//has_gmpxx : : <build>no ] ;
+compile multiprc_concept_check_1.cpp : <debug-symbols>off ;
+compile multiprc_concept_check_2.cpp : <debug-symbols>off ;
+compile multiprc_concept_check_3.cpp : <debug-symbols>off ;
+compile multiprc_concept_check_4.cpp : <debug-symbols>off ;
+compile ntl_concept_check.cpp : [ check-target-builds ../config//has_ntl_rr : : <build>no ] <debug-symbols>off ;
+compile mpfr_concept_check.cpp : [ check-target-builds ../config//has_mpfr_class : : <build>no ] <debug-symbols>off ;
+compile mpreal_concept_check.cpp : [ check-target-builds ../config//has_mpreal : : <build>no ] <debug-symbols>off ;
+compile e_float_concept_check.cpp : [ check-target-builds ../config//has_e_float : : <build>no ] <debug-symbols>off ;
+compile test_common_factor_gmpxx.cpp : [ check-target-builds ../config//has_gmpxx : : <build>no ] <debug-symbols>off ;
run ztest_max_digits10.cpp ;
run zztest_max_digits10.cpp ;
Modified: trunk/libs/math/test/compile_test/instantiate.hpp
==============================================================================
--- trunk/libs/math/test/compile_test/instantiate.hpp (original)
+++ trunk/libs/math/test/compile_test/instantiate.hpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -34,13 +34,27 @@
}
#endif
+#if !defined(TEST_GROUP_1) && !defined(TEST_GROUP_2) && !defined(TEST_GROUP_3) \
+ && !defined(TEST_GROUP_4) && !defined(TEST_GROUP_5) && !defined(TEST_GROUP_6) \
+ && !defined(TEST_GROUP_7) && !defined(TEST_GROUP_8) && !defined(TEST_GROUP_9)
+# define TEST_GROUP_1
+# define TEST_GROUP_2
+# define TEST_GROUP_3
+# define TEST_GROUP_4
+# define TEST_GROUP_5
+# define TEST_GROUP_6
+# define TEST_GROUP_7
+# define TEST_GROUP_8
+# define TEST_GROUP_9
+#endif
+
template <class RealType>
void instantiate(RealType)
{
using namespace boost;
using namespace boost::math;
using namespace boost::math::concepts;
-
+#ifdef TEST_GROUP_1
function_requires<DistributionConcept<bernoulli_distribution<RealType> > >();
function_requires<DistributionConcept<beta_distribution<RealType> > >();
function_requires<DistributionConcept<binomial_distribution<RealType> > >();
@@ -72,7 +86,9 @@
function_requires<DistributionConcept<triangular_distribution<RealType> > >();
function_requires<DistributionConcept<uniform_distribution<RealType> > >();
function_requires<DistributionConcept<weibull_distribution<RealType> > >();
+#endif
#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
+#ifdef TEST_GROUP_2
function_requires<DistributionConcept<bernoulli_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<beta_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<binomial_distribution<RealType, test_policy> > >();
@@ -104,7 +120,8 @@
function_requires<DistributionConcept<triangular_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<uniform_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<weibull_distribution<RealType, test_policy> > >();
-
+#endif
+#ifdef TEST_GROUP_3
function_requires<DistributionConcept<dist_test::bernoulli > >();
function_requires<DistributionConcept<dist_test::beta > >();
function_requires<DistributionConcept<dist_test::binomial > >();
@@ -137,10 +154,12 @@
function_requires<DistributionConcept<dist_test::weibull > >();
function_requires<DistributionConcept<dist_test::hypergeometric > >();
#endif
+#endif
int i;
RealType v1(0.5), v2(0.5), v3(0.5);
boost::detail::dummy_constructor dc;
boost::output_iterator_archetype<RealType> oi(dc);
+#ifdef TEST_GROUP_4
boost::math::tgamma(v1);
boost::math::tgamma1pm1(v1);
boost::math::lgamma(v1);
@@ -296,7 +315,169 @@
boost::math::float_next(v1);
boost::math::float_prior(v1);
boost::math::float_distance(v1, v1);
+#endif
+#ifdef TEST_GROUP_9
+ //
+ // Over again, but arguments may be expression templates:
+ //
+ boost::math::tgamma(v1 + 0);
+ boost::math::tgamma1pm1(v1 + 0);
+ boost::math::lgamma(v1 * 1);
+ boost::math::lgamma(v1 * 1, &i);
+ boost::math::digamma(v1 * 1);
+ boost::math::tgamma_ratio(v1 * 1, v2 + 0);
+ boost::math::tgamma_delta_ratio(v1 * 1, v2 + 0);
+ boost::math::factorial<RealType>(i);
+ boost::math::unchecked_factorial<RealType>(i);
+ i = boost::math::max_factorial<RealType>::value;
+ boost::math::double_factorial<RealType>(i);
+ boost::math::rising_factorial(v1 * 1, i);
+ boost::math::falling_factorial(v1 * 1, i);
+ boost::math::tgamma(v1 * 1, v2 + 0);
+ boost::math::tgamma_lower(v1 * 1, v2 - 0);
+ boost::math::gamma_p(v1 * 1, v2 + 0);
+ boost::math::gamma_q(v1 * 1, v2 + 0);
+ boost::math::gamma_p_inv(v1 * 1, v2 + 0);
+ boost::math::gamma_q_inv(v1 * 1, v2 + 0);
+ boost::math::gamma_p_inva(v1 * 1, v2 + 0);
+ boost::math::gamma_q_inva(v1 * 1, v2 + 0);
+ boost::math::erf(v1 * 1);
+ boost::math::erfc(v1 * 1);
+ boost::math::erf_inv(v1 * 1);
+ boost::math::erfc_inv(v1 * 1);
+ boost::math::beta(v1 * 1, v2 + 0);
+ boost::math::beta(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::betac(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ibeta(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ibetac(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ibeta_inv(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ibetac_inv(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ibeta_inva(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ibetac_inva(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ibeta_invb(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ibetac_invb(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::gamma_p_derivative(v2 * 1, v3 + 0);
+ boost::math::ibeta_derivative(v1 * 1, v2 + 0, v3 / 1);
+ (boost::math::fpclassify)(v1 * 1);
+ (boost::math::isfinite)(v1 * 1);
+ (boost::math::isnormal)(v1 * 1);
+ (boost::math::isnan)(v1 * 1);
+ (boost::math::isinf)(v1 * 1);
+ (boost::math::signbit)(v1 * 1);
+ (boost::math::copysign)(v1 * 1, v2 + 0);
+ (boost::math::changesign)(v1 * 1);
+ (boost::math::sign)(v1 * 1);
+ boost::math::log1p(v1 * 1);
+ boost::math::expm1(v1 * 1);
+ boost::math::cbrt(v1 * 1);
+ boost::math::sqrt1pm1(v1 * 1);
+ boost::math::powm1(v1 * 1, v2 + 0);
+ boost::math::legendre_p(1, v1 * 1);
+ boost::math::legendre_p(1, 0, v1 * 1);
+ boost::math::legendre_q(1, v1 * 1);
+ boost::math::legendre_next(2, v1 * 1, v2 + 0, v3 / 1);
+ boost::math::legendre_next(2, 2, v1 * 1, v2 + 0, v3 / 1);
+ boost::math::laguerre(1, v1 * 1);
+ boost::math::laguerre(2, 1, v1 * 1);
+ boost::math::laguerre(2u, 1u, v1 * 1);
+ boost::math::laguerre_next(2, v1 * 1, v2 + 0, v3 / 1);
+ boost::math::laguerre_next(2, 1, v1 * 1, v2 + 0, v3 / 1);
+ boost::math::hermite(1, v1 * 1);
+ boost::math::hermite_next(2, v1 * 1, v2 + 0, v3 / 1);
+ boost::math::spherical_harmonic_r(2, 1, v1 * 1, v2 + 0);
+ boost::math::spherical_harmonic_i(2, 1, v1 * 1, v2 + 0);
+ boost::math::ellint_1(v1 * 1);
+ boost::math::ellint_1(v1 * 1, v2 + 0);
+ boost::math::ellint_2(v1 * 1);
+ boost::math::ellint_2(v1 * 1, v2 + 0);
+ boost::math::ellint_3(v1 * 1, v2 + 0);
+ boost::math::ellint_3(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ellint_rc(v1 * 1, v2 + 0);
+ boost::math::ellint_rd(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ellint_rf(v1 * 1, v2 + 0, v3 / 1);
+ boost::math::ellint_rj(v1 * 1, v2 + 0, v3 / 1, v1 * 1);
+ boost::math::jacobi_elliptic(v1 * 1, v2 + 0, &v1, &v2);
+ boost::math::jacobi_cd(v1 * 1, v2 + 0);
+ boost::math::jacobi_cn(v1 * 1, v2 + 0);
+ boost::math::jacobi_cs(v1 * 1, v2 + 0);
+ boost::math::jacobi_dc(v1 * 1, v2 + 0);
+ boost::math::jacobi_dn(v1 * 1, v2 + 0);
+ boost::math::jacobi_ds(v1 * 1, v2 + 0);
+ boost::math::jacobi_nc(v1 * 1, v2 + 0);
+ boost::math::jacobi_nd(v1 * 1, v2 + 0);
+ boost::math::jacobi_ns(v1 * 1, v2 + 0);
+ boost::math::jacobi_sc(v1 * 1, v2 + 0);
+ boost::math::jacobi_sd(v1 * 1, v2 + 0);
+ boost::math::jacobi_sn(v1 * 1, v2 + 0);
+ boost::math::hypot(v1 * 1, v2 + 0);
+ boost::math::sinc_pi(v1 * 1);
+ boost::math::sinhc_pi(v1 * 1);
+ boost::math::asinh(v1 * 1);
+ boost::math::acosh(v1 * 1);
+ boost::math::atanh(v1 * 1);
+ boost::math::sin_pi(v1 * 1);
+ boost::math::cos_pi(v1 * 1);
+ boost::math::cyl_neumann(v1 * 1, v2 + 0);
+ boost::math::cyl_neumann(i, v2 * 1);
+ boost::math::cyl_bessel_j(v1 * 1, v2 + 0);
+ boost::math::cyl_bessel_j(i, v2 * 1);
+ boost::math::cyl_bessel_i(v1 * 1, v2 + 0);
+ boost::math::cyl_bessel_i(i, v2 * 1);
+ boost::math::cyl_bessel_k(v1 * 1, v2 + 0);
+ boost::math::cyl_bessel_k(i, v2 * 1);
+ boost::math::sph_bessel(i, v2 * 1);
+ boost::math::sph_bessel(i, 1);
+ boost::math::sph_neumann(i, v2 * 1);
+ boost::math::sph_neumann(i, i);
+ boost::math::cyl_bessel_j_zero(v1 * 1, i);
+ boost::math::cyl_bessel_j_zero(oi, v1 * 1, i, i);
+ boost::math::cyl_neumann_zero(v1 * 1, i);
+ boost::math::cyl_neumann_zero(oi, v1 * 1, i, i);
+#ifdef TEST_COMPLEX
+ boost::math::cyl_hankel_1(v1, v2);
+ boost::math::cyl_hankel_1(i, v2);
+ boost::math::cyl_hankel_2(v1, v2);
+ boost::math::cyl_hankel_2(i, v2);
+ boost::math::sph_hankel_1(v1, v2);
+ boost::math::sph_hankel_1(i, v2);
+ boost::math::sph_hankel_2(v1, v2);
+ boost::math::sph_hankel_2(i, v2);
+#endif
+ boost::math::airy_ai(v1 * 1);
+ boost::math::airy_bi(v1 * 1);
+ boost::math::airy_ai_prime(v1 * 1);
+ boost::math::airy_bi_prime(v1 * 1);
+ boost::math::expint(v1 * 1);
+ boost::math::expint(i);
+ boost::math::expint(i, v2 * 1);
+ boost::math::expint(i, i);
+ boost::math::zeta(v1 * 1);
+ boost::math::zeta(i);
+ boost::math::owens_t(v1 * 1, v2 + 0);
+ boost::math::trunc(v1 * 1);
+ boost::math::itrunc(v1 * 1);
+ boost::math::ltrunc(v1 * 1);
+ boost::math::round(v1 * 1);
+ boost::math::iround(v1 * 1);
+ boost::math::lround(v1 * 1);
+ //boost::math::modf(v1 * 1, &v1);
+ //boost::math::modf(v1 * 1, &i);
+ //long l;
+ //boost::math::modf(v1 * 1, &l);
+#ifdef BOOST_HAS_LONG_LONG
+ boost::math::lltrunc(v1 * 1);
+ boost::math::llround(v1 * 1);
+ //boost::long_long_type ll;
+ //boost::math::modf(v1 * 1, &ll);
+#endif
+ boost::math::pow<2>(v1 * 1);
+ boost::math::nextafter(v1 * 1, v1 + 0);
+ boost::math::float_next(v1 * 1);
+ boost::math::float_prior(v1 * 1);
+ boost::math::float_distance(v1 * 1, v1 * 1);
+#endif
#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
+#ifdef TEST_GROUP_5
//
// All over again, with a policy this time:
//
@@ -450,6 +631,8 @@
boost::math::float_next(v1, pol);
boost::math::float_prior(v1, pol);
boost::math::float_distance(v1, v1, pol);
+#endif
+#ifdef TEST_GROUP_6
//
// All over again with the versions in test::
//
@@ -606,6 +789,7 @@
test::float_prior(v1);
test::float_distance(v1, v1);
#endif
+#endif
}
template <class RealType>
@@ -624,7 +808,7 @@
#else
double lr = 0.5L;
#endif
-
+#ifdef TEST_GROUP_7
boost::math::tgamma(i);
boost::math::tgamma1pm1(i);
boost::math::lgamma(i);
@@ -876,8 +1060,8 @@
boost::math::sph_neumann(i, i, pol);
boost::math::owens_t(fr, dr, pol);
boost::math::owens_t(i, s, pol);
-
-
+#endif
+#ifdef TEST_GROUP_8
test::tgamma(i);
test::tgamma1pm1(i);
test::lgamma(i);
@@ -997,6 +1181,7 @@
test::owens_t(fr, dr);
test::owens_t(i, s);
#endif
+#endif
}
Added: trunk/libs/math/test/multiprc_concept_check_1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/math/test/multiprc_concept_check_1.cpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -0,0 +1,41 @@
+
+// Copyright John Maddock 2013.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//
+// This tests two things: that multiprecision::number meets our
+// conceptual requirements, and that we can instantiate
+// all our distributions and special functions on this type.
+//
+#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
+#define TEST_GROUP_1
+
+#ifdef _MSC_VER
+# pragma warning(disable:4800)
+# pragma warning(disable:4512)
+# pragma warning(disable:4127)
+# pragma warning(disable:4512)
+# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
+#endif
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include <boost/math/concepts/real_type_concept.hpp>
+#include "compile_test/instantiate.hpp"
+
+using namespace boost::multiprecision;
+
+typedef number<cpp_dec_float<50>, et_on> test_type;
+
+void foo()
+{
+ instantiate(test_type());
+}
+
+int main()
+{
+ //BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<test_type>));
+}
+
+
Added: trunk/libs/math/test/multiprc_concept_check_2.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/math/test/multiprc_concept_check_2.cpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -0,0 +1,41 @@
+
+// Copyright John Maddock 2013.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//
+// This tests two things: that multiprecision::number meets our
+// conceptual requirements, and that we can instantiate
+// all our distributions and special functions on this type.
+//
+#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
+#define TEST_GROUP_9
+
+#ifdef _MSC_VER
+# pragma warning(disable:4800)
+# pragma warning(disable:4512)
+# pragma warning(disable:4127)
+# pragma warning(disable:4512)
+# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
+#endif
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include <boost/math/concepts/real_type_concept.hpp>
+#include "compile_test/instantiate.hpp"
+
+using namespace boost::multiprecision;
+
+typedef number<cpp_dec_float<50>, et_on> test_type;
+
+void foo()
+{
+ //instantiate(test_type());
+}
+
+int main()
+{
+ BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<test_type>));
+}
+
+
Added: trunk/libs/math/test/multiprc_concept_check_3.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/math/test/multiprc_concept_check_3.cpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -0,0 +1,41 @@
+
+// Copyright John Maddock 2013.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//
+// This tests two things: that multiprecision::number meets our
+// conceptual requirements, and that we can instantiate
+// all our distributions and special functions on this type.
+//
+#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
+#define TEST_GROUP_4
+
+#ifdef _MSC_VER
+# pragma warning(disable:4800)
+# pragma warning(disable:4512)
+# pragma warning(disable:4127)
+# pragma warning(disable:4512)
+# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
+#endif
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include <boost/math/concepts/real_type_concept.hpp>
+#include "compile_test/instantiate.hpp"
+
+using namespace boost::multiprecision;
+
+typedef number<cpp_dec_float<50>, et_on> test_type;
+
+void foo()
+{
+ instantiate(test_type());
+}
+
+int main()
+{
+ //BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<test_type>));
+}
+
+
Added: trunk/libs/math/test/multiprc_concept_check_4.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/math/test/multiprc_concept_check_4.cpp 2013-01-28 04:32:31 EST (Mon, 28 Jan 2013)
@@ -0,0 +1,41 @@
+
+// Copyright John Maddock 2013.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//
+// This tests two things: that multiprecision::number meets our
+// conceptual requirements, and that we can instantiate
+// all our distributions and special functions on this type.
+//
+#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
+#define TEST_GROUP_9
+
+#ifdef _MSC_VER
+# pragma warning(disable:4800)
+# pragma warning(disable:4512)
+# pragma warning(disable:4127)
+# pragma warning(disable:4512)
+# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
+#endif
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include <boost/math/concepts/real_type_concept.hpp>
+#include "compile_test/instantiate.hpp"
+
+using namespace boost::multiprecision;
+
+typedef number<cpp_dec_float<50>, et_on> test_type;
+
+void foo()
+{
+ instantiate(test_type());
+}
+
+int main()
+{
+ //BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<test_type>));
+}
+
+
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