public class SimpleSelectZero extends Object implements SelectZero
This implementation uses around 13.75% additional space on evenly distributed bit arrays, and, under the same conditions, provide very fast selects. For very unevenly distributed arrays the space occupancy will grow significantly, and access time might vary wildly.
| Constructor and Description |
|---|
SimpleSelectZero(BitVector bitVector)
Creates a new selection structure using the specified bit vector.
|
SimpleSelectZero(long[] bits,
long length)
Creates a new selection structure using a bit vector specified by an array of longs and a number of bits.
|
| Modifier and Type | Method and Description |
|---|---|
BitVector |
bitVector()
Returns the bit vector indexed by this structure.
|
long |
numBits()
Returns the overall number of bits allocated by this structure.
|
long |
selectZero(long rank)
Returns the position of the bit of given rank.
|
public SimpleSelectZero(long[] bits,
long length)
bits - an array of longs representing a bit array.length - the number of bits to use from bits.public SimpleSelectZero(BitVector bitVector)
bitVector - a bit vector.public long selectZero(long rank)
SelectZeroselectZero in interface SelectZerorank - a rank.public long numBits()
SelectZeronumBits in interface SelectZeropublic BitVector bitVector()
SelectZeroNote that you are not supposed to modify the returned vector.
bitVector in interface SelectZero