void do_test_tgamma_delta_ratio(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test tgamma_delta_ratio against data: // result = boost::math::tools::test( data, bind_func(funcp, 0, 1), extract_result(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma_delta_ratio(a, delta)", test_name); result = boost::math::tools::test( data, negative_tgamma_ratio(), extract_result(3)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma_delta_ratio(a -delta)", test_name); }
void do_test_erf(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test erf against data: // result = boost::math::tools::test( data, bind_func(funcp, 0), extract_result(1)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::erf", test_name); #ifdef TEST_OTHER if(::boost::is_floating_point<value_type>::value){ funcp = other::erf; result = boost::math::tools::test( data, bind_func(funcp, 0), extract_result(1)); print_test_result(result, data[result.worst()], result.worst(), type_name, "other::erf"); } #endif // // 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), extract_result(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::erfc", test_name); #ifdef TEST_OTHER if(::boost::is_floating_point<value_type>::value){ funcp = other::erfc; result = boost::math::tools::test( data, bind(funcp, 0), extract_result(2)); print_test_result(result, data[result.worst()], result.worst(), type_name, "other::erfc"); } #endif std::cout << std::endl; }
void do_test_nc_chi_squared(T& data, const char* type_name, const char* test) { typedef Real value_type; std::cout << "Testing: " << test << std::endl; value_type(*fp1)(value_type, value_type, value_type, value_type) = nc_beta_cdf; boost::math::tools::test_result<value_type> result; #if !(defined(ERROR_REPORTING_MODE) && !defined(NC_BETA_CDF_FUNCTION_TO_TEST)) result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(fp1, 0, 1, 2, 3), extract_result<Real>(4)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "non central beta CDF", test); #endif #if !(defined(ERROR_REPORTING_MODE) && !defined(NC_BETA_CCDF_FUNCTION_TO_TEST)) fp1 = nc_beta_ccdf; result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(fp1, 0, 1, 2, 3), extract_result<Real>(5)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "non central beta CDF complement", test); #endif std::cout << std::endl; }
void do_test_sn(T& data, const char* type_name, const char* test) { #if !(defined(ERROR_REPORTING_MODE) && !defined(SN_FUNCTION_TO_TEST)) typedef Real value_type; std::cout << "Testing: " << test << std::endl; #ifdef SN_FUNCTION_TO_TEST value_type(*fp2)(value_type, value_type) = SN_FUNCTION_TO_TEST; #elif defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) value_type (*fp2)(value_type, value_type) = boost::math::jacobi_sn<value_type, value_type>; #else value_type (*fp2)(value_type, value_type) = boost::math::jacobi_sn; #endif boost::math::tools::test_result<value_type> result; result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(fp2, 1, 0), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "jacobi_sn", test); #ifdef CN_FUNCTION_TO_TEST fp2 = CN_FUNCTION_TO_TEST; #elif defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) fp2 = boost::math::jacobi_cn<value_type, value_type>; #else fp2 = boost::math::jacobi_cn; #endif result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(fp2, 1, 0), extract_result<Real>(3)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "jacobi_cn", test); #ifdef SN_FUNCTION_TO_TEST fp2 = DN_FUNCTION_TO_TEST; #elif defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) fp2 = boost::math::jacobi_dn<value_type, value_type>; #else fp2 = boost::math::jacobi_dn; #endif result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(fp2, 1, 0), extract_result<Real>(4)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "jacobi_dn", test); std::cout << std::endl; #endif }
void do_test_legendre_p(const T& data, const char* type_name, const char* test_name) { typedef Real value_type; typedef value_type (*pg)(int, value_type); pg funcp; #if !(defined(ERROR_REPORTING_MODE) && !defined(LEGENDRE_P_FUNCTION_TO_TEST)) #ifdef LEGENDRE_P_FUNCTION_TO_TEST funcp = LEGENDRE_P_FUNCTION_TO_TEST; #elif defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) funcp = boost::math::legendre_p<value_type>; #else funcp = boost::math::legendre_p; #endif boost::math::tools::test_result<value_type> result; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test legendre_p against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func_int1<Real>(funcp, 0, 1), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "legendre_p", test_name); #endif typedef value_type (*pg2)(unsigned, value_type); #if !(defined(ERROR_REPORTING_MODE) && !defined(LEGENDRE_Q_FUNCTION_TO_TEST)) #ifdef LEGENDRE_Q_FUNCTION_TO_TEST pg2 funcp2 = LEGENDRE_Q_FUNCTION_TO_TEST; #elif 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: // result = boost::math::tools::test_hetero<Real>( data, bind_func_int1<Real>(funcp2, 0, 1), extract_result<Real>(3)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "legendre_q", test_name); std::cout << std::endl; #endif }
void do_test_sn(T& data, const char* type_name, const char* test) { typedef typename T::value_type row_type; typedef Real value_type; std::cout << "Testing: " << test << std::endl; #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) value_type (*fp2)(value_type, value_type) = boost::math::jacobi_sn<value_type, value_type>; #else value_type (*fp2)(value_type, value_type) = boost::math::jacobi_sn; #endif boost::math::tools::test_result<value_type> result; result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(fp2, 1, 0), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::jacobi_sn", test); #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) fp2 = boost::math::jacobi_cn<value_type, value_type>; #else fp2 = boost::math::jacobi_cn; #endif result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(fp2, 1, 0), extract_result<Real>(3)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::jacobi_cn", test); #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) fp2 = boost::math::jacobi_dn<value_type, value_type>; #else fp2 = boost::math::jacobi_dn; #endif result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(fp2, 1, 0), extract_result<Real>(4)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::jacobi_dn", test); std::cout << std::endl; }
void do_test_laguerre3(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test laguerre against data: // result = boost::math::tools::test( data, bind_func_int2(funcp, 0, 1, 2), extract_result(3)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::laguerre(n, m, x)", test_name); std::cout << std::endl; }
void do_test_ellint_k(T& data, const char* type_name, const char* test) { #if !(defined(ERROR_REPORTING_MODE) && !defined(ELLINT_1C_FUNCTION_TO_TEST)) typedef Real value_type; boost::math::tools::test_result<value_type> result; std::cout << "Testing: " << test << std::endl; #ifdef ELLINT_1C_FUNCTION_TO_TEST value_type(*fp1)(value_type) = ELLINT_1C_FUNCTION_TO_TEST; #elif 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_hetero<Real>( data, bind_func<Real>(fp1, 0), extract_result<Real>(1)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "ellint_1 (complete)", test); std::cout << std::endl; #endif }
void do_test_hermite(const T& data, const char* type_name, const char* test_name) { #if !(defined(ERROR_REPORTING_MODE) && !defined(HERMITE_FUNCTION_TO_TEST)) typedef Real value_type; typedef value_type (*pg)(unsigned, value_type); #ifdef HERMITE_FUNCTION_TO_TEST pg funcp = HERMITE_FUNCTION_TO_TEST; #elif defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) pg funcp = boost::math::hermite<value_type>; #else pg funcp = boost::math::hermite; #endif boost::math::tools::test_result<value_type> result; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test hermite against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func_int1<Real>(funcp, 0, 1), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "hermite", test_name); std::cout << std::endl; #endif }
void do_test_cbrt(const T& data, const char* type_name, const char* test_name) { #if !(defined(ERROR_REPORTING_MODE) && !defined(CBRT_FUNCTION_TO_TEST)) typedef Real value_type; typedef value_type (*pg)(value_type); #ifdef CBRT_FUNCTION_TO_TEST pg funcp = boost::math::cbrt<value_type>; #elif 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test cbrt against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(funcp, 1), extract_result<Real>(0)); result += boost::math::tools::test_hetero<Real>( data, negative_cbrt<Real>(), negate<Real>(extract_result<Real>(0))); handle_test_result(result, data[result.worst()], result.worst(), type_name, "cbrt", test_name); std::cout << std::endl; #endif }
void do_test_cyl_bessel_j_int(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test cyl_bessel_j against data: // result = boost::math::tools::test( data, bind_func(funcp, 0, 1), extract_result(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_bessel_j", test_name); std::cout << std::endl; }
void do_test_gammap1m1(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; typedef Real 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test tgamma1pm1 against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(funcp, 0), extract_result<Real>(1)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma1pm1", test_name); std::cout << std::endl; }
void do_test_cbrt(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test cbrt against data: // result = boost::math::tools::test( data, bind_func(funcp, 1), extract_result(0)); result += boost::math::tools::test( data, negative_cbrt(), negate(extract_result(0))); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cbrt", test_name); std::cout << std::endl; }
void do_test_erf_inv(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; typedef typename row_type::value_type value_type; typedef value_type (*pg)(value_type); boost::math::tools::test_result<value_type> result; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test erf_inv against data: // #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) pg funcp = boost::math::erf_inv<value_type>; #else pg funcp = boost::math::erf_inv; #endif result = boost::math::tools::test( data, bind_func(funcp, 0), extract_result(1)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::erf_inv", test_name); std::cout << std::endl; }
void do_test_cyl_bessel_j_derivative(const T& data, const char* type_name, const char* test_name) { typedef Real 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_derivative<value_type, value_type>; #else pg funcp = boost::math::cyl_bessel_j_derivative; #endif boost::math::tools::test_result<value_type> result; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test cyl_bessel_j against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(funcp, 0, 1), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_bessel_j_derivative", test_name); std::cout << std::endl; }
void do_test_laguerre3(const T& data, const char* type_name, const char* test_name) { #if !(defined(ERROR_REPORTING_MODE) && !defined(ASSOC_LAGUERRE_FUNCTION_TO_TEST)) typedef Real value_type; typedef value_type (*pg)(unsigned, unsigned, value_type); #ifdef ASSOC_LAGUERRE_FUNCTION_TO_TEST pg funcp = ASSOC_LAGUERRE_FUNCTION_TO_TEST; #elif 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test laguerre against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func_int2<Real>(funcp, 0, 1, 2), extract_result<Real>(3)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "laguerre(n, m, x)", test_name); std::cout << std::endl; #endif }
void do_test_digamma(const T& data, const char* type_name, const char* test_name) { #if !(defined(ERROR_REPORTING_MODE) && !defined(DIGAMMA_FUNCTION_TO_TEST)) typedef Real value_type; typedef value_type (*pg)(value_type); #ifdef DIGAMMA_FUNCTION_TO_TEST pg funcp = DIGAMMA_FUNCTION_TO_TEST; #elif 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test digamma against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(funcp, 0), extract_result<Real>(1)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "digamma", test_name); std::cout << std::endl; #endif }
void do_test_cyl_bessel_k_int(const T& data, const char* type_name, const char* test_name) { #if !(defined(ERROR_REPORTING_MODE) && !defined(BESSEL_KN_FUNCTION_TO_TEST)) typedef Real 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test cyl_bessel_k against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(funcp, 0, 1), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "cyl_bessel_k (integer orders)", test_name); std::cout << std::endl; #endif }
void do_test_sph_bessel_j(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; typedef Real 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); boost::math::tools::test_result<value_type> result; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test sph_bessel against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func_int1<Real>(funcp, 0, 1), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::sph_bessel", test_name); std::cout << std::endl; }
void do_test_heuman_lambda(const T& data, const char* type_name, const char* test) { #if !(defined(ERROR_REPORTING_MODE) && !defined(HEUMAN_LAMBDA_FUNCTION_TO_TEST)) typedef Real value_type; std::cout << "Testing: " << test << std::endl; #ifdef HEUMAN_LAMBDA_FUNCTION_TO_TEST value_type(*fp2)(value_type, value_type) = HEUMAN_LAMBDA_FUNCTION_TO_TEST; #elif defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) value_type (*fp2)(value_type, value_type) = boost::math::ellint_d<value_type, value_type>; #else value_type(*fp2)(value_type, value_type) = boost::math::heuman_lambda; #endif boost::math::tools::test_result<value_type> result; result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(fp2, 1, 0), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "heuman_lambda", test); std::cout << std::endl; #endif }
void do_test_cyl_bessel_j(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; typedef Real 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test cyl_bessel_j against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(funcp, 0, 1), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_bessel_j", test_name); std::cout << std::endl; #ifdef TEST_OTHER if(boost::is_floating_point<value_type>::value) { funcp = other::cyl_bessel_j; // // test other::cyl_bessel_j against data: // result = boost::math::tools::test_hetero( data, bind_func<Real>(funcp, 0, 1), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "other::cyl_bessel_j", test_name); std::cout << std::endl; } #endif }
void do_test_spherical_harmonic(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test Spheric Harmonic against data: // result = boost::math::tools::test( data, bind_func_int2(funcp, 0, 1, 2, 3), 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: // result = boost::math::tools::test( data, bind_func_int2(funcp, 0, 1, 2, 3), extract_result(5)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::spherical_harmonic_i", test_name); std::cout << std::endl; }
void do_test_tgamma_delta_ratio(const T& data, const char* type_name, const char* test_name) { #if !(defined(ERROR_REPORTING_MODE) && !defined(TGAMMA_DELTA_RATIO_FUNCTION_TO_TEST)) typedef Real value_type; typedef value_type (*pg)(value_type, value_type); #ifdef TGAMMA_DELTA_RATIO_FUNCTION_TO_TEST pg funcp = TGAMMA_DELTA_RATIO_FUNCTION_TO_TEST; #elif 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test tgamma_delta_ratio against data: // result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(funcp, 0, 1), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "tgamma_delta_ratio", test_name); result = boost::math::tools::test_hetero<Real>( data, negative_tgamma_ratio<Real>(), extract_result<Real>(3)); std::string s(test_name); s += " (negative delta)"; handle_test_result(result, data[result.worst()], result.worst(), type_name, "tgamma_delta_ratio", s.c_str()); #endif }
void do_test_cyl_bessel_i(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test cyl_bessel_i against data: // result = boost::math::tools::test( data, bind_func(funcp, 0, 1), extract_result(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_bessel_i", test_name); std::cout << std::endl; #ifdef TEST_OTHER if(boost::is_floating_point<value_type>::value) { funcp = other::cyl_bessel_i; // // test other::cyl_bessel_i against data: // result = boost::math::tools::test( data, boost::lambda::bind(funcp, boost::lambda::ret<value_type>(boost::lambda::_1[0]), boost::lambda::ret<value_type>(boost::lambda::_1[1])), boost::lambda::ret<value_type>(boost::lambda::_1[2])); print_test_result(result, data[result.worst()], result.worst(), type_name, "other::cyl_bessel_i"); std::cout << std::endl; } #endif }
void do_test_ellint_e1(T& data, const char* type_name, const char* test) { typedef typename T::value_type row_type; typedef Real value_type; boost::math::tools::test_result<value_type> result; 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_hetero<Real>( data, bind_func<Real>(fp1, 0), extract_result<Real>(1)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ellint_2", test); std::cout << std::endl; }
void do_test_jacobi_zeta(const T& data, const char* type_name, const char* test) { typedef Real value_type; std::cout << "Testing: " << test << std::endl; #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) value_type (*fp2)(value_type, value_type) = boost::math::ellint_d<value_type, value_type>; #else value_type(*fp2)(value_type, value_type) = boost::math::jacobi_zeta; #endif boost::math::tools::test_result<value_type> result; result = boost::math::tools::test_hetero<Real>( data, bind_func<Real>(fp2, 1, 0), extract_result<Real>(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::jacobi_zeta", test); std::cout << std::endl; }
void do_test_ellint_pi2(T& data, const char* type_name, const char* test) { typedef typename T::value_type row_type; typedef typename row_type::value_type value_type; 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( data, bind_func(fp2, 1, 0), extract_result(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ellint_3", test); std::cout << std::endl; }
void do_test_legendre_p(const T& data, const char* type_name, const char* test_name) { typedef typename T::value_type row_type; 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; std::cout << "Testing " << test_name << " with type " << type_name << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; // // test legendre_p against data: // result = boost::math::tools::test( data, bind_func_int1(funcp, 0, 1), extract_result(2)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::legendre_p", test_name); #ifdef TEST_OTHER if(::boost::is_floating_point<value_type>::value){ funcp = other::legendre_p; result = boost::math::tools::test( data, bind_func_int1(funcp, 0, 1), extract_result(2)); print_test_result(result, data[result.worst()], result.worst(), type_name, "other::legendre_p"); } #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: // result = boost::math::tools::test( data, bind_func_int1(funcp2, 0, 1), extract_result(3)); handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::legendre_q", test_name); #ifdef TEST_OTHER if(::boost::is_floating_point<value_type>::value){ funcp = other::legendre_q; result = boost::math::tools::test( data, bind_func_int1(funcp2, 0, 1), extract_result(3)); print_test_result(result, data[result.worst()], result.worst(), type_name, "other::legendre_q"); } #endif std::cout << std::endl; }