|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.sux4j.bits.AbstractRank
it.unimi.dsi.sux4j.bits.Rank9
public class Rank9
A rank9
implementation.
rank9
is a
ranking structure using just 25% additional space
and providing exceptionally fast ranking (on an Opteron at 2800 MHz this class
ranks a million-bit array in less than 8 nanoseconds).
Field Summary | |
---|---|
protected long[] |
bits
|
protected BitVector |
bitVector
|
protected long[] |
count
|
protected long |
lastOne
|
protected long |
numOnes
|
protected int |
numWords
|
Constructor Summary | |
---|---|
Rank9(BitVector bitVector)
|
|
Rank9(long[] bits,
long length)
|
Method Summary | |
---|---|
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. |
Methods inherited from class it.unimi.dsi.sux4j.bits.AbstractRank |
---|
rankZero, rankZero |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface it.unimi.dsi.sux4j.bits.Rank |
---|
rankZero, rankZero |
Field Detail |
---|
protected transient long[] bits
protected final BitVector bitVector
protected final long[] count
protected final int numWords
protected final long numOnes
protected final long lastOne
Constructor Detail |
---|
public Rank9(long[] bits, long length)
public Rank9(BitVector bitVector)
Method Detail |
---|
public long rank(long pos)
Rank
rank
in interface Rank
pos
- a position in the bit vector.
pos
.public long numBits()
Rank
numBits
in interface Rank
public long count()
Rank
count
in interface Rank
count
in class AbstractRank
public long rank(long from, long to)
Rank
rank
in interface Rank
rank
in class AbstractRank
from
- 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()
public BitVector bitVector()
Rank
Note that you are not supposed to modify the returned vector.
bitVector
in interface Rank
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |