Skip to content

Releases: Cydhra/vers

1.6.1 BitVector padding bug

09 Mar 12:46
Compare
Choose a tag to compare

Bugfixes

  • When a BitVec contained non-zero bits in the last limb that were not part of the Vector, either due to using append_bit with extra bits, or by dropping bits from the vector, RsVec::from_bit_vec miscounted the amount of zeros.

Succinct Trees

03 Mar 23:39
Compare
Choose a tag to compare

Balanced Parentheses Trees

The crate has a new data structure: Succinct trees using the well-known BP representation.

  • The tree supports tree navigation to parent, children, and siblings, as well as subtree_size and is_ancestor in O(log n)
  • Further, it supports level-tree navigation (i.e. navigation in level-order), also in O(log n)
  • It supports fast depth-first postorder iteration of the entire tree, or individual subtrees.
  • It exposes the usual internal BP helper functions open, close, enclose, and even fwd_search and bwd_search.
  • It is written to support unbalanced parenthesis expressions without panicking on the navigation functions (iterators excluded).

Sparse RsVec

And another new data structure: A sparse bit vector which supports rank1, select1, and rank0 (among the usual convenience features).
It is a thin wrapper around an Elias-Fano vector.

It can be efficiently constructed from a collection of indices of set bits, or from an existing BitVec.

New APIs

Elias Fano

  • Added a rank(i) and select(i) function (the latter being an alias for get(i))
  • Added a delta(i) function, which returns the delta between entries i - 1 and i.
  • Elias Fano construction is a bit over 5% faster

Bit Vectors

  • Added a function append_bits_unchecked which leaves out some housekeeping that append_bit normally does.
  • Added a function unpack_bits(i, n) as a convenient counterpart to the pack_sequence_* constructors. It is an alias for get_bits(i * n, n), and it has an unchecked version too.

Other Fixes

  • small correction in the documentation for rank and select, clarifying the invariant.

1.5.1 - Wavelet Matrix Serde Support

19 Sep 19:57
Compare
Choose a tag to compare

What's Changed

  • remove redundant bits_per_element, reducing WaveletMatrix struct size by @somethingelseentirely in #12
  • add serde support to WaveletMatrix

New Contributors

1.5.0

09 Aug 20:05
Compare
Choose a tag to compare

New Features

  • Vers now implements a WaveletMatrix to encode arbitrary alphabets. The implementation supports alphabets exceeding 64 bits, but its API works with primitive integers all the same.
  • The Wavelet Matrix supports rank and select queries, predecessor and successor queries, and statistical queries (like range-max, range-min, range-median, range-select-k, ...), and reconstruction of values all in O(k) where k is the alphabet bit size.
  • The Wavelet Matrix supports several iterators over its encoded sequence, including a sorted iterator.

Constructors, Iterators, and Convenience

09 Jul 20:34
Compare
Choose a tag to compare

New Features

  • RsVec implements several comparison methods (sparse_equals, full_equals), as well as the PartialEq trait which dynamically switches between those implementations according to my benchmark results.
  • BitVec and RsVec implement new constructors. Take a look at docs.rs to see what's possible now!
  • BitVec, BinaryRmq, and FastRmq can be created from u64 Iterators.
  • Several constructors are also available as From<T> implementations now
  • Added the simd crate-feature which gates some (unsafe) vectorization in RsVec, and a vectorized alternative iterator (RsVec::bit_set_iter0, RsVec::bit_set_iter1)
  • RsVec::iter1 and RsVec::iter0 now also have an owning version: RsVec::into_iter1
  • RsVec::iter1 and RsVec::iter0 are now double-ended iterators

Improvements

  • Added several examples to the documentation of BitVec
  • Iterating an Elias-Fano Vector is about 20% faster now
  • FastRMQ is 3-4% faster on vectors that fit in L3

Fixes

  • BitVec::get_bits and RsVec::get_bits could fail when querying 64 bits from an index not aligned to the vector limbs

Another bug in select iterators removed by simplification

28 Jun 20:05
Compare
Choose a tag to compare

The select iterators failed under certain conditions because they attempted to select bits from the limb that contained the last returned element, even if that limb does not contain any more set bits. This happened because the iterator forgot to account for popcounts in limbs preceding the current limb. The iterator now no longer keeps track of which limb contained the last selected bit, since searching the limb every time is essentially free due to caching effects.
Searching it every time forces the iterator to keep track of all bits, even if they are spread across multiple limbs in a block.

Bugfix in select-1 iterator

25 Jun 18:21
Compare
Choose a tag to compare

Fixed Issue #6

  • the select1 iterator (iter1) could fail on bit vectors with more than one super-block because the number of ones in super-blocks was calculated wrongly while iterating

Replaced extant intrinsics with util function

11 Apr 23:33
Compare
Choose a tag to compare

Hotfix patch

  • Fix: The pdep fallback wasn't implemented in FastRMQ, which meant the crate would not compile outside of x86_64 targets.
  • Fix: The documentation still stated that the intrinsics were forcibly enabled (which they were due to the previous bug, but now they aren't).
  • General touch-up of the documentation

Fallback implementations for non-x86 platforms

11 Apr 00:39
Compare
Choose a tag to compare

This release provides fallbacks for the pdep intrinsic, which removes the necessity for the BMI2 feature.
Obviously, the crate is pretty slow without BMI2, but it can now theoretically be used on all platforms.
I also included a small benchmark for space overhead, and I am happy to report that Vers crushes its competitors in this regard.

Changed parameters for docs.rs

02 Mar 15:00
Compare
Choose a tag to compare

This release changes nothing but remove a space from an argument given to docs.rs for building documentation, because docs.rs is terrible at parsing CLI args apparently.