diff --git a/example/daubechies_wavelets/find_best_daubechies_interpolator.cpp b/example/daubechies_wavelets/find_best_daubechies_interpolator.cpp index 03d19f3ba..a495d1059 100644 --- a/example/daubechies_wavelets/find_best_daubechies_interpolator.cpp +++ b/example/daubechies_wavelets/find_best_daubechies_interpolator.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include #include @@ -39,7 +41,7 @@ void choose_refinement() auto phi_dense = boost::math::detail::dyadic_grid(rmax); Real dx_dense = (2*p-1)/static_cast(phi_dense.size()-1); - for (int r = 2; r <= 12; ++r) + for (int r = 2; r <= 18; ++r) { Real dx = Real(1)/ (1 << r); std::cout << "\tdx = 1/" << (1/dx) << " = 1/2^" << r << " = " << dx << "\n"; @@ -104,7 +106,7 @@ void find_best_interpolator() std::ofstream fs{filename}; static_assert(sizeof(PreciseReal) >= sizeof(Real), "sizeof(PreciseReal) >= sizeof(Real) is required."); using std::abs; - int rmax = 17; + int rmax = 18; std::cout << "Computing phi_dense_precise\n"; auto phi_dense_precise = boost::math::detail::dyadic_grid(rmax); std::vector phi_dense(phi_dense_precise.size()); @@ -135,7 +137,7 @@ void find_best_interpolator() fs << "\n"; } } - for (int r = 2; r < rmax-1; ++r) + for (int r = 2; r < 13; ++r) { fs << r << ", "; std::map m; @@ -526,50 +528,8 @@ void find_best_interpolator() } } -int main() { - /*choose_refinement(); - choose_refinement(); - choose_refinement(); - choose_refinement(); - choose_refinement(); - choose_refinement(); - choose_refinement();*/ - - choose_refinement(); - choose_refinement(); - choose_refinement(); - choose_refinement(); - choose_refinement(); - choose_refinement(); - choose_refinement(); - //choose_refinement(); - //choose_refinement(); - // Says linear interpolation is the best: - /*find_best_interpolator(); - // Says linear interpolation is the best: - find_best_interpolator(); - // Says cubic_hermite_spline is best: - find_best_interpolator(); - // Says cubic_hermite_spline is best: - find_best_interpolator(); - // Says quintic_hermite_spline is best: - find_best_interpolator(); - // Says quintic_hermite_spline is best: - find_best_interpolator(); - // Says quintic_hermite_spline is best: - find_best_interpolator(); - // Says quintic_hermite_spline is best: - find_best_interpolator(); - // Says septic_hermite_spline is best: - find_best_interpolator(); - // Says septic_hermite_spline is best: - find_best_interpolator(); - // Says septic_hermite_spline is best: - find_best_interpolator(); - // Says septic_hermite_spline is best: - find_best_interpolator(); - // Says septic_hermite_spline is best: - find_best_interpolator(); - // Says septic_hermite_spline is best: - find_best_interpolator();*/ +int main() +{ + boost::hana::for_each(std::make_index_sequence<4>(), [&](auto i){ choose_refinement(); }); + boost::hana::for_each(std::make_index_sequence<4>(), [&](auto i){ find_best_interpolator(); }); } diff --git a/include/boost/math/special_functions/daubechies_scaling.hpp b/include/boost/math/special_functions/daubechies_scaling.hpp index d379d165f..89ade5454 100644 --- a/include/boost/math/special_functions/daubechies_scaling.hpp +++ b/include/boost/math/special_functions/daubechies_scaling.hpp @@ -248,7 +248,7 @@ public: { // Control absolute error: // p= 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 - std::array r{-1, -1, 18, 19, 16, 11, 8, 7, 7, 7, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4}; + std::array r{-1, -1, 18, 19, 16, 11, 8, 7, 7, 7, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3}; grid_refinements = r[p]; } else diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index e43152572..be1d60e68 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -943,7 +943,8 @@ test-suite misc : [ run jacobi_test.cpp : : : [ requires cxx11_auto_declarations cxx11_constexpr cxx11_smart_ptr cxx11_defaulted_functions ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] ] [ run gegenbauer_test.cpp : : : [ requires cxx11_auto_declarations cxx11_constexpr cxx11_smart_ptr cxx11_defaulted_functions ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] ] [ run daubechies_scaling_test.cpp : : : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] ] - [ compile compile_test/daubechies_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] ] + [ compile compile_test/daubechies_filter_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] ] + [ compile compile_test/daubechies_scaling_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] ] [ run whittaker_shannon_test.cpp : : : [ requires cxx11_auto_declarations cxx11_constexpr cxx11_smart_ptr cxx11_defaulted_functions ] ] [ run cardinal_quadratic_b_spline_test.cpp : : : [ requires cxx11_auto_declarations cxx11_constexpr cxx11_smart_ptr cxx11_defaulted_functions ] ] [ run cardinal_quintic_b_spline_test.cpp : : : [ requires cxx11_auto_declarations cxx11_constexpr cxx11_smart_ptr cxx11_defaulted_functions ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] ] diff --git a/test/compile_test/daubechies_incl_test.cpp b/test/compile_test/daubechies_filters_incl_test.cpp similarity index 100% rename from test/compile_test/daubechies_incl_test.cpp rename to test/compile_test/daubechies_filters_incl_test.cpp diff --git a/test/compile_test/daubechies_scaling_incl_test.cpp b/test/compile_test/daubechies_scaling_incl_test.cpp new file mode 100644 index 000000000..7c983c583 --- /dev/null +++ b/test/compile_test/daubechies_scaling_incl_test.cpp @@ -0,0 +1,21 @@ +// Copyright Nick Thompson 2020. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// +#include +// +// Note this header includes no other headers, this is +// important if this test is to be meaningful: +// +#include "test_compile_result.hpp" + +void compile_and_link_test() +{ + double x = 0; + auto daub3 = boost::math::daubechies_scaling(5); + check_result(daub3(x)); +} diff --git a/test/cubic_hermite_test.cpp b/test/cubic_hermite_test.cpp index 8b1636768..6d75c2883 100644 --- a/test/cubic_hermite_test.cpp +++ b/test/cubic_hermite_test.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include #ifdef BOOST_HAS_FLOAT128