math icon indicating copy to clipboard operation
math copied to clipboard

Untested and dead code in daubechies_scaling.hpp

Open jzmaddock opened this issue 1 year ago • 3 comments

Probably one for @NAThompson.

In daubechies_scaling.hpp

We have one line uncovered here: https://github.com/boostorg/math/blob/2af21de3b7f9935c2818eab7be6eaf2211e4672c/include/boost/math/special_functions/daubechies_scaling.hpp#L367 which appears to be because the constructor is never called in our tests with anything except the default value for grid_refinements. We should have at least one absolute error (-2) value, plus one other positive value. But I'm not sure which tests and invariants hold in these cases?

Also the types detail::matched_holder and detail::linear_interpolation appear not to be used by anything, nor mentioned in the docs?

jzmaddock avatar Feb 22 '24 17:02 jzmaddock

Sorry, one other, there are no tests for double_prime() other than the boundary cases. Again I'm not sure how to validate the result?

jzmaddock avatar Feb 22 '24 17:02 jzmaddock

And one more, daubechies_wavelet.hpp is also untested for anything except default argument to daubechies_wavelet. The code for p==1 here: https://github.com/boostorg/math/blob/2af21de3b7f9935c2818eab7be6eaf2211e4672c/include/boost/math/special_functions/daubechies_wavelet.hpp#L212 is also untested.

jzmaddock avatar Feb 22 '24 18:02 jzmaddock

@jzmaddock : Yup, you're right. Will try to get to this next week.

NAThompson avatar Feb 23 '24 00:02 NAThompson