diff --git a/example/negative_binomial_example1.cpp b/example/negative_binomial_example1.cpp index 8f9031369..65d5e8f1b 100644 --- a/example/negative_binomial_example1.cpp +++ b/example/negative_binomial_example1.cpp @@ -246,7 +246,7 @@ Probability of selling his quota of 5 bars on or before the 30th house is 0.99849 ] -/*`So the risk of failing even after visiting all the houses is 1 - this probability, +`So the risk of failing even after visiting all the houses is 1 - this probability, ``1 - cdf(nb, all_houses - sales_quota`` But using this expression may cause serious inaccuracy, so it would be much better to use the complement of the cdf: @@ -511,9 +511,3 @@ House for 5th (last) sale. Probability (%) 30 0.99849 */ - - - - - - diff --git a/include/boost/math/special_functions/detail/airy_ai_bi_zero.hpp b/include/boost/math/special_functions/detail/airy_ai_bi_zero.hpp index dbb7388dd..b5a71c78e 100644 --- a/include/boost/math/special_functions/detail/airy_ai_bi_zero.hpp +++ b/include/boost/math/special_functions/detail/airy_ai_bi_zero.hpp @@ -86,7 +86,7 @@ class function_object_ai_and_ai_prime { public: - function_object_ai_and_ai_prime(const Policy pol) : my_pol(pol) { } + function_object_ai_and_ai_prime(const Policy& pol) : my_pol(pol) { } boost::math::tuple operator()(const T& x) const { @@ -137,7 +137,7 @@ class function_object_bi_and_bi_prime { public: - function_object_bi_and_bi_prime(const Policy pol) : my_pol(pol) { } + function_object_bi_and_bi_prime(const Policy& pol) : my_pol(pol) { } boost::math::tuple operator()(const T& x) const { diff --git a/test/compile_test/instantiate.hpp b/test/compile_test/instantiate.hpp index e3930a2dd..f7dd4078f 100644 --- a/test/compile_test/instantiate.hpp +++ b/test/compile_test/instantiate.hpp @@ -11,6 +11,7 @@ # define BOOST_MATH_ASSERT_UNDEFINED_POLICY false #endif +#include #include #include @@ -54,6 +55,7 @@ void instantiate(RealType) using namespace boost; using namespace boost::math; using namespace boost::math::concepts; + std::ostream cnull(0); #ifdef TEST_GROUP_1 function_requires > >(); function_requires > >(); @@ -159,7 +161,9 @@ void instantiate(RealType) function_requires >(); #endif #endif - int i; + int i = 1; + // Deal with unused variable warnings: + cnull << i; RealType v1(0.5), v2(0.5), v3(0.5); boost::detail::dummy_constructor dc; boost::output_iterator_archetype oi(dc); @@ -918,16 +922,24 @@ void instantiate_mixed(RealType) { using namespace boost; using namespace boost::math; + std::ostream cnull(0); #ifndef BOOST_MATH_INSTANTIATE_MINIMUM int i = 1; + cnull << i; long l = 1; + cnull << l; short s = 1; + cnull << s; float fr = 0.5F; + cnull << fr; double dr = 0.5; + cnull << dr; #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS long double lr = 0.5L; + cnull << lr; #else double lr = 0.5L; + cnull << lr; #endif #ifdef TEST_GROUP_7 boost::math::tgamma(i); @@ -1376,4 +1388,3 @@ void instantiate_mixed(RealType) #endif // BOOST_LIBS_MATH_TEST_INSTANTIATE_HPP - diff --git a/test/test_arcsine.cpp b/test/test_arcsine.cpp index 6f96e8621..7b4de12fb 100644 --- a/test/test_arcsine.cpp +++ b/test/test_arcsine.cpp @@ -119,7 +119,7 @@ void test_ignore_policy(RealType) // NaN constructors. BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(2, nan)))); BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(nan, nan)))); - BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(nan, 2)))); + BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(nan, 2)))); // Variance BOOST_CHECK((boost::math::isnan)(variance(ignore_error_arcsine(nan, 0)))); @@ -138,7 +138,7 @@ void test_ignore_policy(RealType) BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_arcsine(2, 0)))); BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_arcsine(3, 0)))); - // Kurtosis + // Kurtosis BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(nan, 0)))); BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(-1, nan)))); BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(0, 0)))); @@ -159,7 +159,7 @@ void test_ignore_policy(RealType) BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_arcsine(4, 0)))); } // has_quiet_NaN - // + // BOOST_CHECK(boost::math::isfinite(mean(ignore_error_arcsine(0, std::numeric_limits::epsilon())))); check_support >(arcsine_distribution(0, 1)); @@ -233,8 +233,8 @@ void test_spots(RealType) (boost::math::tools::epsilon(), static_cast(std::numeric_limits::epsilon())); // 0 if real_concept. - RealType max_value = boost::math::tools::max_value(); - RealType epsilon = boost::math::tools::epsilon(); + //RealType max_value = boost::math::tools::max_value(); + //RealType epsilon = boost::math::tools::epsilon(); //cout << "Boost::math::tools::epsilon = " << boost::math::tools::epsilon() << endl; //cout << "std::numeric_limits::epsilon = " << std::numeric_limits::epsilon() << endl; @@ -273,7 +273,7 @@ void test_spots(RealType) // PDF // pdf of x = 1/4 is same as reflected value at x = 3/4. - // N[PDF[arcsinedistribution[0, 1], 0.25], 50] + // N[PDF[arcsinedistribution[0, 1], 0.25], 50] // N[PDF[arcsinedistribution[0, 1], 0.75], 50] // 0.73510519389572273268176866441729258852984864048885 @@ -323,7 +323,7 @@ void test_spots(RealType) BOOST_CHECK_CLOSE_FRACTION(quantile(arcsine_01, static_cast(0.25L)), static_cast(0.14644660940672624L), tolerance); BOOST_CHECK_CLOSE_FRACTION(quantile(arcsine_01, static_cast(0.5L)), 0.5, 2 * tolerance); // probability = 0.5, x = 0.5 BOOST_CHECK_CLOSE_FRACTION(quantile(arcsine_01, static_cast(0.75L)), static_cast(0.85355339059327373L), tolerance); - + // N[CDF[arcsinedistribution[0, 1], 0.05], 50] == 0.14356629312870627075094188477505571882161519989741 BOOST_CHECK_CLOSE_FRACTION(quantile(arcsine_01, static_cast(0.14356629312870627075094188477505571882161519989741L)), 0.05, tolerance); @@ -543,7 +543,7 @@ void test_spots(RealType) arcsine as; // Using typedef for default standard arcsine. - // + // BOOST_CHECK_EQUAL(as.x_min(), 0); // BOOST_CHECK_EQUAL(as.x_max(), 1); BOOST_CHECK_EQUAL(mean(as), 0.5); // 1 / (1 + 1) = 1/2 exactly. @@ -577,7 +577,7 @@ Version 12.0.30110.00 Update 1 1> Description: Autorun "J:\Cpp\MathToolkit\test\Math_test\Debug\test_arcsine.exe" 1> Running 1 test case... 1> Platform: Win32 - 1> Compiler: Microsoft Visual C++ version 12.0 ???? MSVC says 2013 + 1> Compiler: Microsoft Visual C++ version 12.0 ???? MSVC says 2013 1> STL : Dinkumware standard library version 610 1> Boost : 1.56.0 @@ -609,6 +609,3 @@ Version 12.0.30110.00 Update 1 RUN SUCCESSFUL (total time: 141ms) */ - - - diff --git a/test/test_binomial.cpp b/test/test_binomial.cpp index 9f5adcd6a..d20765d79 100644 --- a/test/test_binomial.cpp +++ b/test/test_binomial.cpp @@ -642,12 +642,6 @@ void test_spots(RealType T) for(unsigned i = 0; i < binomial_quantile_data.size(); ++i) { using namespace boost::math::policies; - typedef policy > P1; - typedef policy > P2; - typedef policy > P3; - typedef policy > P4; - typedef policy > P5; - typedef policy > P6; RealType tol = boost::math::tools::epsilon() * 500; if(!boost::is_floating_point::value) tol *= 10; // no lanczos approximation implies less accuracy @@ -656,6 +650,7 @@ void test_spots(RealType T) // // Check full real value first: // + typedef policy > P1; binomial_distribution p1(binomial_quantile_data[i][0], binomial_quantile_data[i][1]); x = quantile(p1, binomial_quantile_data[i][2]); BOOST_CHECK_CLOSE_FRACTION(x, (RealType)binomial_quantile_data[i][3], tol); @@ -666,6 +661,7 @@ void test_spots(RealType T) // // Now with round down to integer: // + typedef policy > P2; binomial_distribution p2(binomial_quantile_data[i][0], binomial_quantile_data[i][1]); x = quantile(p2, binomial_quantile_data[i][2]); BOOST_CHECK_EQUAL(x, (RealType)floor(binomial_quantile_data[i][3])); @@ -676,6 +672,7 @@ void test_spots(RealType T) // // Now with round up to integer: // + typedef policy > P3; binomial_distribution p3(binomial_quantile_data[i][0], binomial_quantile_data[i][1]); x = quantile(p3, binomial_quantile_data[i][2]); BOOST_CHECK_EQUAL(x, (RealType)ceil(binomial_quantile_data[i][3])); @@ -686,6 +683,7 @@ void test_spots(RealType T) // // Now with round to integer "outside": // + typedef policy > P4; binomial_distribution p4(binomial_quantile_data[i][0], binomial_quantile_data[i][1]); x = quantile(p4, binomial_quantile_data[i][2]); BOOST_CHECK_EQUAL(x, (RealType)(binomial_quantile_data[i][2] < 0.5f ? floor(binomial_quantile_data[i][3]) : ceil(binomial_quantile_data[i][3]))); @@ -696,6 +694,7 @@ void test_spots(RealType T) // // Now with round to integer "inside": // + typedef policy > P5; binomial_distribution p5(binomial_quantile_data[i][0], binomial_quantile_data[i][1]); x = quantile(p5, binomial_quantile_data[i][2]); BOOST_CHECK_EQUAL(x, (RealType)(binomial_quantile_data[i][2] < 0.5f ? ceil(binomial_quantile_data[i][3]) : floor(binomial_quantile_data[i][3]))); @@ -706,6 +705,7 @@ void test_spots(RealType T) // // Now with round to nearest integer: // + typedef policy > P6; binomial_distribution p6(binomial_quantile_data[i][0], binomial_quantile_data[i][1]); x = quantile(p6, binomial_quantile_data[i][2]); BOOST_CHECK_EQUAL(x, (RealType)(floor(binomial_quantile_data[i][3] + 0.5f))); @@ -765,7 +765,7 @@ Output is: Tolerance for type double is 2.22045e-011 % Tolerance for type long double is 2.22045e-011 % Tolerance for type class boost::math::concepts::real_concept is 2.22045e-011 % - + *** No errors detected ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== diff --git a/test/test_inv_hyp.cpp b/test/test_inv_hyp.cpp index f02652745..4c2e0435e 100644 --- a/test/test_inv_hyp.cpp +++ b/test/test_inv_hyp.cpp @@ -31,12 +31,12 @@ // This file tests the inverse hyperbolic functions. There are two sets of tests: // 1) Sanity checks: comparison to test values created with the // online calculator at functions.wolfram.com -// 2) Accuracy tests use values generated with NTL::RR at +// 2) Accuracy tests use values generated with NTL::RR at // 1000-bit precision and our generic versions of these functions. // // Note that when this file is first run on a new platform many of // these tests will fail: the default accuracy is 1 epsilon which -// is too tight for most platforms. In this situation you will +// is too tight for most platforms. In this situation you will // need to cast a human eye over the error rates reported and make // a judgement as to whether they are acceptable. Either way please // report the results to the Boost mailing list. Acceptable rates of @@ -88,7 +88,7 @@ void expected_results() ".*", // test data group ".*", 4, 1); // test function - std::cout << "Tests run with " << BOOST_COMPILER << ", " + std::cout << "Tests run with " << BOOST_COMPILER << ", " << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl; } @@ -99,7 +99,6 @@ void do_test_asinh(const T& data, const char* type_name, const char* test_name) // test asinh(T) against data: // using namespace std; - typedef typename T::value_type row_type; typedef Real value_type; std::cout << test_name << " with type " << type_name << std::endl; @@ -130,7 +129,6 @@ void do_test_acosh(const T& data, const char* type_name, const char* test_name) // test acosh(T) against data: // using namespace std; - typedef typename T::value_type row_type; typedef Real value_type; std::cout << test_name << " with type " << type_name << std::endl; @@ -161,7 +159,6 @@ void do_test_atanh(const T& data, const char* type_name, const char* test_name) // test atanh(T) against data: // using namespace std; - typedef typename T::value_type row_type; typedef Real value_type; std::cout << test_name << " with type " << type_name << std::endl; @@ -229,7 +226,7 @@ void test_spots(T, const char* t) { std::cout << "Testing basic sanity checks for type " << t << std::endl; // - // Basic sanity checks, tolerance is either 5 or 10 epsilon + // Basic sanity checks, tolerance is either 5 or 10 epsilon // expressed as a percentage: // T tolerance = boost::math::tools::epsilon() * 100 * @@ -285,8 +282,5 @@ BOOST_AUTO_TEST_CASE( test_main ) "not available at all, or because they are too inaccurate for these tests " "to pass." << std::endl; #endif - + } - - - diff --git a/test/test_nc_chi_squared.hpp b/test/test_nc_chi_squared.hpp index eb7ea79ce..e5a8ffd9a 100644 --- a/test/test_nc_chi_squared.hpp +++ b/test/test_nc_chi_squared.hpp @@ -8,7 +8,7 @@ #define BOOST_TEST_MAIN #include #include -#include +#include #include #include #include "functor.hpp" @@ -48,7 +48,7 @@ template RealType naive_pdf(RealType v, RealType lam, RealType x) { - // Formula direct from + // Formula direct from // http://mathworld.wolfram.com/NoncentralChi-SquaredDistribution.html // with no simplification: RealType sum, term, prefix(1); @@ -117,7 +117,7 @@ void test_spots(RealType) boost::math::tools::epsilon(), (RealType)boost::math::tools::epsilon() * 5) * 150; // - // At float precision we need to up the tolerance, since + // At float precision we need to up the tolerance, since // the input values are rounded off to inexact quantities // the results get thrown off by a noticeable amount. // @@ -135,10 +135,10 @@ void test_spots(RealType) // // Test against the data from Table 6 of: // - // "Self-Validating Computations of Probabilities for Selected + // "Self-Validating Computations of Probabilities for Selected // Central and Noncentral Univariate Probability Functions." // Morgan C. Wang; William J. Kennedy - // Journal of the American Statistical Association, + // Journal of the American Statistical Association, // Vol. 89, No. 427. (Sep., 1994), pp. 878-887. // test_spot( @@ -289,7 +289,6 @@ T nccs_ccdf(T df, T nc, T x) template void do_test_nc_chi_squared(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; @@ -330,7 +329,6 @@ template void quantile_sanity_check(T& data, const char* type_name, const char* test) { #ifndef ERROR_REPORTING_MODE - typedef typename T::value_type row_type; typedef Real value_type; // @@ -397,7 +395,7 @@ void quantile_sanity_check(T& data, const char* type_name, const char* test) // // Sanity check degrees-of-freedom finder, don't bother at float // precision though as there's not enough data in the probability - // values to get back to the correct degrees of freedom or + // values to get back to the correct degrees of freedom or // non-cenrality parameter: // #ifndef BOOST_NO_EXCEPTIONS @@ -444,4 +442,3 @@ void test_accuracy(T, const char* type_name) do_test_nc_chi_squared(nccs_big, type_name, "Non Central Chi Squared, large parameters"); quantile_sanity_check(nccs_big, type_name, "Non Central Chi Squared, large parameters"); } - diff --git a/test/test_nc_t.hpp b/test/test_nc_t.hpp index 1a2e19faa..7a29dc9ae 100644 --- a/test/test_nc_t.hpp +++ b/test/test_nc_t.hpp @@ -8,7 +8,7 @@ #define BOOST_TEST_MAIN #include #include -#include +#include #include #include #include "functor.hpp" @@ -187,7 +187,7 @@ void test_spots(RealType) boost::math::tools::epsilon(), (RealType)5e-12f) * 100; // - // At float precision we need to up the tolerance, since + // At float precision we need to up the tolerance, since // the input values are rounded off to inexact quantities // the results get thrown off by a noticeable amount. // @@ -319,7 +319,6 @@ T nct_ccdf(T df, T nc, T x) template void do_test_nc_t(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; @@ -361,7 +360,6 @@ template void quantile_sanity_check(T& data, const char* type_name, const char* test) { #ifndef ERROR_REPORTING_MODE - typedef typename T::value_type row_type; typedef Real value_type; // @@ -430,7 +428,7 @@ void quantile_sanity_check(T& data, const char* type_name, const char* test) // // Sanity check degrees-of-freedom finder, don't bother at float // precision though as there's not enough data in the probability - // values to get back to the correct degrees of freedom or + // values to get back to the correct degrees of freedom or // non-centrality parameter: // try{ @@ -494,7 +492,7 @@ void test_big_df(RealType) { // Ordinary floats only. // Could also test if (std::numeric_limits::is_specialized); - RealType tolerance = 10 * boost::math::tools::epsilon(); // static_cast(1e-14); // + RealType tolerance = 10 * boost::math::tools::epsilon(); // static_cast(1e-14); // std::cout.precision(17); // Note: need to reset after calling BOOST_CHECK_s // due to buglet in Boost.test that fails to restore precision corrrectly. @@ -549,11 +547,11 @@ void test_big_df(RealType) BOOST_CHECK_EQUAL(mean(infdf10), 10); BOOST_CHECK_CLOSE_FRACTION(mean(maxdf10), static_cast(10), tolerance); - BOOST_CHECK_CLOSE_FRACTION(pdf(infdf10, 11), pdf(maxdf10, 11), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(pdf(infdf10, 11), pdf(maxdf10, 11), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(cdf(complement(infdf10, 11)), 1 - cdf(infdf10, 11), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(cdf(complement(maxdf10, 11)), 1 - cdf(maxdf10, 11), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(cdf(complement(infdf10, 11)), 1 - cdf(maxdf10, 11), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(cdf(complement(infdf10, 11)), 1 - cdf(infdf10, 11), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(cdf(complement(maxdf10, 11)), 1 - cdf(maxdf10, 11), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(cdf(complement(infdf10, 11)), 1 - cdf(maxdf10, 11), tolerance); // std::cout.precision(17); //std::cout << "cdf(maxdf10, 11) = " << cdf(maxdf10, 11) << ' ' << cdf(complement(maxdf10, 11)) << endl; //std::cout << "cdf(infdf10, 11) = " << cdf(infdf10, 11) << ' ' << cdf(complement(infdf10, 11)) << endl; @@ -608,18 +606,18 @@ void test_big_df(RealType) //RealType cmaxc = quantile(complement(maxdf10, 0.75)); //std::cout << cmaxc << ' ' << cdf(maxdf10, cmaxc) << std::endl; // 9.32551 0.25 - BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.5), quantile(maxdf10, 0.5), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.2), quantile(maxdf10, 0.2), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.8), quantile(maxdf10, 0.8), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.5), quantile(maxdf10, 0.5), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.2), quantile(maxdf10, 0.2), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.8), quantile(maxdf10, 0.8), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.25), quantile(complement(infdf10, 0.75)), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(quantile(complement(infdf10, 0.5)), quantile(complement(maxdf10, 0.5)), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.25), quantile(complement(infdf10, 0.75)), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(quantile(complement(infdf10, 0.5)), quantile(complement(maxdf10, 0.5)), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(quantile(maxdf10, 0.25), quantile(complement(maxdf10, 0.75)), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(quantile(maxdf10, 0.25), quantile(complement(maxdf10, 0.75)), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.99), quantile(complement(infdf10, 0.01)), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.4), quantile(complement(infdf10, 0.6)), tolerance); // - BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.01), quantile(complement(infdf10, 1 - 0.01)), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.99), quantile(complement(infdf10, 0.01)), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.4), quantile(complement(infdf10, 0.6)), tolerance); // + BOOST_CHECK_CLOSE_FRACTION(quantile(infdf10, 0.01), quantile(complement(infdf10, 1 - 0.01)), tolerance); // } } // void test_big_df(RealType) @@ -699,7 +697,7 @@ void test_ignore_policy(RealType) BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(2, 0)))); BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(3, 0)))); - // Kurtosis + // Kurtosis BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(std::numeric_limits::quiet_NaN(), 0)))); BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(-1, 0)))); BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(0, 0)))); @@ -731,4 +729,3 @@ void test_ignore_policy(RealType) check_support >(non_central_t_distribution(1, 0)); } // ordinary floats. } // template void test_ignore_policy(RealType) - diff --git a/test/test_next.cpp b/test/test_next.cpp index 1dc82d369..71256efe7 100644 --- a/test/test_next.cpp +++ b/test/test_next.cpp @@ -145,15 +145,15 @@ void test_values(const T& val, const char* name) } #endif static const int primes[] = { - 11, 13, 17, 19, 23, 29, - 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, - 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, - 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, - 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, - 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, - 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, - 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, - 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, + 11, 13, 17, 19, 23, 29, + 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, + 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, + 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, + 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, + 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, + 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, + 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, + 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, }; for(unsigned i = 0; i < sizeof(primes)/sizeof(primes[0]); ++i) @@ -199,13 +199,6 @@ BOOST_AUTO_TEST_CASE( test_main ) #endif #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 @@ -227,7 +220,5 @@ BOOST_AUTO_TEST_CASE( test_main ) // Restore the MMX flags: _mm_setcsr(mmx_flags); #endif - + } - - diff --git a/test/test_owens_t.hpp b/test/test_owens_t.hpp index 9903a8c0c..12bae1dfb 100644 --- a/test/test_owens_t.hpp +++ b/test/test_owens_t.hpp @@ -52,7 +52,7 @@ void test_spots(RealType) // BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(L), static_cast(L)), static_cast(L), tolerance); - // Spots values using Mathematica + // Spots values using Mathematica BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(6.5L), static_cast(0.4375L)), static_cast(2.00057730485083154100907167684918851101649922551817956120806662022118024594547E-11L), tolerance); BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(0.4375L), static_cast(6.5L)), static_cast(0.16540130125449396247498691826626273249659241838438244251206819782787761751256L), tolerance); BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(7.L), static_cast(0.96875L)), static_cast(6.39906271938986853083219914428916013764797190941459233223182225724846022843930e-13L), tolerance); @@ -117,7 +117,6 @@ template void do_test_owens_t(const T& data, const char* type_name, const char* test_name) { #if !(defined(ERROR_REPORTING_MODE) && !defined(OWENS_T_FUNCTION_TO_TEST)) - typedef typename T::value_type row_type; typedef Real value_type; typedef value_type(*pg)(value_type, value_type); @@ -155,7 +154,7 @@ void test_owens_t(T, const char* name) // // The contents are as follows, each row of data contains // three items, input value a, input value b and erf(a, b): - // + // # include "owens_t.ipp" do_test_owens_t(owens_t, name, "Owens T (medium small values)"); diff --git a/test/test_roots.cpp b/test/test_roots.cpp index 3a5827704..c0a6dd575 100644 --- a/test/test_roots.cpp +++ b/test/test_roots.cpp @@ -245,7 +245,6 @@ template void test_inverses(const T& data) { using namespace std; - typedef typename T::value_type row_type; typedef Real value_type; value_type precision = static_cast(ldexp(1.0, 1-boost::math::policies::digits >()/2)) * 150; @@ -267,8 +266,8 @@ void test_inverses(const T& data) BOOST_CHECK_EQUAL(inverse_ibeta_newton(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0)); BOOST_CHECK_EQUAL(inverse_ibeta_bisect(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0)); } - else if((1 - data[i][5] > 0.001) - && (fabs(data[i][5]) > 2 * boost::math::tools::min_value()) + else if((1 - data[i][5] > 0.001) + && (fabs(data[i][5]) > 2 * boost::math::tools::min_value()) && (fabs(data[i][5]) > 2 * boost::math::tools::min_value())) { value_type inv = inverse_ibeta_halley(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])); @@ -320,8 +319,5 @@ void test_beta(T, const char* /* name */) BOOST_AUTO_TEST_CASE( test_main ) { test_beta(0.1, "double"); - + } - - -