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

Added Compaq CXX long long workaround to real_concept.hpp.

Added missing forward declaration to ellint_1.hpp.
Adjusted native log1p support for aCC.
Removed bad forward declaration of fpclassify: correct declaration appears later in the file.
Adjusted compile_test/test_compile_result.hpp to not return a NULL reference.
Adjusted permitted error-limits for new platforms.
Split some of the tests into smaller units so we don't get compiler timeouts when building (hopefully!)

[SVN r39893]
This commit is contained in:
John Maddock
2007-10-10 16:05:26 +00:00
parent 8342ec648e
commit d4c1bb24c7
16 changed files with 323 additions and 20 deletions

View File

@@ -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<long double>(c)){}
real_concept(long long c) : m_value(static_cast<long double>(c)){}
#elif defined(BOOST_HAS_MS_INT64)

View File

@@ -29,6 +29,9 @@ typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi, const Policy&
namespace detail{
template <typename T, typename Policy>
T ellint_k_imp(T k, const Policy& pol);
// Elliptic integral (Legendre form) of the first kind
template <typename T, typename Policy>
T ellint_f_imp(T phi, T k, const Policy& pol)

View File

@@ -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 <class Policy>
inline float log1p(float x, const Policy& pol)
{

View File

@@ -347,10 +347,6 @@ namespace boost
template <class RT, class Policy>
typename tools::promote_args<RT>::type rising_factorial(RT x, int n, const Policy& pol);
// Fpclassify - classify floating-point as NaN or infinity...
template <class T>
int fpclassify (T);
// Gamma functions.
template <class RT>
typename tools::promote_args<RT>::type tgamma(RT z);

View File

@@ -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
<define>TEST_FLOAT
: test_binomial_float ;
run test_binomial.cpp
: # command line
: # input files
: # requirements
<define>TEST_DOUBLE
: test_binomial_double ;
run test_binomial.cpp
: # command line
: # input files
: # requirements
<define>TEST_LDOUBLE
: test_binomial_long_double ;
run test_binomial.cpp
: # command line
: # input files
: # requirements
<define>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
<define>TEST_FLOAT
: test_ibeta_float ;
run test_ibeta.cpp
: # command line
: # input files
: # requirements
<define>TEST_DOUBLE
: test_ibeta_double ;
run test_ibeta.cpp
: # command line
: # input files
: # requirements
<define>TEST_LDOUBLE
: test_ibeta_long_double ;
run test_ibeta.cpp
: # command line
: # input files
: # requirements
<define>TEST_REAL_CONCEPT
: test_ibeta_real_concept ;
run test_ibeta_inv.cpp
: # command line
: # input files
: # requirements
<define>TEST_FLOAT
: test_ibeta_inv_float ;
run test_ibeta_inv.cpp
: # command line
: # input files
: # requirements
<define>TEST_DOUBLE
: test_ibeta_inv_double ;
run test_ibeta_inv.cpp
: # command line
: # input files
: # requirements
<define>TEST_LDOUBLE
: test_ibeta_inv_long_double ;
run test_ibeta_inv.cpp
: # command line
: # input files
: # requirements
<define>TEST_REAL_CONCEPT
: test_ibeta_inv_real_concept ;
run test_ibeta_inv_ab.cpp
: # command line
: # input files
: # requirements
<define>TEST_FLOAT
: test_ibeta_inv_ab_float ;
run test_ibeta_inv_ab.cpp
: # command line
: # input files
: # requirements
<define>TEST_DOUBLE
: test_ibeta_inv_ab_double ;
run test_ibeta_inv_ab.cpp
: # command line
: # input files
: # requirements
<define>TEST_LDOUBLE
: test_ibeta_inv_ab_long_double ;
run test_ibeta_inv_ab.cpp
: # command line
: # input files
: # requirements
<define>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
<define>TEST_FLOAT
: test_igamma_inv_float ;
run test_igamma_inv.cpp
: # command line
: # input files
: # requirements
<define>TEST_DOUBLE
: test_igamma_inv_double ;
run test_igamma_inv.cpp
: # command line
: # input files
: # requirements
<define>TEST_LDOUBLE
: test_igamma_inv_long_double ;
run test_igamma_inv.cpp
: # command line
: # input files
: # requirements
<define>TEST_REAL_CONCEPT
: test_igamma_inv_real_concept ;
run test_igamma_inva.cpp
: # command line
: # input files
: # requirements
<define>TEST_FLOAT
: test_igamma_inva_float ;
run test_igamma_inva.cpp
: # command line
: # input files
: # requirements
<define>TEST_DOUBLE
: test_igamma_inva_double ;
run test_igamma_inva.cpp
: # command line
: # input files
: # requirements
<define>TEST_LDOUBLE
: test_igamma_inva_long_double ;
run test_igamma_inva.cpp
: # command line
: # input files
: # requirements
<define>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
<define>TEST_FLOAT
: test_negative_binomial_float ;
run test_negative_binomial.cpp
: # command line
: # input files
: # requirements
<define>TEST_DOUBLE
: test_negative_binomial_double ;
run test_negative_binomial.cpp
: # command line
: # input files
: # requirements
<define>TEST_LDOUBLE
: test_negative_binomial_long_double ;
run test_negative_binomial.cpp
: # command line
: # input files
: # requirements
<define>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
<define>TEST_FLOAT
: test_poisson_float ;
run test_poisson.cpp
: # command line
: # input files
: # requirements
<define>TEST_DOUBLE
: test_poisson_double ;
run test_poisson.cpp
: # command line
: # input files
: # requirements
<define>TEST_LDOUBLE
: test_poisson_long_double ;
run test_poisson.cpp
: # command line
: # input files
: # requirements
<define>TEST_REAL_CONCEPT
: test_poisson_real_concept ;
run test_rayleigh.cpp ;
run test_rationals.cpp

View File

@@ -105,10 +105,11 @@ struct DistributionConcept
check_result<value_type>(chf(dist, li));
}
private:
static Distribution* get_object_p();
static Distribution& get_object()
{
// will never get called:
return * reinterpret_cast<Distribution*>(0);
return *get_object_p();
}
}; // struct DistributionConcept

View File

@@ -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 << "<note>The long double tests have been disabled on this platform "
"either because the long double overloads of the usual math functions are "

View File

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

View File

@@ -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 << "<note>The long double tests have been disabled on this platform "
"either because the long double overloads of the usual math functions are "

View File

@@ -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 << "<note>The long double tests have been disabled on this platform "
"either because the long double overloads of the usual math functions are "

View File

@@ -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 << "<note>The long double tests have been disabled on this platform "
"either because the long double overloads of the usual math functions are "

View File

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

View File

@@ -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 << "<note>The long double tests have been disabled on this platform "
"either because the long double overloads of the usual math functions are "

View File

@@ -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 << "<note>The long double tests have been disabled on this platform "
"either because the long double overloads of the usual math functions are "

View File

@@ -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 <boost/math/distributions/negative_binomial.hpp> // 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<double>(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 << "<note>The long double tests have been disabled on this platform "

View File

@@ -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<long double>::digits10 > numeric_limits<double>::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;