diff --git a/include/boost/math/concepts/real_concept.hpp b/include/boost/math/concepts/real_concept.hpp index 7b0b64902..2d64d181e 100644 --- a/include/boost/math/concepts/real_concept.hpp +++ b/include/boost/math/concepts/real_concept.hpp @@ -55,7 +55,7 @@ public: real_concept(int c) : m_value(c){} real_concept(unsigned long c) : m_value(c){} real_concept(long c) : m_value(c){} -#ifdef BOOST_HAS_LONG_LONG +#if defined(BOOST_HAS_LONG_LONG) || defined(__DECCXX) real_concept(unsigned long long c) : m_value(static_cast(c)){} real_concept(long long c) : m_value(static_cast(c)){} #elif defined(BOOST_HAS_MS_INT64) diff --git a/include/boost/math/special_functions/ellint_1.hpp b/include/boost/math/special_functions/ellint_1.hpp index 519d1da21..8b10cf044 100644 --- a/include/boost/math/special_functions/ellint_1.hpp +++ b/include/boost/math/special_functions/ellint_1.hpp @@ -29,6 +29,9 @@ typename tools::promote_args::type ellint_1(T1 k, T2 phi, const Policy& namespace detail{ +template +T ellint_k_imp(T k, const Policy& pol); + // Elliptic integral (Legendre form) of the first kind template T ellint_f_imp(T phi, T k, const Policy& pol) diff --git a/include/boost/math/special_functions/log1p.hpp b/include/boost/math/special_functions/log1p.hpp index dd8d4a62b..72695cdc4 100644 --- a/include/boost/math/special_functions/log1p.hpp +++ b/include/boost/math/special_functions/log1p.hpp @@ -128,7 +128,7 @@ inline long double log1p(long double z) #ifdef BOOST_HAS_LOG1P # if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \ || defined(linux) || defined(__linux) || defined(__linux__) \ - || defined(__hpux) + || (defined(__hpux) && !defined(_PA_RISC1_1)) template inline float log1p(float x, const Policy& pol) { diff --git a/include/boost/math/special_functions/math_fwd.hpp b/include/boost/math/special_functions/math_fwd.hpp index d645071a8..85a6d9626 100644 --- a/include/boost/math/special_functions/math_fwd.hpp +++ b/include/boost/math/special_functions/math_fwd.hpp @@ -347,10 +347,6 @@ namespace boost template typename tools::promote_args::type rising_factorial(RT x, int n, const Policy& pol); - // Fpclassify - classify floating-point as NaN or infinity... - template - int fpclassify (T); - // Gamma functions. template typename tools::promote_args::type tgamma(RT z); diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 41abe616a..906ff109e 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -44,7 +44,30 @@ run test_bernoulli.cpp ; run test_constants.cpp ; run test_beta.cpp ; run test_beta_dist.cpp ; -run test_binomial.cpp ; +run test_binomial.cpp + : # command line + : # input files + : # requirements + TEST_FLOAT + : test_binomial_float ; +run test_binomial.cpp + : # command line + : # input files + : # requirements + TEST_DOUBLE + : test_binomial_double ; +run test_binomial.cpp + : # command line + : # input files + : # requirements + TEST_LDOUBLE + : test_binomial_long_double ; +run test_binomial.cpp + : # command line + : # input files + : # requirements + TEST_REAL_CONCEPT + : test_binomial_real_concept ; run test_binomial_coeff.cpp ; run test_carlson.cpp ; run test_cauchy.cpp ; @@ -67,21 +90,182 @@ run test_fisher_f.cpp ; run test_gamma.cpp ; run test_gamma_dist.cpp ; run test_hermite.cpp ; -run test_ibeta.cpp ; -run test_ibeta_inv.cpp ; -run test_ibeta_inv_ab.cpp ; +run test_ibeta.cpp + : # command line + : # input files + : # requirements + TEST_FLOAT + : test_ibeta_float ; +run test_ibeta.cpp + : # command line + : # input files + : # requirements + TEST_DOUBLE + : test_ibeta_double ; +run test_ibeta.cpp + : # command line + : # input files + : # requirements + TEST_LDOUBLE + : test_ibeta_long_double ; +run test_ibeta.cpp + : # command line + : # input files + : # requirements + TEST_REAL_CONCEPT + : test_ibeta_real_concept ; +run test_ibeta_inv.cpp + : # command line + : # input files + : # requirements + TEST_FLOAT + : test_ibeta_inv_float ; +run test_ibeta_inv.cpp + : # command line + : # input files + : # requirements + TEST_DOUBLE + : test_ibeta_inv_double ; +run test_ibeta_inv.cpp + : # command line + : # input files + : # requirements + TEST_LDOUBLE + : test_ibeta_inv_long_double ; +run test_ibeta_inv.cpp + : # command line + : # input files + : # requirements + TEST_REAL_CONCEPT + : test_ibeta_inv_real_concept ; +run test_ibeta_inv_ab.cpp + : # command line + : # input files + : # requirements + TEST_FLOAT + : test_ibeta_inv_ab_float ; +run test_ibeta_inv_ab.cpp + : # command line + : # input files + : # requirements + TEST_DOUBLE + : test_ibeta_inv_ab_double ; +run test_ibeta_inv_ab.cpp + : # command line + : # input files + : # requirements + TEST_LDOUBLE + : test_ibeta_inv_ab_long_double ; +run test_ibeta_inv_ab.cpp + : # command line + : # input files + : # requirements + TEST_REAL_CONCEPT + : test_ibeta_inv_ab_real_concept ; run test_igamma.cpp ; -run test_igamma_inv.cpp ; -run test_igamma_inva.cpp ; +run test_igamma_inv.cpp + : # command line + : # input files + : # requirements + TEST_FLOAT + : test_igamma_inv_float ; +run test_igamma_inv.cpp + : # command line + : # input files + : # requirements + TEST_DOUBLE + : test_igamma_inv_double ; +run test_igamma_inv.cpp + : # command line + : # input files + : # requirements + TEST_LDOUBLE + : test_igamma_inv_long_double ; +run test_igamma_inv.cpp + : # command line + : # input files + : # requirements + TEST_REAL_CONCEPT + : test_igamma_inv_real_concept ; +run test_igamma_inva.cpp + : # command line + : # input files + : # requirements + TEST_FLOAT + : test_igamma_inva_float ; +run test_igamma_inva.cpp + : # command line + : # input files + : # requirements + TEST_DOUBLE + : test_igamma_inva_double ; +run test_igamma_inva.cpp + : # command line + : # input files + : # requirements + TEST_LDOUBLE + : test_igamma_inva_long_double ; +run test_igamma_inva.cpp + : # command line + : # input files + : # requirements + TEST_REAL_CONCEPT + : test_igamma_inva_real_concept ; run test_instantiate1.cpp test_instantiate2.cpp ; run test_laguerre.cpp ; run test_legendre.cpp ; run test_lognormal.cpp ; run test_minima.cpp ; -run test_negative_binomial.cpp ; +run test_negative_binomial.cpp + : # command line + : # input files + : # requirements + TEST_FLOAT + : test_negative_binomial_float ; +run test_negative_binomial.cpp + : # command line + : # input files + : # requirements + TEST_DOUBLE + : test_negative_binomial_double ; +run test_negative_binomial.cpp + : # command line + : # input files + : # requirements + TEST_LDOUBLE + : test_negative_binomial_long_double ; +run test_negative_binomial.cpp + : # command line + : # input files + : # requirements + TEST_REAL_CONCEPT + : test_negative_binomial_real_concept ; run test_normal.cpp ; run test_pareto.cpp ; -run test_poisson.cpp ; +run test_poisson.cpp + : # command line + : # input files + : # requirements + TEST_FLOAT + : test_poisson_float ; +run test_poisson.cpp + : # command line + : # input files + : # requirements + TEST_DOUBLE + : test_poisson_double ; +run test_poisson.cpp + : # command line + : # input files + : # requirements + TEST_LDOUBLE + : test_poisson_long_double ; +run test_poisson.cpp + : # command line + : # input files + : # requirements + TEST_REAL_CONCEPT + : test_poisson_real_concept ; run test_rayleigh.cpp ; run test_rationals.cpp diff --git a/test/compile_test/test_compile_result.hpp b/test/compile_test/test_compile_result.hpp index 936fd03ff..58ea3143f 100644 --- a/test/compile_test/test_compile_result.hpp +++ b/test/compile_test/test_compile_result.hpp @@ -105,10 +105,11 @@ struct DistributionConcept check_result(chf(dist, li)); } private: + static Distribution* get_object_p(); static Distribution& get_object() { // will never get called: - return * reinterpret_cast(0); + return *get_object_p(); } }; // struct DistributionConcept diff --git a/test/test_binomial.cpp b/test/test_binomial.cpp index 1fda34805..172aba142 100644 --- a/test/test_binomial.cpp +++ b/test/test_binomial.cpp @@ -12,6 +12,13 @@ #define BOOST_MATH_DISCRETE_QUANTILE_POLICY real +#if !defined(TEST_FLOAT) && !defined(TEST_DOUBLE) && !defined(TEST_LDOUBLE) && !defined(TEST_REAL_CONCEPT) +# define TEST_FLOAT +# define TEST_DOUBLE +# define TEST_LDOUBLE +# define TEST_REAL_CONCEPT +#endif + #ifdef _MSC_VER # pragma warning(disable: 4127) // conditional expression is constant. #endif @@ -694,13 +701,21 @@ int test_main(int, char* []) // Basic sanity-check spot values. // (Parameter value, arbitrarily zero, only communicates the floating point type). +#ifdef TEST_FLOAT test_spots(0.0F); // Test float. +#endif +#ifdef TEST_DOUBLE test_spots(0.0); // Test double. +#endif #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#ifdef TEST_LDOUBLE test_spots(0.0L); // Test long double. +#endif #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) +#ifdef TEST_REAL_CONCEPT test_spots(boost::math::concepts::real_concept(0.)); // Test real concept. #endif +#endif #else std::cout << "The long double tests have been disabled on this platform " "either because the long double overloads of the usual math functions are " diff --git a/test/test_gamma.cpp b/test/test_gamma.cpp index 08f0d9a27..6eadc650c 100644 --- a/test/test_gamma.cpp +++ b/test/test_gamma.cpp @@ -191,7 +191,7 @@ void expected_results() ".*", // compiler ".*", // stdlib "Sun.*", // platform - "real_concept" // test type(s) + "real_concept", // test type(s) "factorials", // test data group "boost::math::tgamma", 300, 50); // test function diff --git a/test/test_ibeta.cpp b/test/test_ibeta.cpp index c4abbd74e..a6c308b3d 100644 --- a/test/test_ibeta.cpp +++ b/test/test_ibeta.cpp @@ -20,6 +20,13 @@ #include "test_beta_hooks.hpp" #include "handle_test_result.hpp" +#if !defined(TEST_FLOAT) && !defined(TEST_DOUBLE) && !defined(TEST_LDOUBLE) && !defined(TEST_REAL_CONCEPT) +# define TEST_FLOAT +# define TEST_DOUBLE +# define TEST_LDOUBLE +# define TEST_REAL_CONCEPT +#endif + // // DESCRIPTION: // ~~~~~~~~~~~~ @@ -521,15 +528,23 @@ int test_main(int, char* []) #endif #endif +#ifdef TEST_FLOAT test_beta(0.1F, "float"); +#endif +#ifdef TEST_DOUBLE test_beta(0.1, "double"); +#endif +#ifdef TEST_LDOUBLE #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS test_beta(0.1L, "long double"); +#endif #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) +#ifdef TEST_REAL_CONCEPT test_beta(boost::math::concepts::real_concept(0.1), "real_concept"); #endif #endif +#endif #else std::cout << "The long double tests have been disabled on this platform " "either because the long double overloads of the usual math functions are " diff --git a/test/test_ibeta_inv.cpp b/test/test_ibeta_inv.cpp index 82a65fa8e..fc8e2c8fd 100644 --- a/test/test_ibeta_inv.cpp +++ b/test/test_ibeta_inv.cpp @@ -20,6 +20,13 @@ #include "test_beta_hooks.hpp" #include "handle_test_result.hpp" +#if !defined(TEST_FLOAT) && !defined(TEST_DOUBLE) && !defined(TEST_LDOUBLE) && !defined(TEST_REAL_CONCEPT) +# define TEST_FLOAT +# define TEST_DOUBLE +# define TEST_LDOUBLE +# define TEST_REAL_CONCEPT +#endif + // // DESCRIPTION: // ~~~~~~~~~~~~ @@ -313,13 +320,21 @@ int test_main(int, char* []) test_spots(boost::math::concepts::real_concept(0.1)); #endif +#ifdef TEST_FLOAT test_beta(0.1F, "float"); +#endif +#ifdef TEST_DOUBLE test_beta(0.1, "double"); +#endif #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#ifdef TEST_LDOUBLE test_beta(0.1L, "long double"); +#endif #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS +#ifdef TEST_REAL_CONCEPT test_beta(boost::math::concepts::real_concept(0.1), "real_concept"); #endif +#endif #else std::cout << "The long double tests have been disabled on this platform " "either because the long double overloads of the usual math functions are " diff --git a/test/test_ibeta_inv_ab.cpp b/test/test_ibeta_inv_ab.cpp index 6a23191bd..fcca4c688 100644 --- a/test/test_ibeta_inv_ab.cpp +++ b/test/test_ibeta_inv_ab.cpp @@ -24,6 +24,12 @@ #include "handle_test_result.hpp" +#if !defined(TEST_FLOAT) && !defined(TEST_DOUBLE) && !defined(TEST_LDOUBLE) && !defined(TEST_REAL_CONCEPT) +# define TEST_FLOAT +# define TEST_DOUBLE +# define TEST_LDOUBLE +# define TEST_REAL_CONCEPT +#endif // // DESCRIPTION: // ~~~~~~~~~~~~ @@ -270,13 +276,21 @@ int test_main(int, char* []) gsl_set_error_handler_off(); #endif +#ifdef TEST_FLOAT test_beta(0.1F, "float"); +#endif +#ifdef TEST_DOUBLE test_beta(0.1, "double"); +#endif #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#ifdef TEST_LDOUBLE test_beta(0.1L, "long double"); +#endif #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS +#ifdef TEST_REAL_CONCEPT test_beta(boost::math::concepts::real_concept(0.1), "real_concept"); #endif +#endif #else std::cout << "The long double tests have been disabled on this platform " "either because the long double overloads of the usual math functions are " diff --git a/test/test_igamma.cpp b/test/test_igamma.cpp index f6dea81f4..d672f2cad 100644 --- a/test/test_igamma.cpp +++ b/test/test_igamma.cpp @@ -174,15 +174,15 @@ void expected_results() "[^|]*", // compiler "[^|]*", // stdlib "Sun.*", // platform - largest_real, // test type(s) + largest_type, // test type(s) "[^|]*medium[^|]*", // test data group - "[^|]*", 500, 100); // test function + "[^|]*", 500, 100); // test function add_expected_result( "[^|]*", // compiler "[^|]*", // stdlib "Sun.*", // platform - largest_real, // test type(s) - "[^|]*integer[^|]*", // test data group + largest_type, // test type(s) + "[^|]*integer[^|]*", // test data group "[^|]*", 100, 30); // test function add_expected_result( "[^|]*", // compiler diff --git a/test/test_igamma_inv.cpp b/test/test_igamma_inv.cpp index 736d336f6..f8eefd268 100644 --- a/test/test_igamma_inv.cpp +++ b/test/test_igamma_inv.cpp @@ -20,6 +20,13 @@ #include "test_gamma_hooks.hpp" #include "handle_test_result.hpp" +#if !defined(TEST_FLOAT) && !defined(TEST_DOUBLE) && !defined(TEST_LDOUBLE) && !defined(TEST_REAL_CONCEPT) +# define TEST_FLOAT +# define TEST_DOUBLE +# define TEST_LDOUBLE +# define TEST_REAL_CONCEPT +#endif + // // DESCRIPTION: // ~~~~~~~~~~~~ @@ -377,16 +384,24 @@ int test_main(int, char* []) #endif #ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS +#ifdef TEST_FLOAT test_gamma(0.1F, "float"); #endif +#endif +#ifdef TEST_DOUBLE test_gamma(0.1, "double"); +#endif #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#ifdef TEST_LDOUBLE test_gamma(0.1L, "long double"); +#endif #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) +#ifdef TEST_REAL_CONCEPT test_gamma(boost::math::concepts::real_concept(0.1), "real_concept"); #endif #endif +#endif #else std::cout << "The long double tests have been disabled on this platform " "either because the long double overloads of the usual math functions are " diff --git a/test/test_igamma_inva.cpp b/test/test_igamma_inva.cpp index 41bd1ed30..5ace0687c 100644 --- a/test/test_igamma_inva.cpp +++ b/test/test_igamma_inva.cpp @@ -19,6 +19,13 @@ #include "handle_test_result.hpp" +#if !defined(TEST_FLOAT) && !defined(TEST_DOUBLE) && !defined(TEST_LDOUBLE) && !defined(TEST_REAL_CONCEPT) +# define TEST_FLOAT +# define TEST_DOUBLE +# define TEST_LDOUBLE +# define TEST_REAL_CONCEPT +#endif + // // DESCRIPTION: // ~~~~~~~~~~~~ @@ -250,16 +257,24 @@ int test_main(int, char* []) expected_results(); #ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS +#ifdef TEST_FLOAT test_gamma(0.1F, "float"); #endif +#endif +#ifdef TEST_DOUBLE test_gamma(0.1, "double"); +#endif #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#ifdef TEST_LDOUBLE test_gamma(0.1L, "long double"); +#endif #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) +#ifdef TEST_REAL_CONCEPT test_gamma(boost::math::concepts::real_concept(0.1), "real_concept"); #endif #endif +#endif #else std::cout << "The long double tests have been disabled on this platform " "either because the long double overloads of the usual math functions are " diff --git a/test/test_negative_binomial.cpp b/test/test_negative_binomial.cpp index b4c53b44e..7dd277ab8 100644 --- a/test/test_negative_binomial.cpp +++ b/test/test_negative_binomial.cpp @@ -19,6 +19,13 @@ # pragma warning(disable: 4127) // conditional expression is constant. #endif +#if !defined(TEST_FLOAT) && !defined(TEST_DOUBLE) && !defined(TEST_LDOUBLE) && !defined(TEST_REAL_CONCEPT) +# define TEST_FLOAT +# define TEST_DOUBLE +# define TEST_LDOUBLE +# define TEST_REAL_CONCEPT +#endif + #include // for negative_binomial_distribution using boost::math::negative_binomial_distribution; @@ -801,12 +808,20 @@ int test_main(int, char* []) BOOST_CHECK_EQUAL(my8dist.success_fraction(), static_cast(1./4.)); // (Parameter value, arbitrarily zero, only communicates the floating point type). +#ifdef TEST_FLOAT test_spots(0.0F); // Test float. +#endif +#ifdef TEST_DOUBLE test_spots(0.0); // Test double. +#endif #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#ifdef TEST_LDOUBLE test_spots(0.0L); // Test long double. +#endif #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) +#ifdef TEST_REAL_CONCEPT test_spots(boost::math::concepts::real_concept(0.)); // Test real concept. +#endif #endif #else std::cout << "The long double tests have been disabled on this platform " diff --git a/test/test_poisson.cpp b/test/test_poisson.cpp index 76e49068a..acbc6c4d1 100644 --- a/test/test_poisson.cpp +++ b/test/test_poisson.cpp @@ -12,6 +12,13 @@ #define BOOST_MATH_DISCRETE_QUANTILE_POLICY real +#if !defined(TEST_FLOAT) && !defined(TEST_DOUBLE) && !defined(TEST_LDOUBLE) && !defined(TEST_REAL_CONCEPT) +# define TEST_FLOAT +# define TEST_DOUBLE +# define TEST_LDOUBLE +# define TEST_REAL_CONCEPT +#endif + #ifdef _MSC_VER # pragma warning(disable: 4127) // conditional expression is constant. #endif @@ -578,16 +585,24 @@ int test_main(int, char* []) #endif // (Parameter value, arbitrarily zero, only communicates the floating-point type). +#ifdef TEST_POISSON test_spots(0.0F); // Test float. +#endif +#ifdef TEST_DOUBLE test_spots(0.0); // Test double. +#endif #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS if (numeric_limits::digits10 > numeric_limits::digits10) { // long double is better than double (so not MSVC where they are same). +#ifdef TEST_LDOUBLE test_spots(0.0L); // Test long double. +#endif } #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) +#ifdef TEST_REAL_CONCEPT test_spots(boost::math::concepts::real_concept(0.)); // Test real concept. +#endif #endif #endif return 0;