refactor WaveletMatrix.hpp