mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Remove some internal dependencies for Daubechies wavelets. (#356)
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#include <cstdint>
|
||||
#include <cmath>
|
||||
#include <boost/math/quadrature/wavelet_transforms.hpp>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
|
||||
int main()
|
||||
@@ -23,10 +22,8 @@ int main()
|
||||
|
||||
auto Wf = daubechies_wavelet_transform<decltype(f), double, 8>(f);
|
||||
|
||||
Eigen::MatrixXd grid(512, 512);
|
||||
double s = 7;
|
||||
double t = 0;
|
||||
grid(0,0) = Wf(s, t);
|
||||
|
||||
auto g = [&a](double t)->std::complex<double> {
|
||||
if (t==0) {
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <thread>
|
||||
#include <future>
|
||||
#include <iostream>
|
||||
#include <boost/math/constants/constants.hpp>
|
||||
#include <boost/math/special_functions/detail/daubechies_scaling_integer_grid.hpp>
|
||||
#include <boost/math/filters/daubechies.hpp>
|
||||
#include <boost/math/interpolators/detail/cubic_hermite_detail.hpp>
|
||||
@@ -26,8 +25,9 @@ template<class Real, int p, int order>
|
||||
std::vector<Real> daubechies_scaling_dyadic_grid(int64_t j_max)
|
||||
{
|
||||
using std::isnan;
|
||||
using std::sqrt;
|
||||
auto c = boost::math::filters::daubechies_scaling_filter<Real, p>();
|
||||
Real scale = boost::math::constants::root_two<Real>()*(1 << order);
|
||||
Real scale = sqrt(static_cast<Real>(2))*(1 << order);
|
||||
for (auto & x : c)
|
||||
{
|
||||
x *= scale;
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
#include <boost/hana/for_each.hpp>
|
||||
#include <boost/hana/ext/std/integer_sequence.hpp>
|
||||
#include <boost/math/tools/condition_numbers.hpp>
|
||||
#include <boost/math/differentiation/finite_difference.hpp>
|
||||
#include <boost/math/special_functions/daubechies_scaling.hpp>
|
||||
#include <boost/math/filters/daubechies.hpp>
|
||||
#include <boost/math/special_functions/detail/daubechies_scaling_integer_grid.hpp>
|
||||
#include <boost/math/constants/constants.hpp>
|
||||
#include <boost/math/quadrature/trapezoidal.hpp>
|
||||
#include <boost/math/special_functions/next.hpp>
|
||||
|
||||
@@ -28,10 +26,7 @@
|
||||
using boost::multiprecision::float128;
|
||||
#endif
|
||||
|
||||
|
||||
using boost::math::constants::pi;
|
||||
using boost::math::constants::root_two;
|
||||
|
||||
using std::sqrt;
|
||||
// Mallat, Theorem 7.4, characterization number 3:
|
||||
// A conjugate mirror filter has p vanishing moments iff h^{(n)}(pi) = 0 for 0 <= n < p.
|
||||
template<class Real, unsigned p>
|
||||
@@ -55,7 +50,7 @@ void test_daubechies_filters()
|
||||
{
|
||||
H0 += h[j];
|
||||
}
|
||||
CHECK_MOLLIFIED_CLOSE(root_two<Real>(), H0, tol);
|
||||
CHECK_MOLLIFIED_CLOSE(sqrt(static_cast<Real>(2)), H0, tol);
|
||||
|
||||
// This is implied if we choose the scaling function to be an orthonormal basis of V0.
|
||||
Real scaling = 0;
|
||||
|
||||
Reference in New Issue
Block a user