Class WaveletTreeNoptrs allows me to specify a Mapper. I've implemented a custom mapper which maps most elements to 0 and a couple interesting ones to nonzero.
The constructor WaveletTreeNoptrs::WaveletTreeNoptrs(const Array & a, BitSequenceBuilder * bmb, Mapper * am) computes max_v = am->map(a.getMax()); and then sets height=bits(max_v);
When the maximum of the original values gets mapped to 0, the code sets the height of the tree to 0.
Perhaps I am missing the point but I suspect this is unintended?
Class WaveletTreeNoptrs allows me to specify a Mapper. I've implemented a custom mapper which maps most elements to 0 and a couple interesting ones to nonzero.
The constructor
WaveletTreeNoptrs::WaveletTreeNoptrs(const Array & a, BitSequenceBuilder * bmb, Mapper * am)
computesmax_v = am->map(a.getMax());
and then setsheight=bits(max_v);
When the maximum of the original values gets mapped to 0, the code sets the height of the tree to 0.
Perhaps I am missing the point but I suspect this is unintended?