public class Rank11 extends AbstractRank implements Rank
rank11 implementation.
rank11 is a ranking structure using 6.25% additional space and providing very fast ranking.
It was proposed by Simon Gog and Matthias Petri in “Optimized succinct data structures for massive data”,
Softw. Pract. Exper., 2014. The only difference between this implementation and their
rank_support_v5 is that counts for blocks are stored as in Rank9 (that is, in opposite order).
Note that to achieve such a low overhead, rank(long) contains a loop. As
a consequence, the implementation of this method is significantly
slower than that of Rank9 or Rank16, which don't do any looping.
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
bits |
protected BitVector |
bitVector |
protected long[] |
count |
protected long |
lastOne |
protected long |
numOnes |
protected int |
numWords |
| Constructor and Description |
|---|
Rank11(BitVector bitVector) |
Rank11(long[] bits,
long length) |
| Modifier and Type | Method and Description |
|---|---|
BitVector |
bitVector()
Returns the bit vector indexed by this structure.
|
long |
count()
Returns the number of ones in the bit vector indexed by this class.
|
long |
lastOne() |
long |
numBits()
Returns the overall number of bits allocated by this structure.
|
long |
rank(long pos)
Returns the number of ones preceding the specified position.
|
long |
rank(long from,
long to)
Returns the number of ones in the specified interval.
|
rankZero, rankZeroprotected transient long[] bits
protected final BitVector bitVector
protected final long[] count
protected final int numWords
protected final long numOnes
protected final long lastOne
public Rank11(long[] bits,
long length)
public Rank11(BitVector bitVector)
public long rank(long pos)
Rankpublic long numBits()
RanknumBits in interface Rankpublic long count()
Rankcount in interface Rankcount in class AbstractRankpublic long rank(long from,
long to)
Rankrank in interface Rankrank in class AbstractRankfrom - a position in the bit vector.to - a position in the bit vector.from (inclusive) and to (exclusive); if
to is smaller than from, 0 is returned.public long lastOne()