This package is now alpha version.
This package exports following operations over bit vectors with extremely fast speed while keeping extra memory usage small:
getindex(bv::IndexableBitVectors, i::Integer)
:i
-th element ofbv
rank(b::Bool, bv::AbstractIndexableBitVector, i::Integer)
: the number of occurrences of bitb
inbv[1:i]
select(b::Bool, bv::AbstractIndexableBitVector, i::Integer)
: the index ofi
-th occurrence ofb
inbv
.
And other shortcuts:
rank0(bv, i)
=rank(false, bv, i)
rank1(bv, i)
=rank(true, bv, i)
select0(bv, i)
=select(0, bv, i)
select1(bv, i)
=select(1, bv, i)
AbstractIndexableBitVector
s:
CompactBitVector
: rank values are precomputed in large and small blocks.SucVector
: similar toCompactBitVector
, but the data layout is different.RRR
: compressible indexable bit vector.RRRNP
: similar toRRR
, but compressed code is decoded on the fly.