资 源 简 介
Summary
sbvj is a library for succinct bit vector written in Java.The rank and select functions are defined as follows.Given a static bit vector B of bits numbered from 0 to n - 1,
rank1_B(x): Counts the number of 1"s up to and excluding the position x in B.
select1_B(y): Finds the position of the (y + 1)th 1bit in B.
Requirement
Java7 or later.
Usage
Simple/Dense
rank in constant time
select in O(lg(n)) time
```
// create succinct bit vector.
SuccinctBitVector sbv = new SuccinctBitVector(10);
// set bit.
sbv.setBit(5, 1);
// print bit vector.
sbv.print();
// create auxiliary data structure.
sbv.build(BuildType.SIMPLE);
// get rank value.
long rank = sbv.getRank(6, 1);
// get select value.
long select = sbv.getSelect(0, 1);
// get serialized data.
SuccinctBitVectorData sbvData = sbv.getData();
// get succi