2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Added workarounds for IBM xlc C++: the compiler can't resolve an overloaded function template to a function pointer unless the template arguments are explicitly provided.

Fixed some bugs uncovered by the above workaround: some forward declarations didn't match the actual definition!
Hopefully fixed remaining Sun compiler issues: mostly fixed by above fixes anyway.

[SVN r41142]
This commit is contained in:
John Maddock
2007-11-16 11:30:43 +00:00
parent 5c7b465759
commit 605c55e00e
40 changed files with 860 additions and 56 deletions

View File

@@ -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<long double>(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)

View File

@@ -9,12 +9,13 @@
#include <cmath>
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/real_cast.hpp>
#include <boost/math/tools/promotion.hpp>
#include <boost/math/constants/constants.hpp>
namespace boost{ namespace math{
namespace boost{ namespace math{ namespace detail{
template <class T>
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 <class T, class Policy>
inline T cos_pi(T x, const Policy&)
inline typename tools::promote_args<T>::type cos_pi(T x, const Policy&)
{
return cos_pi(x);
typedef typename tools::promote_args<T>::type result_type;
return boost::math::detail::cos_pi_imp<result_type>(x);
}
template <class T>
inline typename tools::promote_args<T>::type cos_pi(T x)
{
typedef typename tools::promote_args<T>::type result_type;
return boost::math::detail::cos_pi_imp<result_type>(x);
}
} // namespace math

View File

@@ -146,28 +146,78 @@ T gamma_inva_imp(const T& z, const T& p, const T& q, const Policy& pol)
} // namespace detail
template <class T, class Policy>
inline T gamma_p_inva(T x, T p, const Policy& pol)
template <class T1, class T2, class Policy>
inline typename tools::promote_args<T1, T2>::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<T1, T2>::type result_type;
typedef typename policies::evaluation<result_type, Policy>::type value_type;
typedef typename policies::normalise<
Policy,
policies::promote_float<false>,
policies::promote_double<false>,
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
if(p == 0)
{
return tools::max_value<result_type>();
}
if(p == 1)
{
return tools::min_value<result_type>();
}
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::gamma_inva_imp(
static_cast<value_type>(x),
static_cast<value_type>(p),
1 - static_cast<value_type>(p),
pol), "boost::math::gamma_p_inva<%1%>(%1%, %1%)");
}
template <class T, class Policy>
inline T gamma_q_inva(T x, T q, const Policy& pol)
template <class T1, class T2, class Policy>
inline typename tools::promote_args<T1, T2>::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<T1, T2>::type result_type;
typedef typename policies::evaluation<result_type, Policy>::type value_type;
typedef typename policies::normalise<
Policy,
policies::promote_float<false>,
policies::promote_double<false>,
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
if(q == 1)
{
return tools::max_value<result_type>();
}
if(q == 0)
{
return tools::min_value<result_type>();
}
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::gamma_inva_imp(
static_cast<value_type>(x),
1 - static_cast<value_type>(q),
static_cast<value_type>(q),
pol), "boost::math::gamma_q_inva<%1%>(%1%, %1%)");
}
template <class T>
inline T gamma_p_inva(T x, T p)
template <class T1, class T2>
inline typename tools::promote_args<T1, T2>::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 <class T>
inline T gamma_q_inva(T x, T q)
template <class T1, class T2>
inline typename tools::promote_args<T1, T2>::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

View File

@@ -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 <class T, class Policy>
inline T ibeta_inva(T b, T x, T p, const Policy& pol)
template <class RT1, class RT2, class RT3, class Policy>
typename tools::promote_args<RT1, RT2, RT3>::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<RT1, RT2, RT3>::type result_type;
typedef typename policies::evaluation<result_type, Policy>::type value_type;
typedef typename policies::normalise<
Policy,
policies::promote_float<false>,
policies::promote_double<false>,
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
if(p == 0)
{
return tools::max_value<result_type>();
}
if(p == 1)
{
return tools::min_value<result_type>();
}
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::ibeta_inv_ab_imp(
static_cast<value_type>(b),
static_cast<value_type>(x),
static_cast<value_type>(p),
1 - static_cast<value_type>(p),
false, pol),
"boost::math::ibeta_inva<%1%>(%1%,%1%,%1%)");
}
template <class T, class Policy>
inline T ibetac_inva(T b, T x, T q, const Policy& pol)
template <class RT1, class RT2, class RT3, class Policy>
typename tools::promote_args<RT1, RT2, RT3>::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<RT1, RT2, RT3>::type result_type;
typedef typename policies::evaluation<result_type, Policy>::type value_type;
typedef typename policies::normalise<
Policy,
policies::promote_float<false>,
policies::promote_double<false>,
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
if(q == 1)
{
return tools::max_value<result_type>();
}
if(q == 0)
{
return tools::min_value<result_type>();
}
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::ibeta_inv_ab_imp(
static_cast<value_type>(b),
static_cast<value_type>(x),
1 - static_cast<value_type>(q),
static_cast<value_type>(q),
false, pol),
"boost::math::ibetac_inva<%1%>(%1%,%1%,%1%)");
}
template <class T, class Policy>
inline T ibeta_invb(T b, T x, T p, const Policy& pol)
template <class RT1, class RT2, class RT3, class Policy>
typename tools::promote_args<RT1, RT2, RT3>::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<RT1, RT2, RT3>::type result_type;
typedef typename policies::evaluation<result_type, Policy>::type value_type;
typedef typename policies::normalise<
Policy,
policies::promote_float<false>,
policies::promote_double<false>,
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
if(p == 0)
{
return tools::min_value<result_type>();
}
if(p == 1)
{
return tools::max_value<result_type>();
}
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::ibeta_inv_ab_imp(
static_cast<value_type>(a),
static_cast<value_type>(x),
static_cast<value_type>(p),
1 - static_cast<value_type>(p),
true, pol),
"boost::math::ibeta_invb<%1%>(%1%,%1%,%1%)");
}
template <class T, class Policy>
inline T ibetac_invb(T b, T x, T q, const Policy& pol)
template <class RT1, class RT2, class RT3, class Policy>
typename tools::promote_args<RT1, RT2, RT3>::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<RT1, RT2, RT3>::type result_type;
typedef typename policies::evaluation<result_type, Policy>::type value_type;
typedef typename policies::normalise<
Policy,
policies::promote_float<false>,
policies::promote_double<false>,
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
if(q == 1)
{
return tools::min_value<result_type>();
}
if(q == 0)
{
return tools::max_value<result_type>();
}
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::ibeta_inv_ab_imp(
static_cast<value_type>(a),
static_cast<value_type>(x),
1 - static_cast<value_type>(q),
static_cast<value_type>(q),
true, pol),
"boost::math::ibetac_invb<%1%>(%1%,%1%,%1%)");
}
template <class T>
inline T ibeta_inva(T b, T x, T p)
template <class RT1, class RT2, class RT3>
inline typename tools::promote_args<RT1, RT2, RT3>::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 <class T>
inline T ibetac_inva(T b, T x, T q)
template <class RT1, class RT2, class RT3>
inline typename tools::promote_args<RT1, RT2, RT3>::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 <class T>
inline T ibeta_invb(T b, T x, T p)
template <class RT1, class RT2, class RT3>
inline typename tools::promote_args<RT1, RT2, RT3>::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 <class T>
inline T ibetac_invb(T b, T x, T q)
template <class RT1, class RT2, class RT3>
inline typename tools::promote_args<RT1, RT2, RT3>::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

View File

@@ -595,16 +595,16 @@ namespace boost
typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_neumann(unsigned v, T x);
template <class T, class Policy>
T sin_pi(T x, const Policy&);
typename tools::promote_args<T>::type sin_pi(T x, const Policy&);
template <class T>
T sin_pi(T x);
typename tools::promote_args<T>::type sin_pi(T x);
template <class T, class Policy>
T cos_pi(T x, const Policy&);
typename tools::promote_args<T>::type cos_pi(T x, const Policy&);
template <class T>
T cos_pi(T x);
typename tools::promote_args<T>::type cos_pi(T x);
template <class T>
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 <class T>\
inline T sin_pi(T x){ return boost::math::sin_pi(x); }\
inline typename boost::math::tools::promote_args<T>::type sin_pi(T x){ return boost::math::sin_pi(x); }\
\
template <class T>\
inline T cos_pi(T x){ return boost::math::cos_pi(x); }\
inline typename boost::math::tools::promote_args<T>::type cos_pi(T x){ return boost::math::cos_pi(x); }\
\
using boost::math::fpclassify;\
using boost::math::isfinite;\

View File

@@ -9,12 +9,13 @@
#include <cmath>
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/real_cast.hpp>
#include <boost/math/tools/promotion.hpp>
#include <boost/math/constants/constants.hpp>
namespace boost{ namespace math{
namespace boost{ namespace math{ namespace detail{
template <class T>
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 <class T, class Policy>
inline T sin_pi(T x, const Policy&)
inline typename tools::promote_args<T>::type sin_pi(T x, const Policy&)
{
return boost::math::sin_pi(x);
typedef typename tools::promote_args<T>::type result_type;
return boost::math::detail::sin_pi_imp<result_type>(x);
}
template <class T>
inline typename tools::promote_args<T>::type sin_pi(T x)
{
typedef typename tools::promote_args<T>::type result_type;
return boost::math::detail::sin_pi_imp<result_type>(x);
}
} // namespace math

View File

@@ -48,7 +48,7 @@ namespace boost
template<typename T>
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;

View File

@@ -47,7 +47,7 @@ namespace boost
template<typename T>
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;

View File

@@ -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"

View File

@@ -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 <class RealType>
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

View File

@@ -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<value_type>;
#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<value_type>;
#else
funcp = boost::math::expm1;
#endif
result = boost::math::tools::test(
data,
bind_func(funcp, 0),

View File

@@ -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<value_type, value_type>;
#else
pg funcp = boost::math::cyl_bessel_i;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#else
pg funcp = cyl_bessel_i_int_wrapper;
#endif
boost::math::tools::test_result<value_type> result;

View File

@@ -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<value_type, value_type>;
#else
pg funcp = boost::math::cyl_bessel_j;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#else
pg funcp = cyl_bessel_j_int_wrapper;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#else
pg funcp = boost::math::sph_bessel;
#endif
typedef int (*cast_t)(value_type);

View File

@@ -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<value_type, value_type>;
#else
pg funcp = boost::math::cyl_bessel_k;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#else
pg funcp = cyl_bessel_k_int_wrapper;
#endif
boost::math::tools::test_result<value_type> result;

View File

@@ -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<value_type, value_type>;
#else
pg funcp = boost::math::cyl_neumann;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#else
pg funcp = cyl_neumann_int_wrapper;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#else
pg funcp = boost::math::sph_neumann;
#endif
typedef int (*cast_t)(value_type);

View File

@@ -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<value_type, value_type>;
#else
pg funcp = boost::math::beta;
#endif
boost::math::tools::test_result<value_type> result;

View File

@@ -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<T>;
#else
func_t f = &binomial_wrapper;
#endif
#include "binomial_data.ipp"

View File

@@ -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<value_type, value_type, value_type>;
#else
value_type (*fp)(value_type, value_type, value_type) = boost::math::ellint_rf;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type>;
#else
value_type (*fp)(value_type, value_type) = boost::math::ellint_rc;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type, value_type, value_type>;
#else
value_type (*fp)(value_type, value_type, value_type, value_type) = boost::math::ellint_rj;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type, value_type>;
#else
value_type (*fp)(value_type, value_type, value_type) = boost::math::ellint_rd;
#endif
boost::math::tools::test_result<value_type> result;
result = boost::math::tools::test(

View File

@@ -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<value_type>;
#else
pg funcp = boost::math::cbrt;
#endif
boost::math::tools::test_result<value_type> result;

View File

@@ -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<value_type>;
#else
pg funcp = boost::math::digamma;
#endif
boost::math::tools::test_result<value_type> result;

View File

@@ -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<value_type, value_type>;
#else
value_type (*fp2)(value_type, value_type) = boost::math::ellint_1;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#else
value_type (*fp1)(value_type) = boost::math::ellint_1;
#endif
result = boost::math::tools::test(
data,
bind_func(fp1, 0),

View File

@@ -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<value_type, value_type>;
#else
value_type (*fp2)(value_type, value_type) = boost::math::ellint_2;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#else
value_type (*fp1)(value_type) = boost::math::ellint_2;
#endif
result = boost::math::tools::test(
data,
bind_func(fp1, 0),

View File

@@ -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<value_type, value_type, value_type>;
#else
value_type (*fp2)(value_type, value_type, value_type) = boost::math::ellint_3;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type>;
#else
value_type (*fp2)(value_type, value_type) = boost::math::ellint_3;
#endif
boost::math::tools::test_result<value_type> result;
result = boost::math::tools::test(

View File

@@ -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<value_type>;
#else
pg funcp = boost::math::erf;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#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<value_type>;
#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<value_type>;
#else
funcp = boost::math::erfc_inv;
#endif
result = boost::math::tools::test(
data,
bind_func(funcp, 0),

View File

@@ -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<value_type>;
#else
pg funcp = boost::math::tgamma;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#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<value_type>;
#else
pg funcp = boost::math::tgamma1pm1;
#endif
boost::math::tools::test_result<value_type> result;

View File

@@ -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<value_type>;
#else
pg funcp = boost::math::hermite;
#endif
typedef unsigned (*cast_t)(value_type);

View File

@@ -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<value_type, value_type, value_type>;
#else
pg funcp = boost::math::beta;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type, value_type>;
#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<value_type, value_type, value_type>;
#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<value_type, value_type, value_type>;
#else
funcp = boost::math::ibetac;
#endif
result = boost::math::tools::test(
data,
bind_func(funcp, 0, 1, 2),

View File

@@ -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<value_type, value_type, value_type>;
#else
pg funcp = boost::math::ibeta_inv;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type, value_type>;
#else
funcp = boost::math::ibetac_inv;
#endif
result = boost::math::tools::test(
data,
bind_func(funcp, 0, 1, 2),

View File

@@ -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 <boost/math/concepts/real_concept.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
#include <boost/test/floating_point_comparison.hpp>
@@ -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<value_type, value_type, value_type>;
#else
pg funcp = boost::math::ibeta_inva;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type, value_type>;
#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<value_type, value_type, value_type>;
#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<value_type, value_type, value_type>;
#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;
}

View File

@@ -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<value_type, value_type>;
#else
pg funcp = boost::math::tgamma;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type>;
#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<value_type, value_type>;
#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<value_type, value_type>;
#else
funcp = boost::math::gamma_p;
#endif
result = boost::math::tools::test(
data,
bind_func(funcp, 0, 1),

View File

@@ -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<value_type, value_type>;
#else
pg funcp = boost::math::gamma_p_inv;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type>;
#else
funcp = boost::math::gamma_q_inv;
#endif
result = boost::math::tools::test(
data,
bind_func(funcp, 0, 1),

View File

@@ -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 <boost/math/concepts/real_concept.hpp>
#include <boost/math/special_functions/gamma.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -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<value_type, value_type>;
#else
pg funcp = boost::math::gamma_p_inva;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type>;
#else
funcp = boost::math::gamma_q_inva;
#endif
result = boost::math::tools::test(
data,
bind_func(funcp, 0, 1),

View File

@@ -12,6 +12,7 @@ int main(int argc, char* [])
if(argc > 10000)
{
instantiate(double(0));
instantiate_mixed(double(0));
other_test();
}
}

View File

@@ -8,6 +8,7 @@
void other_test()
{
instantiate(double(0));
instantiate_mixed(double(0));
}

View File

@@ -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<value_type>;
#else
pg funcp = boost::math::laguerre;
#endif
boost::math::tools::test_result<value_type> 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<unsigned, value_type>;
#else
pg funcp = boost::math::laguerre;
#endif
boost::math::tools::test_result<value_type> result;

View File

@@ -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<value_type>;
#else
pg funcp = boost::math::legendre_p;
#endif
boost::math::tools::test_result<value_type> 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<value_type>;
#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<value_type>;
#else
pg funcp = boost::math::legendre_p;
#endif
boost::math::tools::test_result<value_type> result;

View File

@@ -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<T>;
#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<T>;
#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));
}

View File

@@ -18,7 +18,11 @@
void test_polynomial()
{
#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
double (*f)(double) = boost::math::expm1<double>;
#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<double> 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<double>;
#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<double> approx1(f, 3, 3, -1, 1, true, false);
std::cout << "Interpolation Error: " << approx1.max_error() << std::endl;

View File

@@ -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<value_type, value_type>;
#else
pg funcp = boost::math::spherical_harmonic_r;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type>;
#else
funcp = boost::math::spherical_harmonic_i;
#endif
//
// test Spheric Harmonic against data:
//

View File

@@ -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<value_type, value_type>;
#else
pg funcp = boost::math::tgamma_delta_ratio;
#endif
boost::math::tools::test_result<value_type> 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<value_type, value_type>;
#else
pg funcp = boost::math::tgamma_ratio;
#endif
boost::math::tools::test_result<value_type> result;