Skip to content

Commit

Permalink
more documentation about the constructor variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Cydhra committed Aug 8, 2024
1 parent 83e7af3 commit e040254
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/wavelet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ use std::ops::Range;
/// The implementation is designed to allow for extremely large alphabet sizes, without
/// sacrificing performance for small alphabets.
///
/// Encodes a sequence of `n` `k`-bit words into a wavelet matrix which supports constant-time
/// There are two constructor algorithms available:
/// - [`from_bit_vec`] and [`from_slice`] construct the wavelet matrix by repeatedly sorting the elements.
/// These constructors have linear space overhead and run in `O(kn * log n)` time complexity.
/// - [`from_bit_vec_pc`] and [`from_slice_pc`] construct the wavelet matrix by counting the
/// prefixes of the elements. These constructors have a space complexity of `O(2^k)` and run
/// in `O(kn)`, which makes this constructor preferable for large sequences over small alphabets.
///
/// They encode a sequence of `n` `k`-bit words into a wavelet matrix which supports constant-time
/// rank and select queries on elements of its `k`-bit alphabet.
/// All query functions are mirrored for both `BitVec` and `u64` query elements, so
/// if `k <= 64`, no heap allocation is needed for the query element.
Expand Down

0 comments on commit e040254

Please sign in to comment.