#bitmap #bitset #dense

bitsets

BitSet implementations: Dense, Compressed, Memory-Mapped, and Roaring

2 releases

Uses old Rust 2015

0.1.1 Oct 20, 2018
0.1.0 Jun 10, 2018

#2437 in Data structures

33 downloads per month

MIT license

13KB
204 lines

bitsets

Various heap-allocated bitset implementations in Rust.

At the moment we provide a DenseBitSet datastructure, and plan to provide compressed and memory-mapped bitsets in the near future.

Usage

use bitsets::DenseBitSet;

let A = DenseBitSet::from_bits(0b1001100000100010);
let B = DenseBitSet::from_bits(0b1001100000100010);
let C = A.or(&B);

lib.rs:

A dense bit set implemented over std::Vec

Examples

use bitsets::DenseBitSet

let mut bs = DenseBitSet::with_capacity(1024);

bs.set(5);
bs.set(6);
bs.set(15);

if (bs.test(5) && !bs.test(13)) {
  println!("Hey it works!");
}

No runtime deps