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

Remove pile of warnings so that the build log is easier to search through.

This commit is contained in:
Nick Thompson
2018-03-17 16:39:17 +08:00
parent 581d203254
commit babead7504
5 changed files with 7 additions and 30 deletions

View File

@@ -71,7 +71,7 @@ int main()
// An eyeball estimate indicates that the population crossed 100 million around 1915.
// Let's see what interpolation says:
boost::math::cubic_b_spline<double> p(population.data(), population.size(), t0, 10);
boost::math::cubic_b_spline<double> p(population.data(), population.size(), t0, time_step);
// Now create a function which has a zero at p = 100,000,000:
auto f = [=](double t){ return p(t) - 100000000; };

View File

@@ -6,6 +6,7 @@
// Basic sanity check that header <boost/math/special_functions/bernoulli.hpp>
// #includes all the files that it needs to.
//
#include <ostream>
#include <boost/math/special_functions/bernoulli.hpp>
//
// Note this header includes no other headers, this is
@@ -30,5 +31,7 @@ void compile_and_link_test()
constexpr float ce_f = boost::math::unchecked_bernoulli_b2n<float>(2);
constexpr float ce_d = boost::math::unchecked_bernoulli_b2n<double>(2);
constexpr float ce_l = boost::math::unchecked_bernoulli_b2n<long double>(2);
std::ostream cnull(0);
cnull << ce_f << ce_d << ce_l << std::endl;
#endif
}

View File

@@ -52,7 +52,10 @@ template <class T1, class T2>
inline void check_result_imp(T1, T2)
{
// This is a static assertion that should always fail to compile...
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
typedef BOOST_MATH_ASSERT_UNUSED_ATTRIBUTE int static_assertion[local_is_same<T1, T2>::value ? 1 : 0];
#pragma GCC diagnostic pop
}
template <class T1, class T2>

View File

@@ -281,7 +281,6 @@ void test_polynomial_error(T)
//
const char* func = "boost::math::test_function<%1%>(%1%, %1%, %1%)";
const char* msg1 = "Error while handling value %1%";
const char* msg2 = "Error message goes here...";
static const typename T::value_type data[] = { 1, 2, 3 };
static const T val(data, 2);
@@ -293,12 +292,6 @@ void test_polynomial_error(T)
TEST_EXCEPTION(boost::math::policies::raise_domain_error(func, 0, val, throw_policy), std::domain_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Domain Error evaluating function at { 1, 2, 3 }"));
TEST_EXCEPTION(boost::math::policies::raise_pole_error(func, msg1, val, throw_policy), std::domain_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Error while handling value { 1, 2, 3 }"));
TEST_EXCEPTION(boost::math::policies::raise_pole_error(func, 0, val, throw_policy), std::domain_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Evaluation of function at pole { 1, 2, 3 }"));
//TEST_EXCEPTION(boost::math::policies::raise_overflow_error<T>(func, msg2, throw_policy), std::overflow_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Error message goes here..."));
//TEST_EXCEPTION(boost::math::policies::raise_overflow_error<T>(func, 0, throw_policy), std::overflow_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Overflow Error"));
//TEST_EXCEPTION(boost::math::policies::raise_underflow_error<T>(func, msg2, throw_policy), std::underflow_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Error message goes here..."));
//TEST_EXCEPTION(boost::math::policies::raise_underflow_error<T>(func, 0, throw_policy), std::underflow_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Underflow Error"));
//TEST_EXCEPTION(boost::math::policies::raise_denorm_error<T>(func, msg2, T(0), throw_policy), std::underflow_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Error message goes here..."));
//TEST_EXCEPTION(boost::math::policies::raise_denorm_error<T>(func, 0, T(0), throw_policy), std::underflow_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Denorm Error"));
TEST_EXCEPTION(boost::math::policies::raise_evaluation_error(func, msg1, val, throw_policy), boost::math::evaluation_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Error while handling value { 1, 2, 3 }"));
TEST_EXCEPTION(boost::math::policies::raise_evaluation_error(func, 0, val, throw_policy), boost::math::evaluation_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Internal Evaluation Error, best value so far was { 1, 2, 3 }"));
TEST_EXCEPTION(boost::math::policies::raise_indeterminate_result_error(func, msg1, val, T(12.34), throw_policy), std::domain_error, format_message_string<T>("Error in function boost::math::test_function<float>(float, float, float): Error while handling value { 1, 2, 3 }"));
@@ -308,9 +301,6 @@ void test_polynomial_error(T)
// - because by design these are undefined and must be defined by the user ;-)
BOOST_MATH_CHECK_THROW(boost::math::policies::raise_domain_error(func, msg1, T(0.0), user_policy), user_defined_error);
BOOST_MATH_CHECK_THROW(boost::math::policies::raise_pole_error(func, msg1, T(0.0), user_policy), user_defined_error);
//BOOST_MATH_CHECK_THROW(boost::math::policies::raise_overflow_error<T>(func, msg2, user_policy), user_defined_error);
//BOOST_MATH_CHECK_THROW(boost::math::policies::raise_underflow_error<T>(func, msg2, user_policy), user_defined_error);
//BOOST_MATH_CHECK_THROW(boost::math::policies::raise_denorm_error<T>(func, msg2, T(0), user_policy), user_defined_error);
BOOST_MATH_CHECK_THROW(boost::math::policies::raise_evaluation_error(func, msg1, T(0.0), user_policy), user_defined_error);
BOOST_MATH_CHECK_THROW(boost::math::policies::raise_indeterminate_result_error(func, msg1, T(0.0), T(0.0), user_policy), user_defined_error);
#endif
@@ -318,9 +308,6 @@ void test_polynomial_error(T)
// Test with ignore_error
BOOST_CHECK((boost::math::isnan)(boost::math::policies::raise_domain_error(func, msg1, T(0.0), ignore_policy)) || !std::numeric_limits<T>::has_quiet_NaN);
BOOST_CHECK((boost::math::isnan)(boost::math::policies::raise_pole_error(func, msg1, T(0.0), ignore_policy)) || !std::numeric_limits<T>::has_quiet_NaN);
//BOOST_CHECK_EQUAL(boost::math::policies::raise_overflow_error<T>(func, msg2, ignore_policy), std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : boost::math::tools::max_value<T>());
//BOOST_CHECK_EQUAL(boost::math::policies::raise_underflow_error<T>(func, msg2, ignore_policy), T(0));
//BOOST_CHECK_EQUAL(boost::math::policies::raise_denorm_error<T>(func, msg2, T(1.25), ignore_policy), T(1.25));
BOOST_CHECK_EQUAL(boost::math::policies::raise_evaluation_error(func, msg1, T(1.25), ignore_policy), T(1.25));
BOOST_CHECK_EQUAL(boost::math::policies::raise_indeterminate_result_error(func, 0, T(0.0), T(12.34), ignore_policy), T(12.34));
@@ -332,15 +319,6 @@ void test_polynomial_error(T)
BOOST_CHECK((boost::math::isnan)(boost::math::policies::raise_pole_error(func, msg1, T(0.0), errno_policy)) || !std::numeric_limits<T>::has_quiet_NaN);
BOOST_CHECK(errno == EDOM);
errno = 0;
//BOOST_CHECK_EQUAL(boost::math::policies::raise_overflow_error<T>(func, msg2, errno_policy), std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : boost::math::tools::max_value<T>());
//BOOST_CHECK_EQUAL(errno, ERANGE);
//errno = 0;
//BOOST_CHECK_EQUAL(boost::math::policies::raise_underflow_error<T>(func, msg2, errno_policy), T(0));
//BOOST_CHECK_EQUAL(errno, ERANGE);
//errno = 0;
//BOOST_CHECK_EQUAL(boost::math::policies::raise_denorm_error<T>(func, msg2, T(1.25), errno_policy), T(1.25));
//BOOST_CHECK_EQUAL(errno, ERANGE);
//errno = 0;
BOOST_CHECK_EQUAL(boost::math::policies::raise_evaluation_error(func, msg1, T(1.25), errno_policy), T(1.25));
BOOST_CHECK(errno == EDOM);
errno = 0;

View File

@@ -246,13 +246,6 @@ BOOST_AUTO_TEST_CASE( test_main )
#if defined(TEST_SSE2)
#ifdef _MSC_VER
# pragma message("Compiling SSE2 test code")
#endif
#ifdef __GNUC__
# pragma message "Compiling SSE2 test code"
#endif
int mmx_flags = _mm_getcsr(); // We'll restore these later.
#ifdef _WIN32