public class Rank16 extends AbstractRank implements Rank
rank16 implementation.
rank16 is a ranking structure using just 12.6% additional space
and providing fast ranking. It is the natural ranking structure for 128-bit processors.
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
bits |
protected BitVector |
bitVector |
protected short[] |
count |
protected long |
lastOne |
protected long |
numOnes |
protected int |
numWords |
protected long[] |
superCount |
| Constructor and Description |
|---|
Rank16(BitVector bitVector) |
Rank16(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 long[] superCount
protected final short[] count
protected final int numWords
protected final long numOnes
protected final long lastOne
protected final BitVector bitVector
public Rank16(long[] bits,
long length)
public Rank16(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()