diff --git a/include/boost/math/concepts/std_real_concept.hpp b/include/boost/math/concepts/std_real_concept.hpp index ce518006c..a59356e6e 100644 --- a/include/boost/math/concepts/std_real_concept.hpp +++ b/include/boost/math/concepts/std_real_concept.hpp @@ -231,8 +231,13 @@ inline boost::math::concepts::std_real_concept tan(boost::math::concepts::std_re { return std::tan(a.value()); } inline boost::math::concepts::std_real_concept pow(boost::math::concepts::std_real_concept a, boost::math::concepts::std_real_concept b) { return std::pow(a.value(), b.value()); } +#if !defined(__SUNPRO_CC) inline boost::math::concepts::std_real_concept pow(boost::math::concepts::std_real_concept a, int b) { return std::pow(a.value(), b); } +#else +inline boost::math::concepts::std_real_concept pow(boost::math::concepts::std_real_concept a, int b) +{ return std::pow(a.value(), static_cast(b)); } +#endif inline boost::math::concepts::std_real_concept sin(boost::math::concepts::std_real_concept a) { return std::sin(a.value()); } inline boost::math::concepts::std_real_concept sinh(boost::math::concepts::std_real_concept a) diff --git a/include/boost/math/special_functions/cos_pi.hpp b/include/boost/math/special_functions/cos_pi.hpp index 7196adb90..ad877a7af 100644 --- a/include/boost/math/special_functions/cos_pi.hpp +++ b/include/boost/math/special_functions/cos_pi.hpp @@ -9,12 +9,13 @@ #include #include #include +#include #include -namespace boost{ namespace math{ +namespace boost{ namespace math{ namespace detail{ template -T cos_pi(T x) +T cos_pi_imp(T x) { BOOST_MATH_STD_USING // ADL of std names // cos of pi*x: @@ -42,10 +43,20 @@ T cos_pi(T x) return invert ? -rem : rem; } +} + template -inline T cos_pi(T x, const Policy&) +inline typename tools::promote_args::type cos_pi(T x, const Policy&) { - return cos_pi(x); + typedef typename tools::promote_args::type result_type; + return boost::math::detail::cos_pi_imp(x); +} + +template +inline typename tools::promote_args::type cos_pi(T x) +{ + typedef typename tools::promote_args::type result_type; + return boost::math::detail::cos_pi_imp(x); } } // namespace math diff --git a/include/boost/math/special_functions/detail/gamma_inva.hpp b/include/boost/math/special_functions/detail/gamma_inva.hpp index 38f554f0a..8e6f90ff5 100644 --- a/include/boost/math/special_functions/detail/gamma_inva.hpp +++ b/include/boost/math/special_functions/detail/gamma_inva.hpp @@ -146,28 +146,78 @@ T gamma_inva_imp(const T& z, const T& p, const T& q, const Policy& pol) } // namespace detail -template -inline T gamma_p_inva(T x, T p, const Policy& pol) +template +inline typename tools::promote_args::type + gamma_p_inva(T1 x, T2 p, const Policy& pol) { - return detail::gamma_inva_imp(x, p, 1 - p, pol); + typedef typename tools::promote_args::type result_type; + typedef typename policies::evaluation::type value_type; + typedef typename policies::normalise< + Policy, + policies::promote_float, + policies::promote_double, + policies::discrete_quantile<>, + policies::assert_undefined<> >::type forwarding_policy; + + if(p == 0) + { + return tools::max_value(); + } + if(p == 1) + { + return tools::min_value(); + } + + return policies::checked_narrowing_cast( + detail::gamma_inva_imp( + static_cast(x), + static_cast(p), + 1 - static_cast(p), + pol), "boost::math::gamma_p_inva<%1%>(%1%, %1%)"); } -template -inline T gamma_q_inva(T x, T q, const Policy& pol) +template +inline typename tools::promote_args::type + gamma_q_inva(T1 x, T2 q, const Policy& pol) { - return detail::gamma_inva_imp(x, 1 - q, q, pol); + typedef typename tools::promote_args::type result_type; + typedef typename policies::evaluation::type value_type; + typedef typename policies::normalise< + Policy, + policies::promote_float, + policies::promote_double, + policies::discrete_quantile<>, + policies::assert_undefined<> >::type forwarding_policy; + + if(q == 1) + { + return tools::max_value(); + } + if(q == 0) + { + return tools::min_value(); + } + + return policies::checked_narrowing_cast( + detail::gamma_inva_imp( + static_cast(x), + 1 - static_cast(q), + static_cast(q), + pol), "boost::math::gamma_q_inva<%1%>(%1%, %1%)"); } -template -inline T gamma_p_inva(T x, T p) +template +inline typename tools::promote_args::type + gamma_p_inva(T1 x, T2 p) { - return detail::gamma_inva_imp(x, p, 1 - p, policies::policy<>()); + return boost::math::gamma_p_inva(x, p, policies::policy<>()); } -template -inline T gamma_q_inva(T x, T q) +template +inline typename tools::promote_args::type + gamma_q_inva(T1 x, T2 q) { - return detail::gamma_inva_imp(x, 1 - q, q, policies::policy<>()); + return boost::math::gamma_q_inva(x, q, policies::policy<>()); } } // namespace math diff --git a/include/boost/math/special_functions/detail/ibeta_inv_ab.hpp b/include/boost/math/special_functions/detail/ibeta_inv_ab.hpp index 1086aff3d..ff9b1b122 100644 --- a/include/boost/math/special_functions/detail/ibeta_inv_ab.hpp +++ b/include/boost/math/special_functions/detail/ibeta_inv_ab.hpp @@ -155,52 +155,160 @@ T ibeta_inv_ab_imp(const T& b, const T& z, const T& p, const T& q, bool swap_ab, } // namespace detail -template -inline T ibeta_inva(T b, T x, T p, const Policy& pol) +template +typename tools::promote_args::type + ibeta_inva(RT1 b, RT2 x, RT3 p, const Policy& pol) { - return detail::ibeta_inv_ab_imp(b, x, p, 1 - p, false, pol); + typedef typename tools::promote_args::type result_type; + typedef typename policies::evaluation::type value_type; + typedef typename policies::normalise< + Policy, + policies::promote_float, + policies::promote_double, + policies::discrete_quantile<>, + policies::assert_undefined<> >::type forwarding_policy; + + if(p == 0) + { + return tools::max_value(); + } + if(p == 1) + { + return tools::min_value(); + } + + return policies::checked_narrowing_cast( + detail::ibeta_inv_ab_imp( + static_cast(b), + static_cast(x), + static_cast(p), + 1 - static_cast(p), + false, pol), + "boost::math::ibeta_inva<%1%>(%1%,%1%,%1%)"); } -template -inline T ibetac_inva(T b, T x, T q, const Policy& pol) +template +typename tools::promote_args::type + ibetac_inva(RT1 b, RT2 x, RT3 q, const Policy& pol) { - return detail::ibeta_inv_ab_imp(b, x, 1 - q, q, false, pol); + typedef typename tools::promote_args::type result_type; + typedef typename policies::evaluation::type value_type; + typedef typename policies::normalise< + Policy, + policies::promote_float, + policies::promote_double, + policies::discrete_quantile<>, + policies::assert_undefined<> >::type forwarding_policy; + + if(q == 1) + { + return tools::max_value(); + } + if(q == 0) + { + return tools::min_value(); + } + + return policies::checked_narrowing_cast( + detail::ibeta_inv_ab_imp( + static_cast(b), + static_cast(x), + 1 - static_cast(q), + static_cast(q), + false, pol), + "boost::math::ibetac_inva<%1%>(%1%,%1%,%1%)"); } -template -inline T ibeta_invb(T b, T x, T p, const Policy& pol) +template +typename tools::promote_args::type + ibeta_invb(RT1 a, RT2 x, RT3 p, const Policy& pol) { - return detail::ibeta_inv_ab_imp(b, x, p, 1 - p, true, pol); + typedef typename tools::promote_args::type result_type; + typedef typename policies::evaluation::type value_type; + typedef typename policies::normalise< + Policy, + policies::promote_float, + policies::promote_double, + policies::discrete_quantile<>, + policies::assert_undefined<> >::type forwarding_policy; + + if(p == 0) + { + return tools::min_value(); + } + if(p == 1) + { + return tools::max_value(); + } + + return policies::checked_narrowing_cast( + detail::ibeta_inv_ab_imp( + static_cast(a), + static_cast(x), + static_cast(p), + 1 - static_cast(p), + true, pol), + "boost::math::ibeta_invb<%1%>(%1%,%1%,%1%)"); } -template -inline T ibetac_invb(T b, T x, T q, const Policy& pol) +template +typename tools::promote_args::type + ibetac_invb(RT1 a, RT2 x, RT3 q, const Policy& pol) { - return detail::ibeta_inv_ab_imp(b, x, 1 - q, q, true, pol); + typedef typename tools::promote_args::type result_type; + typedef typename policies::evaluation::type value_type; + typedef typename policies::normalise< + Policy, + policies::promote_float, + policies::promote_double, + policies::discrete_quantile<>, + policies::assert_undefined<> >::type forwarding_policy; + + if(q == 1) + { + return tools::min_value(); + } + if(q == 0) + { + return tools::max_value(); + } + + return policies::checked_narrowing_cast( + detail::ibeta_inv_ab_imp( + static_cast(a), + static_cast(x), + 1 - static_cast(q), + static_cast(q), + true, pol), + "boost::math::ibetac_invb<%1%>(%1%,%1%,%1%)"); } -template -inline T ibeta_inva(T b, T x, T p) +template +inline typename tools::promote_args::type + ibeta_inva(RT1 b, RT2 x, RT3 p) { - return detail::ibeta_inv_ab_imp(b, x, p, 1 - p, false, policies::policy<>()); + return boost::math::ibeta_inva(b, x, p, policies::policy<>()); } -template -inline T ibetac_inva(T b, T x, T q) +template +inline typename tools::promote_args::type + ibetac_inva(RT1 b, RT2 x, RT3 q) { - return detail::ibeta_inv_ab_imp(b, x, 1 - q, q, false, policies::policy<>()); + return boost::math::ibetac_inva(b, x, q, policies::policy<>()); } -template -inline T ibeta_invb(T b, T x, T p) +template +inline typename tools::promote_args::type + ibeta_invb(RT1 a, RT2 x, RT3 p) { - return detail::ibeta_inv_ab_imp(b, x, p, 1 - p, true, policies::policy<>()); + return boost::math::ibeta_invb(a, x, p, policies::policy<>()); } -template -inline T ibetac_invb(T b, T x, T q) +template +inline typename tools::promote_args::type + ibetac_invb(RT1 a, RT2 x, RT3 q) { - return detail::ibeta_inv_ab_imp(b, x, 1 - q, q, true, policies::policy<>()); + return boost::math::ibetac_invb(a, x, q, policies::policy<>()); } } // namespace math diff --git a/include/boost/math/special_functions/math_fwd.hpp b/include/boost/math/special_functions/math_fwd.hpp index f4d607f53..0414ec066 100644 --- a/include/boost/math/special_functions/math_fwd.hpp +++ b/include/boost/math/special_functions/math_fwd.hpp @@ -595,16 +595,16 @@ namespace boost typename detail::bessel_traits >::result_type sph_neumann(unsigned v, T x); template - T sin_pi(T x, const Policy&); + typename tools::promote_args::type sin_pi(T x, const Policy&); template - T sin_pi(T x); + typename tools::promote_args::type sin_pi(T x); template - T cos_pi(T x, const Policy&); + typename tools::promote_args::type cos_pi(T x, const Policy&); template - T cos_pi(T x); + typename tools::promote_args::type cos_pi(T x); template int fpclassify BOOST_NO_MACRO_EXPAND(T t); @@ -898,10 +898,10 @@ namespace boost sph_neumann(unsigned v, T x){ return boost::math::sph_neumann(v, x, Policy()); }\ \ template \ - inline T sin_pi(T x){ return boost::math::sin_pi(x); }\ + inline typename boost::math::tools::promote_args::type sin_pi(T x){ return boost::math::sin_pi(x); }\ \ template \ - inline T cos_pi(T x){ return boost::math::cos_pi(x); }\ + inline typename boost::math::tools::promote_args::type cos_pi(T x){ return boost::math::cos_pi(x); }\ \ using boost::math::fpclassify;\ using boost::math::isfinite;\ diff --git a/include/boost/math/special_functions/sin_pi.hpp b/include/boost/math/special_functions/sin_pi.hpp index fb87fad30..c57177d8c 100644 --- a/include/boost/math/special_functions/sin_pi.hpp +++ b/include/boost/math/special_functions/sin_pi.hpp @@ -9,12 +9,13 @@ #include #include #include +#include #include -namespace boost{ namespace math{ +namespace boost{ namespace math{ namespace detail{ template -T sin_pi(T x) +T sin_pi_imp(T x) { BOOST_MATH_STD_USING // ADL of std names // sin of pi*x: @@ -42,10 +43,20 @@ T sin_pi(T x) return invert ? -rem : rem; } +} + template -inline T sin_pi(T x, const Policy&) +inline typename tools::promote_args::type sin_pi(T x, const Policy&) { - return boost::math::sin_pi(x); + typedef typename tools::promote_args::type result_type; + return boost::math::detail::sin_pi_imp(x); +} + +template +inline typename tools::promote_args::type sin_pi(T x) +{ + typedef typename tools::promote_args::type result_type; + return boost::math::detail::sin_pi_imp(x); } } // namespace math diff --git a/include/boost/math/special_functions/sinc.hpp b/include/boost/math/special_functions/sinc.hpp index 19b843d61..50788edc8 100644 --- a/include/boost/math/special_functions/sinc.hpp +++ b/include/boost/math/special_functions/sinc.hpp @@ -48,7 +48,7 @@ namespace boost template inline T sinc_pi_imp(const T x) { -#ifdef BOOST_NO_STDC_NAMESPACE +#if defined(BOOST_NO_STDC_NAMESPACE) && !defined(__SUNPRO_CC) using ::abs; using ::sin; using ::sqrt; diff --git a/include/boost/math/special_functions/sinhc.hpp b/include/boost/math/special_functions/sinhc.hpp index 2b839c7d9..f5bde4ce9 100644 --- a/include/boost/math/special_functions/sinhc.hpp +++ b/include/boost/math/special_functions/sinhc.hpp @@ -47,7 +47,7 @@ namespace boost template inline T sinhc_pi_imp(const T x) { -#ifdef BOOST_NO_STDC_NAMESPACE +#if defined(BOOST_NO_STDC_NAMESPACE) && !defined(__SUNPRO_CC) using ::abs; using ::sinh; using ::sqrt; diff --git a/include/boost/math/tools/config.hpp b/include/boost/math/tools/config.hpp index 86f4f54f1..9a01672c9 100644 --- a/include/boost/math/tools/config.hpp +++ b/include/boost/math/tools/config.hpp @@ -55,6 +55,10 @@ # define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS #endif +#ifdef __IBMCPP__ +# define BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS +#endif + #if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) || BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) # include "boost/type.hpp" diff --git a/test/compile_test/instantiate.hpp b/test/compile_test/instantiate.hpp index 982e58acd..dad66eb3e 100644 --- a/test/compile_test/instantiate.hpp +++ b/test/compile_test/instantiate.hpp @@ -141,7 +141,7 @@ void instantiate(RealType) (boost::math::isfinite)(v1); (boost::math::isnormal)(v1); (boost::math::isnan)(v1); - boost::math::isinf(v1); + (boost::math::isinf)(v1); boost::math::log1p(v1); boost::math::expm1(v1); boost::math::cbrt(v1); @@ -382,5 +382,357 @@ void instantiate(RealType) test::sph_neumann(i, i); } +template +void instantiate_mixed(RealType) +{ + using namespace boost; + using namespace boost::math; + + int i = 1; + long l = 1; + short s = 1; + float fr = 0.5F; + double dr = 0.5; + long double lr = 0.5L; + + boost::math::tgamma(i); + boost::math::tgamma1pm1(i); + boost::math::lgamma(i); + boost::math::lgamma(i, &i); + boost::math::digamma(i); + boost::math::tgamma_ratio(i, l); + boost::math::tgamma_ratio(fr, lr); + boost::math::tgamma_delta_ratio(i, s); + boost::math::tgamma_delta_ratio(fr, lr); + boost::math::rising_factorial(s, i); + boost::math::falling_factorial(s, i); + boost::math::tgamma(i, l); + boost::math::tgamma(fr, lr); + boost::math::tgamma_lower(i, s); + boost::math::tgamma_lower(fr, lr); + boost::math::gamma_p(i, s); + boost::math::gamma_p(fr, lr); + boost::math::gamma_q(i, s); + boost::math::gamma_q(fr, lr); + boost::math::gamma_p_inv(i, fr); + boost::math::gamma_q_inv(s, fr); + boost::math::gamma_p_inva(i, lr); + boost::math::gamma_q_inva(i, lr); + boost::math::erf(i); + boost::math::erfc(i); + boost::math::erf_inv(i); + boost::math::erfc_inv(i); + boost::math::beta(i, s); + boost::math::beta(fr, lr); + boost::math::beta(i, s, l); + boost::math::beta(fr, dr, lr); + boost::math::betac(l, i, s); + boost::math::betac(fr, dr, lr); + boost::math::ibeta(l, i, s); + boost::math::ibeta(fr, dr, lr); + boost::math::ibetac(l, i, s); + boost::math::ibetac(fr, dr, lr); + boost::math::ibeta_inv(l, s, i); + boost::math::ibeta_inv(fr, dr, lr); + boost::math::ibetac_inv(l, i, s); + boost::math::ibetac_inv(fr, dr, lr); + boost::math::ibeta_inva(l, i, s); + boost::math::ibeta_inva(fr, dr, lr); + boost::math::ibetac_inva(l, i, s); + boost::math::ibetac_inva(fr, dr, lr); + boost::math::ibeta_invb(l, i, s); + boost::math::ibeta_invb(fr, dr, lr); + boost::math::ibetac_invb(l, i, s); + boost::math::ibetac_invb(fr, dr, lr); + boost::math::gamma_p_derivative(i, l); + boost::math::gamma_p_derivative(fr, lr); + boost::math::ibeta_derivative(l, i, s); + boost::math::ibeta_derivative(fr, dr, lr); + (boost::math::fpclassify)(i); + (boost::math::isfinite)(s); + (boost::math::isnormal)(l); + (boost::math::isnan)(i); + (boost::math::isinf)(l); + boost::math::log1p(i); + boost::math::expm1(s); + boost::math::cbrt(l); + boost::math::sqrt1pm1(s); + boost::math::powm1(i, s); + boost::math::powm1(fr, lr); + //boost::math::legendre_p(1, i); + boost::math::legendre_p(1, 0, s); + boost::math::legendre_q(1, i); + boost::math::laguerre(1, i); + boost::math::laguerre(2, 1, i); + boost::math::laguerre(2u, 1u, s); + boost::math::hermite(1, s); + boost::math::spherical_harmonic_r(2, 1, s, i); + boost::math::spherical_harmonic_i(2, 1, fr, lr); + boost::math::ellint_1(i); + boost::math::ellint_1(i, s); + boost::math::ellint_1(fr, lr); + boost::math::ellint_2(i); + boost::math::ellint_2(i, l); + boost::math::ellint_2(fr, lr); + boost::math::ellint_3(i, l); + boost::math::ellint_3(fr, lr); + boost::math::ellint_3(s, l, i); + boost::math::ellint_3(fr, dr, lr); + boost::math::ellint_rc(i, s); + boost::math::ellint_rc(fr, lr); + boost::math::ellint_rd(s, i, l); + boost::math::ellint_rd(fr, lr, dr); + boost::math::ellint_rf(s, l, i); + boost::math::ellint_rf(fr, dr, lr); + boost::math::ellint_rj(i, i, s, l); + boost::math::ellint_rj(i, fr, dr, lr); + boost::math::hypot(i, s); + boost::math::hypot(fr, lr); + boost::math::sinc_pi(i); + boost::math::sinhc_pi(i); + boost::math::asinh(s); + boost::math::acosh(l); + boost::math::atanh(l); + boost::math::sin_pi(s); + boost::math::cos_pi(s); + boost::math::cyl_neumann(fr, dr); + boost::math::cyl_neumann(i, s); + boost::math::cyl_bessel_j(fr, lr); + boost::math::cyl_bessel_j(i, s); + boost::math::cyl_bessel_i(fr, lr); + boost::math::cyl_bessel_i(i, s); + boost::math::cyl_bessel_k(fr, lr); + boost::math::cyl_bessel_k(i, s); + boost::math::sph_bessel(i, fr); + boost::math::sph_bessel(i, 1); + boost::math::sph_neumann(i, lr); + boost::math::sph_neumann(i, i); + + boost::math::policies::policy<> pol; + + + boost::math::tgamma(i, pol); + boost::math::tgamma1pm1(i, pol); + boost::math::lgamma(i, pol); + boost::math::lgamma(i, &i, pol); + boost::math::digamma(i, pol); + boost::math::tgamma_ratio(i, l, pol); + boost::math::tgamma_ratio(fr, lr, pol); + boost::math::tgamma_delta_ratio(i, s, pol); + boost::math::tgamma_delta_ratio(fr, lr, pol); + boost::math::rising_factorial(s, i, pol); + boost::math::falling_factorial(s, i, pol); + boost::math::tgamma(i, l, pol); + boost::math::tgamma(fr, lr, pol); + boost::math::tgamma_lower(i, s, pol); + boost::math::tgamma_lower(fr, lr, pol); + boost::math::gamma_p(i, s, pol); + boost::math::gamma_p(fr, lr, pol); + boost::math::gamma_q(i, s, pol); + boost::math::gamma_q(fr, lr, pol); + boost::math::gamma_p_inv(i, fr, pol); + boost::math::gamma_q_inv(s, fr, pol); + boost::math::gamma_p_inva(i, lr, pol); + boost::math::gamma_q_inva(i, lr, pol); + boost::math::erf(i, pol); + boost::math::erfc(i, pol); + boost::math::erf_inv(i, pol); + boost::math::erfc_inv(i, pol); + boost::math::beta(i, s, pol); + boost::math::beta(fr, lr, pol); + boost::math::beta(i, s, l, pol); + boost::math::beta(fr, dr, lr, pol); + boost::math::betac(l, i, s, pol); + boost::math::betac(fr, dr, lr, pol); + boost::math::ibeta(l, i, s, pol); + boost::math::ibeta(fr, dr, lr, pol); + boost::math::ibetac(l, i, s, pol); + boost::math::ibetac(fr, dr, lr, pol); + boost::math::ibeta_inv(l, s, i, pol); + boost::math::ibeta_inv(fr, dr, lr, pol); + boost::math::ibetac_inv(l, i, s, pol); + boost::math::ibetac_inv(fr, dr, lr, pol); + boost::math::ibeta_inva(l, i, s, pol); + boost::math::ibeta_inva(fr, dr, lr, pol); + boost::math::ibetac_inva(l, i, s, pol); + boost::math::ibetac_inva(fr, dr, lr, pol); + boost::math::ibeta_invb(l, i, s, pol); + boost::math::ibeta_invb(fr, dr, lr, pol); + boost::math::ibetac_invb(l, i, s, pol); + boost::math::ibetac_invb(fr, dr, lr, pol); + boost::math::gamma_p_derivative(i, l, pol); + boost::math::gamma_p_derivative(fr, lr, pol); + boost::math::ibeta_derivative(l, i, s, pol); + boost::math::ibeta_derivative(fr, dr, lr, pol); + boost::math::log1p(i, pol); + boost::math::expm1(s, pol); + boost::math::cbrt(l, pol); + boost::math::sqrt1pm1(s, pol); + boost::math::powm1(i, s, pol); + boost::math::powm1(fr, lr, pol); + //boost::math::legendre_p(1, i, pol); + boost::math::legendre_p(1, 0, s, pol); + boost::math::legendre_q(1, i, pol); + boost::math::laguerre(1, i, pol); + boost::math::laguerre(2, 1, i, pol); + boost::math::laguerre(2u, 1u, s, pol); + boost::math::hermite(1, s, pol); + boost::math::spherical_harmonic_r(2, 1, s, i, pol); + boost::math::spherical_harmonic_i(2, 1, fr, lr, pol); + boost::math::ellint_1(i, pol); + boost::math::ellint_1(i, s, pol); + boost::math::ellint_1(fr, lr, pol); + boost::math::ellint_2(i, pol); + boost::math::ellint_2(i, l, pol); + boost::math::ellint_2(fr, lr, pol); + boost::math::ellint_3(i, l, pol); + boost::math::ellint_3(fr, lr, pol); + boost::math::ellint_3(s, l, i, pol); + boost::math::ellint_3(fr, dr, lr, pol); + boost::math::ellint_rc(i, s, pol); + boost::math::ellint_rc(fr, lr, pol); + boost::math::ellint_rd(s, i, l, pol); + boost::math::ellint_rd(fr, lr, dr, pol); + boost::math::ellint_rf(s, l, i, pol); + boost::math::ellint_rf(fr, dr, lr, pol); + boost::math::ellint_rj(i, i, s, l, pol); + boost::math::ellint_rj(i, fr, dr, lr, pol); + boost::math::hypot(i, s, pol); + boost::math::hypot(fr, lr, pol); + boost::math::sinc_pi(i, pol); + boost::math::sinhc_pi(i, pol); + boost::math::asinh(s, pol); + boost::math::acosh(l, pol); + boost::math::atanh(l, pol); + boost::math::sin_pi(s, pol); + boost::math::cos_pi(s, pol); + boost::math::cyl_neumann(fr, dr, pol); + boost::math::cyl_neumann(i, s, pol); + boost::math::cyl_bessel_j(fr, lr, pol); + boost::math::cyl_bessel_j(i, s, pol); + boost::math::cyl_bessel_i(fr, lr, pol); + boost::math::cyl_bessel_i(i, s, pol); + boost::math::cyl_bessel_k(fr, lr, pol); + boost::math::cyl_bessel_k(i, s, pol); + boost::math::sph_bessel(i, fr, pol); + boost::math::sph_bessel(i, 1, pol); + boost::math::sph_neumann(i, lr, pol); + boost::math::sph_neumann(i, i, pol); + + + test::tgamma(i); + test::tgamma1pm1(i); + test::lgamma(i); + test::lgamma(i, &i); + test::digamma(i); + test::tgamma_ratio(i, l); + test::tgamma_ratio(fr, lr); + test::tgamma_delta_ratio(i, s); + test::tgamma_delta_ratio(fr, lr); + test::rising_factorial(s, i); + test::falling_factorial(s, i); + test::tgamma(i, l); + test::tgamma(fr, lr); + test::tgamma_lower(i, s); + test::tgamma_lower(fr, lr); + test::gamma_p(i, s); + test::gamma_p(fr, lr); + test::gamma_q(i, s); + test::gamma_q(fr, lr); + test::gamma_p_inv(i, fr); + test::gamma_q_inv(s, fr); + test::gamma_p_inva(i, lr); + test::gamma_q_inva(i, lr); + test::erf(i); + test::erfc(i); + test::erf_inv(i); + test::erfc_inv(i); + test::beta(i, s); + test::beta(fr, lr); + test::beta(i, s, l); + test::beta(fr, dr, lr); + test::betac(l, i, s); + test::betac(fr, dr, lr); + test::ibeta(l, i, s); + test::ibeta(fr, dr, lr); + test::ibetac(l, i, s); + test::ibetac(fr, dr, lr); + test::ibeta_inv(l, s, i); + test::ibeta_inv(fr, dr, lr); + test::ibetac_inv(l, i, s); + test::ibetac_inv(fr, dr, lr); + test::ibeta_inva(l, i, s); + test::ibeta_inva(fr, dr, lr); + test::ibetac_inva(l, i, s); + test::ibetac_inva(fr, dr, lr); + test::ibeta_invb(l, i, s); + test::ibeta_invb(fr, dr, lr); + test::ibetac_invb(l, i, s); + test::ibetac_invb(fr, dr, lr); + test::gamma_p_derivative(i, l); + test::gamma_p_derivative(fr, lr); + test::ibeta_derivative(l, i, s); + test::ibeta_derivative(fr, dr, lr); + (test::fpclassify)(i); + (test::isfinite)(s); + (test::isnormal)(l); + (test::isnan)(i); + (test::isinf)(l); + test::log1p(i); + test::expm1(s); + test::cbrt(l); + test::sqrt1pm1(s); + test::powm1(i, s); + test::powm1(fr, lr); + //test::legendre_p(1, i); + test::legendre_p(1, 0, s); + test::legendre_q(1, i); + test::laguerre(1, i); + test::laguerre(2, 1, i); + test::laguerre(2u, 1u, s); + test::hermite(1, s); + test::spherical_harmonic_r(2, 1, s, i); + test::spherical_harmonic_i(2, 1, fr, lr); + test::ellint_1(i); + test::ellint_1(i, s); + test::ellint_1(fr, lr); + test::ellint_2(i); + test::ellint_2(i, l); + test::ellint_2(fr, lr); + test::ellint_3(i, l); + test::ellint_3(fr, lr); + test::ellint_3(s, l, i); + test::ellint_3(fr, dr, lr); + test::ellint_rc(i, s); + test::ellint_rc(fr, lr); + test::ellint_rd(s, i, l); + test::ellint_rd(fr, lr, dr); + test::ellint_rf(s, l, i); + test::ellint_rf(fr, dr, lr); + test::ellint_rj(i, i, s, l); + test::ellint_rj(i, fr, dr, lr); + test::hypot(i, s); + test::hypot(fr, lr); + test::sinc_pi(i); + test::sinhc_pi(i); + test::asinh(s); + test::acosh(l); + test::atanh(l); + test::sin_pi(s); + test::cos_pi(s); + test::cyl_neumann(fr, dr); + test::cyl_neumann(i, s); + test::cyl_bessel_j(fr, lr); + test::cyl_bessel_j(i, s); + test::cyl_bessel_i(fr, lr); + test::cyl_bessel_i(i, s); + test::cyl_bessel_k(fr, lr); + test::cyl_bessel_k(i, s); + test::sph_bessel(i, fr); + test::sph_bessel(i, 1); + test::sph_neumann(i, lr); + test::sph_neumann(i, i); +} + #endif // BOOST_LIBS_MATH_TEST_INSTANTIATE_HPP diff --git a/test/log1p_expm1_test.cpp b/test/log1p_expm1_test.cpp index 6e4659b84..55886f5fa 100644 --- a/test/log1p_expm1_test.cpp +++ b/test/log1p_expm1_test.cpp @@ -78,7 +78,11 @@ void do_test(const T& data, const char* type_name, const char* test_name) // // test log1p against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::log1p; +#else funcp = &boost::math::log1p; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0), @@ -88,7 +92,11 @@ void do_test(const T& data, const char* type_name, const char* test_name) // // test expm1 against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::expm1; +#else funcp = boost::math::expm1; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0), diff --git a/test/test_bessel_i.cpp b/test/test_bessel_i.cpp index 1feeeef86..0a49128e0 100644 --- a/test/test_bessel_i.cpp +++ b/test/test_bessel_i.cpp @@ -113,7 +113,11 @@ void do_test_cyl_bessel_i(const T& data, const char* type_name, const char* test typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::cyl_bessel_i; +#else pg funcp = boost::math::cyl_bessel_i; +#endif boost::math::tools::test_result result; @@ -157,7 +161,11 @@ void do_test_cyl_bessel_i_int(const T& data, const char* type_name, const char* typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = cyl_bessel_i_int_wrapper; +#else pg funcp = cyl_bessel_i_int_wrapper; +#endif boost::math::tools::test_result result; diff --git a/test/test_bessel_j.cpp b/test/test_bessel_j.cpp index 1d607ceed..3955e18cc 100644 --- a/test/test_bessel_j.cpp +++ b/test/test_bessel_j.cpp @@ -292,7 +292,11 @@ void do_test_cyl_bessel_j(const T& data, const char* type_name, const char* test typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::cyl_bessel_j; +#else pg funcp = boost::math::cyl_bessel_j; +#endif boost::math::tools::test_result result; @@ -341,7 +345,11 @@ void do_test_cyl_bessel_j_int(const T& data, const char* type_name, const char* typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = cyl_bessel_j_int_wrapper; +#else pg funcp = cyl_bessel_j_int_wrapper; +#endif boost::math::tools::test_result result; @@ -366,7 +374,11 @@ void do_test_sph_bessel_j(const T& data, const char* type_name, const char* test typedef typename row_type::value_type value_type; typedef value_type (*pg)(unsigned, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::sph_bessel; +#else pg funcp = boost::math::sph_bessel; +#endif typedef int (*cast_t)(value_type); diff --git a/test/test_bessel_k.cpp b/test/test_bessel_k.cpp index b46b60879..3f7c286cb 100644 --- a/test/test_bessel_k.cpp +++ b/test/test_bessel_k.cpp @@ -110,7 +110,11 @@ void do_test_cyl_bessel_k(const T& data, const char* type_name, const char* test typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::cyl_bessel_k; +#else pg funcp = boost::math::cyl_bessel_k; +#endif boost::math::tools::test_result result; @@ -152,7 +156,11 @@ void do_test_cyl_bessel_k_int(const T& data, const char* type_name, const char* typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = cyl_bessel_k_int_wrapper; +#else pg funcp = cyl_bessel_k_int_wrapper; +#endif boost::math::tools::test_result result; diff --git a/test/test_bessel_y.cpp b/test/test_bessel_y.cpp index e6c0fa5b1..138d1daa2 100644 --- a/test/test_bessel_y.cpp +++ b/test/test_bessel_y.cpp @@ -251,7 +251,11 @@ void do_test_cyl_neumann_y(const T& data, const char* type_name, const char* tes typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::cyl_neumann; +#else pg funcp = boost::math::cyl_neumann; +#endif boost::math::tools::test_result result; @@ -299,7 +303,11 @@ void do_test_cyl_neumann_y_int(const T& data, const char* type_name, const char* typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = cyl_neumann_int_wrapper; +#else pg funcp = cyl_neumann_int_wrapper; +#endif boost::math::tools::test_result result; @@ -324,7 +332,11 @@ void do_test_sph_neumann_y(const T& data, const char* type_name, const char* tes typedef typename row_type::value_type value_type; typedef value_type (*pg)(unsigned, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::sph_neumann; +#else pg funcp = boost::math::sph_neumann; +#endif typedef int (*cast_t)(value_type); diff --git a/test/test_beta.cpp b/test/test_beta.cpp index 482a7e085..aa9ce1482 100644 --- a/test/test_beta.cpp +++ b/test/test_beta.cpp @@ -117,7 +117,11 @@ void do_test_beta(const T& data, const char* type_name, const char* test_name) typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::beta; +#else pg funcp = boost::math::beta; +#endif boost::math::tools::test_result result; diff --git a/test/test_binomial_coeff.cpp b/test/test_binomial_coeff.cpp index 69e4759cf..f8557a4f8 100644 --- a/test/test_binomial_coeff.cpp +++ b/test/test_binomial_coeff.cpp @@ -104,7 +104,11 @@ void test_binomial(T, const char* type_name) using namespace std; typedef T (*func_t)(T, T); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + func_t f = &binomial_wrapper; +#else func_t f = &binomial_wrapper; +#endif #include "binomial_data.ipp" diff --git a/test/test_carlson.cpp b/test/test_carlson.cpp index f414c3f8e..f29ca77d1 100644 --- a/test/test_carlson.cpp +++ b/test/test_carlson.cpp @@ -129,7 +129,11 @@ void do_test_ellint_rf(T& data, const char* type_name, const char* test) std::cout << "Testing: " << test << std::endl; +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + value_type (*fp)(value_type, value_type, value_type) = boost::math::ellint_rf; +#else value_type (*fp)(value_type, value_type, value_type) = boost::math::ellint_rf; +#endif boost::math::tools::test_result result; result = boost::math::tools::test( @@ -151,7 +155,11 @@ void do_test_ellint_rc(T& data, const char* type_name, const char* test) std::cout << "Testing: " << test << std::endl; +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + value_type (*fp)(value_type, value_type) = boost::math::ellint_rc; +#else value_type (*fp)(value_type, value_type) = boost::math::ellint_rc; +#endif boost::math::tools::test_result result; result = boost::math::tools::test( @@ -173,7 +181,11 @@ void do_test_ellint_rj(T& data, const char* type_name, const char* test) std::cout << "Testing: " << test << std::endl; +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + value_type (*fp)(value_type, value_type, value_type, value_type) = boost::math::ellint_rj; +#else value_type (*fp)(value_type, value_type, value_type, value_type) = boost::math::ellint_rj; +#endif boost::math::tools::test_result result; result = boost::math::tools::test( @@ -195,7 +207,11 @@ void do_test_ellint_rd(T& data, const char* type_name, const char* test) std::cout << "Testing: " << test << std::endl; +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + value_type (*fp)(value_type, value_type, value_type) = boost::math::ellint_rd; +#else value_type (*fp)(value_type, value_type, value_type) = boost::math::ellint_rd; +#endif boost::math::tools::test_result result; result = boost::math::tools::test( diff --git a/test/test_cbrt.cpp b/test/test_cbrt.cpp index 384934693..adc30da5c 100644 --- a/test/test_cbrt.cpp +++ b/test/test_cbrt.cpp @@ -77,7 +77,11 @@ void do_test_cbrt(const T& data, const char* type_name, const char* test_name) typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::cbrt; +#else pg funcp = boost::math::cbrt; +#endif boost::math::tools::test_result result; diff --git a/test/test_digamma.cpp b/test/test_digamma.cpp index 455665e19..035b94496 100644 --- a/test/test_digamma.cpp +++ b/test/test_digamma.cpp @@ -70,7 +70,11 @@ void do_test_digamma(const T& data, const char* type_name, const char* test_name typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::digamma; +#else pg funcp = boost::math::digamma; +#endif boost::math::tools::test_result result; diff --git a/test/test_ellint_1.cpp b/test/test_ellint_1.cpp index 92a574e4b..e99a18902 100644 --- a/test/test_ellint_1.cpp +++ b/test/test_ellint_1.cpp @@ -97,7 +97,11 @@ void do_test_ellint_f(T& data, const char* type_name, const char* test) std::cout << "Testing: " << test << std::endl; +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + value_type (*fp2)(value_type, value_type) = boost::math::ellint_1; +#else value_type (*fp2)(value_type, value_type) = boost::math::ellint_1; +#endif boost::math::tools::test_result result; result = boost::math::tools::test( @@ -120,7 +124,11 @@ void do_test_ellint_k(T& data, const char* type_name, const char* test) std::cout << "Testing: " << test << std::endl; +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + value_type (*fp1)(value_type) = boost::math::ellint_1; +#else value_type (*fp1)(value_type) = boost::math::ellint_1; +#endif result = boost::math::tools::test( data, bind_func(fp1, 0), diff --git a/test/test_ellint_2.cpp b/test/test_ellint_2.cpp index 7dd848aaf..55a93b8d8 100644 --- a/test/test_ellint_2.cpp +++ b/test/test_ellint_2.cpp @@ -97,7 +97,11 @@ void do_test_ellint_e2(const T& data, const char* type_name, const char* test) std::cout << "Testing: " << test << std::endl; +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + value_type (*fp2)(value_type, value_type) = boost::math::ellint_2; +#else value_type (*fp2)(value_type, value_type) = boost::math::ellint_2; +#endif boost::math::tools::test_result result; result = boost::math::tools::test( @@ -119,7 +123,11 @@ void do_test_ellint_e1(T& data, const char* type_name, const char* test) std::cout << "Testing: " << test << std::endl; +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + value_type (*fp1)(value_type) = boost::math::ellint_2; +#else value_type (*fp1)(value_type) = boost::math::ellint_2; +#endif result = boost::math::tools::test( data, bind_func(fp1, 0), diff --git a/test/test_ellint_3.cpp b/test/test_ellint_3.cpp index 8fb86c534..006f41ead 100644 --- a/test/test_ellint_3.cpp +++ b/test/test_ellint_3.cpp @@ -110,7 +110,11 @@ void do_test_ellint_pi3(T& data, const char* type_name, const char* test) std::cout << "Testing: " << test << std::endl; +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + value_type (*fp2)(value_type, value_type, value_type) = boost::math::ellint_3; +#else value_type (*fp2)(value_type, value_type, value_type) = boost::math::ellint_3; +#endif boost::math::tools::test_result result; result = boost::math::tools::test( @@ -132,7 +136,11 @@ void do_test_ellint_pi2(T& data, const char* type_name, const char* test) std::cout << "Testing: " << test << std::endl; +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + value_type (*fp2)(value_type, value_type) = boost::math::ellint_3; +#else value_type (*fp2)(value_type, value_type) = boost::math::ellint_3; +#endif boost::math::tools::test_result result; result = boost::math::tools::test( diff --git a/test/test_erf.cpp b/test/test_erf.cpp index eece7fe6d..0cac1a7de 100644 --- a/test/test_erf.cpp +++ b/test/test_erf.cpp @@ -138,7 +138,11 @@ void do_test_erf(const T& data, const char* type_name, const char* test_name) typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::erf; +#else pg funcp = boost::math::erf; +#endif boost::math::tools::test_result result; @@ -166,7 +170,11 @@ void do_test_erf(const T& data, const char* type_name, const char* test_name) // // test erfc against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::erfc; +#else funcp = boost::math::erfc; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0), @@ -200,7 +208,11 @@ void do_test_erf_inv(const T& data, const char* type_name, const char* test_name // // test erf_inv against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::erf_inv; +#else funcp = boost::math::erf_inv; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0), @@ -224,7 +236,11 @@ void do_test_erfc_inv(const T& data, const char* type_name, const char* test_nam // // test erfc_inv against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::erfc_inv; +#else funcp = boost::math::erfc_inv; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0), diff --git a/test/test_gamma.cpp b/test/test_gamma.cpp index 876a08da3..f5801084d 100644 --- a/test/test_gamma.cpp +++ b/test/test_gamma.cpp @@ -299,7 +299,11 @@ void do_test_gamma(const T& data, const char* type_name, const char* test_name) typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::tgamma; +#else pg funcp = boost::math::tgamma; +#endif boost::math::tools::test_result result; @@ -327,7 +331,11 @@ void do_test_gamma(const T& data, const char* type_name, const char* test_name) // // test lgamma against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::lgamma; +#else funcp = boost::math::lgamma; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0), @@ -354,7 +362,11 @@ void do_test_gammap1m1(const T& data, const char* type_name, const char* test_na typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::tgamma1pm1; +#else pg funcp = boost::math::tgamma1pm1; +#endif boost::math::tools::test_result result; diff --git a/test/test_hermite.cpp b/test/test_hermite.cpp index 6c9212eaa..6e207376b 100644 --- a/test/test_hermite.cpp +++ b/test/test_hermite.cpp @@ -99,7 +99,11 @@ void do_test_hermite(const T& data, const char* type_name, const char* test_name typedef typename row_type::value_type value_type; typedef value_type (*pg)(unsigned, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::hermite; +#else pg funcp = boost::math::hermite; +#endif typedef unsigned (*cast_t)(value_type); diff --git a/test/test_ibeta.cpp b/test/test_ibeta.cpp index d480c2dcc..40a4611f7 100644 --- a/test/test_ibeta.cpp +++ b/test/test_ibeta.cpp @@ -289,7 +289,11 @@ void do_test_beta(const T& data, const char* type_name, const char* test_name) typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::beta; +#else pg funcp = boost::math::beta; +#endif boost::math::tools::test_result result; @@ -305,21 +309,33 @@ void do_test_beta(const T& data, const char* type_name, const char* test_name) extract_result(3)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::beta", test_name); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::betac; +#else funcp = boost::math::betac; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1, 2), extract_result(4)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::betac", test_name); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::ibeta; +#else funcp = boost::math::ibeta; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1, 2), extract_result(5)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ibeta", test_name); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::ibetac; +#else funcp = boost::math::ibetac; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1, 2), diff --git a/test/test_ibeta_inv.cpp b/test/test_ibeta_inv.cpp index fc6ab19c6..fb6a3705c 100644 --- a/test/test_ibeta_inv.cpp +++ b/test/test_ibeta_inv.cpp @@ -234,7 +234,11 @@ void test_inverses2(const T& data, const char* type_name, const char* test_name) typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::ibeta_inv; +#else pg funcp = boost::math::ibeta_inv; +#endif boost::math::tools::test_result result; @@ -252,7 +256,11 @@ void test_inverses2(const T& data, const char* type_name, const char* test_name) // // test ibetac_inv(T, T, T) against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::ibetac_inv; +#else funcp = boost::math::ibetac_inv; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1, 2), diff --git a/test/test_ibeta_inv_ab.cpp b/test/test_ibeta_inv_ab.cpp index cd0bf5954..3110e41bd 100644 --- a/test/test_ibeta_inv_ab.cpp +++ b/test/test_ibeta_inv_ab.cpp @@ -3,6 +3,8 @@ // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error + #include #include #include @@ -181,7 +183,11 @@ void test_inverses2(const T& data, const char* type_name, const char* test_name) typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::ibeta_inva; +#else pg funcp = boost::math::ibeta_inva; +#endif boost::math::tools::test_result result; @@ -199,7 +205,11 @@ void test_inverses2(const T& data, const char* type_name, const char* test_name) // // test ibetac_inva(T, T, T) against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::ibetac_inva; +#else funcp = boost::math::ibetac_inva; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1, 2), @@ -208,7 +218,11 @@ void test_inverses2(const T& data, const char* type_name, const char* test_name) // // test ibeta_invb(T, T, T) against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::ibeta_invb; +#else funcp = boost::math::ibeta_invb; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1, 2), @@ -217,7 +231,11 @@ void test_inverses2(const T& data, const char* type_name, const char* test_name) // // test ibetac_invb(T, T, T) against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::ibetac_invb; +#else funcp = boost::math::ibetac_invb; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1, 2), @@ -295,6 +313,3 @@ int test_main(int, char* []) return 0; } - - - diff --git a/test/test_igamma.cpp b/test/test_igamma.cpp index 7e4afb674..2940ca09e 100644 --- a/test/test_igamma.cpp +++ b/test/test_igamma.cpp @@ -311,7 +311,11 @@ void do_test_gamma_2(const T& data, const char* type_name, const char* test_name typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::tgamma; +#else pg funcp = boost::math::tgamma; +#endif boost::math::tools::test_result result; @@ -331,7 +335,11 @@ void do_test_gamma_2(const T& data, const char* type_name, const char* test_name // // test tgamma_lower(T, T) against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::tgamma_lower; +#else funcp = boost::math::tgamma_lower; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1), @@ -341,7 +349,11 @@ void do_test_gamma_2(const T& data, const char* type_name, const char* test_name // // test gamma_q(T, T) against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::gamma_q; +#else funcp = boost::math::gamma_q; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1), @@ -364,7 +376,11 @@ void do_test_gamma_2(const T& data, const char* type_name, const char* test_name // // test gamma_p(T, T) against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::gamma_p; +#else funcp = boost::math::gamma_p; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1), diff --git a/test/test_igamma_inv.cpp b/test/test_igamma_inv.cpp index bafe585a5..a9530ddee 100644 --- a/test/test_igamma_inv.cpp +++ b/test/test_igamma_inv.cpp @@ -279,7 +279,11 @@ void do_test_gamma_inv(const T& data, const char* type_name, const char* test_na typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::gamma_p_inv; +#else pg funcp = boost::math::gamma_p_inv; +#endif boost::math::tools::test_result result; @@ -297,7 +301,11 @@ void do_test_gamma_inv(const T& data, const char* type_name, const char* test_na // // test gamma_q_inv(T, T) against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::gamma_q_inv; +#else funcp = boost::math::gamma_q_inv; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1), diff --git a/test/test_igamma_inva.cpp b/test/test_igamma_inva.cpp index fbccd28b6..dba5eddaf 100644 --- a/test/test_igamma_inva.cpp +++ b/test/test_igamma_inva.cpp @@ -3,6 +3,8 @@ // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error + #include #include #include @@ -205,7 +207,11 @@ void do_test_gamma_inva(const T& data, const char* type_name, const char* test_n typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::gamma_p_inva; +#else pg funcp = boost::math::gamma_p_inva; +#endif boost::math::tools::test_result result; @@ -223,7 +229,11 @@ void do_test_gamma_inva(const T& data, const char* type_name, const char* test_n // // test gamma_q_inva(T, T) against data: // +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::gamma_q_inva; +#else funcp = boost::math::gamma_q_inva; +#endif result = boost::math::tools::test( data, bind_func(funcp, 0, 1), diff --git a/test/test_instantiate1.cpp b/test/test_instantiate1.cpp index 59e665681..ab45fa1a6 100644 --- a/test/test_instantiate1.cpp +++ b/test/test_instantiate1.cpp @@ -12,6 +12,7 @@ int main(int argc, char* []) if(argc > 10000) { instantiate(double(0)); + instantiate_mixed(double(0)); other_test(); } } diff --git a/test/test_instantiate2.cpp b/test/test_instantiate2.cpp index 7bd60bb63..6996636a6 100644 --- a/test/test_instantiate2.cpp +++ b/test/test_instantiate2.cpp @@ -8,6 +8,7 @@ void other_test() { instantiate(double(0)); + instantiate_mixed(double(0)); } diff --git a/test/test_laguerre.cpp b/test/test_laguerre.cpp index 61ffc4880..10b045187 100644 --- a/test/test_laguerre.cpp +++ b/test/test_laguerre.cpp @@ -137,7 +137,11 @@ void do_test_laguerre2(const T& data, const char* type_name, const char* test_na typedef typename row_type::value_type value_type; typedef value_type (*pg)(unsigned, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::laguerre; +#else pg funcp = boost::math::laguerre; +#endif boost::math::tools::test_result result; @@ -163,7 +167,11 @@ void do_test_laguerre3(const T& data, const char* type_name, const char* test_na typedef typename row_type::value_type value_type; typedef value_type (*pg)(unsigned, unsigned, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::laguerre; +#else pg funcp = boost::math::laguerre; +#endif boost::math::tools::test_result result; diff --git a/test/test_legendre.cpp b/test/test_legendre.cpp index 38f930a0a..3a2d2f046 100644 --- a/test/test_legendre.cpp +++ b/test/test_legendre.cpp @@ -193,7 +193,11 @@ void do_test_legendre_p(const T& data, const char* type_name, const char* test_n typedef typename row_type::value_type value_type; typedef value_type (*pg)(int, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::legendre_p; +#else pg funcp = boost::math::legendre_p; +#endif boost::math::tools::test_result result; @@ -220,7 +224,11 @@ void do_test_legendre_p(const T& data, const char* type_name, const char* test_n #endif typedef value_type (*pg2)(unsigned, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg2 funcp2 = boost::math::legendre_q; +#else pg2 funcp2 = boost::math::legendre_q; +#endif // // test legendre_q against data: @@ -252,7 +260,11 @@ void do_test_assoc_legendre_p(const T& data, const char* type_name, const char* typedef typename row_type::value_type value_type; typedef value_type (*pg)(int, int, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::legendre_p; +#else pg funcp = boost::math::legendre_p; +#endif boost::math::tools::test_result result; diff --git a/test/test_minima.cpp b/test/test_minima.cpp index e1cc16275..8d2b4a50b 100644 --- a/test/test_minima.cpp +++ b/test/test_minima.cpp @@ -29,11 +29,19 @@ void test_minima(T, const char* /* name */) BOOST_CHECK_CLOSE(m.second, T(4), T(0.001)); T (*fp)(T); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + fp = boost::math::lgamma; +#else fp = boost::math::lgamma; +#endif m = boost::math::tools::brent_find_minima(fp, T(0.5), T(10), 50); BOOST_CHECK_CLOSE(m.first, T(1.461632), T(0.1)); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + fp = boost::math::tgamma; +#else fp = boost::math::tgamma; +#endif m = boost::math::tools::brent_find_minima(fp, T(0.5), T(10), 50); BOOST_CHECK_CLOSE(m.first, T(1.461632), T(0.1)); } diff --git a/test/test_remez.cpp b/test/test_remez.cpp index 9c717b283..661217ccd 100644 --- a/test/test_remez.cpp +++ b/test/test_remez.cpp @@ -18,7 +18,11 @@ void test_polynomial() { +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + double (*f)(double) = boost::math::expm1; +#else double (*f)(double) = boost::math::expm1; +#endif std::cout << "Testing expm1 approximation, pinned to origin, abolute error, 6 term polynomial\n"; boost::math::tools::remez_minimax approx1(f, 6, 0, -1, 1, true, false); std::cout << "Interpolation Error: " << approx1.max_error() << std::endl; @@ -98,7 +102,11 @@ void test_polynomial() void test_rational() { +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + double (*f)(double) = boost::math::expm1; +#else double (*f)(double) = boost::math::expm1; +#endif std::cout << "Testing expm1 approximation, pinned to origin, abolute error, 3+3 term rational\n"; boost::math::tools::remez_minimax approx1(f, 3, 3, -1, 1, true, false); std::cout << "Interpolation Error: " << approx1.max_error() << std::endl; diff --git a/test/test_spherical_harmonic.cpp b/test/test_spherical_harmonic.cpp index c34e82ca9..3b68be35c 100644 --- a/test/test_spherical_harmonic.cpp +++ b/test/test_spherical_harmonic.cpp @@ -101,7 +101,11 @@ void do_test_spherical_harmonic(const T& data, const char* type_name, const char typedef typename row_type::value_type value_type; typedef value_type (*pg)(unsigned, int, value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::spherical_harmonic_r; +#else pg funcp = boost::math::spherical_harmonic_r; +#endif boost::math::tools::test_result result; @@ -117,7 +121,11 @@ void do_test_spherical_harmonic(const T& data, const char* type_name, const char extract_result(4)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::spherical_harmonic_r", test_name); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + funcp = boost::math::spherical_harmonic_i; +#else funcp = boost::math::spherical_harmonic_i; +#endif // // test Spheric Harmonic against data: // diff --git a/test/test_tgamma_ratio.cpp b/test/test_tgamma_ratio.cpp index d863fd930..4652cdd18 100644 --- a/test/test_tgamma_ratio.cpp +++ b/test/test_tgamma_ratio.cpp @@ -143,7 +143,11 @@ void do_test_tgamma_delta_ratio(const T& data, const char* type_name, const char typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::tgamma_delta_ratio; +#else pg funcp = boost::math::tgamma_delta_ratio; +#endif boost::math::tools::test_result result; @@ -172,7 +176,11 @@ void do_test_tgamma_ratio(const T& data, const char* type_name, const char* test typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::tgamma_ratio; +#else pg funcp = boost::math::tgamma_ratio; +#endif boost::math::tools::test_result result;