35template <
class Impl, WaveletTreeSymbol Symbol>
42 std::size_t
size()
const {
return impl().size_impl(); }
56 std::size_t
rank(Symbol symbol, std::size_t end_position)
const {
57 return impl().rank_impl(symbol, end_position);
66 std::size_t
select(Symbol symbol, std::size_t
rank)
const {
67 return impl().select_impl(symbol,
rank);
76 std::vector<Symbol>
get_segment(std::size_t begin, std::size_t end)
const {
77 return impl().get_segment_impl(begin, end);
82 const Impl& impl()
const {
return static_cast<const Impl&
>(*this); }
CRTP facade for wavelet-tree queries.
Definition wavelet_tree.h:36
std::size_t size() const
Return the number of symbols in the indexed sequence.
Definition wavelet_tree.h:42
std::size_t rank(Symbol symbol, std::size_t end_position) const
Count occurrences of symbol in [0, end_position).
Definition wavelet_tree.h:56
std::vector< Symbol > get_segment(std::size_t begin, std::size_t end) const
Reconstruct the sequence range [@p begin, @p end).
Definition wavelet_tree.h:76
std::size_t select(Symbol symbol, std::size_t rank) const
Return the position of the rank-th occurrence of symbol.
Definition wavelet_tree.h:66
bool empty() const
Check whether the indexed sequence is empty.
Definition wavelet_tree.h:48
Unsigned code-unit type indexed by a wavelet tree.
Definition wavelet_tree.h:23
WaveletTreeBuildType
Construction strategy for a wavelet-tree implementation.
Definition wavelet_tree.h:19