This library was written as part of CMSC858D - Algorithms, Data Structures and Inference for High-throughput Genomics Class Homework.
The official version of the library is hosted on github at this repository, while crates.io version is hosted at this page.
You can download the source code from github and build the project using cargo build
or add it to your project as a dependency from crates.io.
Below are some ways to instantiate and use given constructs.
```rust use bvrs::BitVec;
let size = 16; let b1 = BitVec::newwithrandom(size); let b2 = BitVec::newwithzeros(size); let b3 = BitVec::newwithvec(vec![0b10010001, 0b10000001]); let b4 = BitVec::new(size); // uses new with zeros let b5 = b1 + b2; let b6 = b1.incr(); let b7 = b1.concat(&b2); let b8 = b1.extract(0, 7); let bit = b1.get(2); ```
```rust use bvrs::BitVec; use bvrs::RankSupport;
let size = 16; let b1 = BitVec::newwithrandom(size); let r = RankSupport::new(&b); let index = 3; let res = r.rank1(index); let resprime = RankSupport::dummyrank(&b, index); r.save("example.txt"); let r2 = RankSupport::load("example.txt".to_owned()).unwrap(); ```
```rust use bvrs::BitVec; use bvrs::RankSupport; use bvrs::SelectSupport;
let b = BitVec::newwithrandom(size); let r = RankSupport::new(&b); let s = SelectSupport::new(Cow::Borrowed(&r)); let select = s.select1(3); ```
```rust use bvrs::SparseArray;
let size = 32;
let mut sa: SparseArray
```