jltsiren / simple-sds

Simple succinct data structures (in Rust)
MIT License
45 stars 7 forks source link

Wavelet matrix #13

Closed jltsiren closed 1 year ago

jltsiren commented 1 year 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.