jltsiren / simple-sds

Simple succinct data structures (in Rust)
MIT License
47 stars 8 forks source link

Wavelet matrix #13

Closed jltsiren closed 2 years ago

jltsiren commented 2 years ago

This PR adds WaveletMatrix: a plain balanced wavelet matrix implementation similar to sdsl::wm_int. The structure implements Vector, Access, and VectorIndex traits, making it an immutable integer vector that supports rank/select type queries.

VectorIndex is a new trait for rank/select-type queries over all item values in the vector.

There are also improvements to the Access trait. It now includes a read-only iterator over the vector, with AccessIter as an almost-default implementation based on Access::get.