Class SimpleBigSelect
java.lang.Object
it.unimi.dsi.sux4j.bits.SimpleBigSelect
- All Implemented Interfaces:
Select, Serializable
A big version of
SimpleSelect that can only be used with a LongBigArrayBitVector
(or long big arrays).- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleBigSelect(long[][] bits, long length) Creates a new selection structure using a bit vector specified by a big array of longs and a number of bits.SimpleBigSelect(it.unimi.dsi.bits.LongBigArrayBitVector bitVector) Creates a new selection structure using the specified instance ofLongArrayBitVector. -
Method Summary
Modifier and TypeMethodDescriptionit.unimi.dsi.bits.LongBigArrayBitVectorReturns the bit vector indexed by this structure.longnumBits()Returns the overall number of bits allocated by this structure.longselect(long rank) Returns the position of the bit of given rank.long[]select(long rank, long[] dest) Performs a bulk select of consecutive ranks into a given array.long[]select(long rank, long[] dest, int offset, int length) Performs a bulk select of consecutive ranks into a given array fragment.
-
Constructor Details
-
SimpleBigSelect
public SimpleBigSelect(long[][] bits, long length) Creates a new selection structure using a bit vector specified by a big array of longs and a number of bits.- Parameters:
bits- a big array of longs representing a bit array.length- the number of bits to use frombits.
-
SimpleBigSelect
public SimpleBigSelect(it.unimi.dsi.bits.LongBigArrayBitVector bitVector) Creates a new selection structure using the specified instance ofLongArrayBitVector.- Parameters:
bitVector- an instance ofLongArrayBitVector.
-
-
Method Details
-
select
public long select(long rank) Description copied from interface:SelectReturns the position of the bit of given rank. Equivalently, returns the greatest position that is preceded by the specified number of ones. -
select
public long[] select(long rank, long[] dest, int offset, int length) Description copied from interface:SelectPerforms a bulk select of consecutive ranks into a given array fragment.- Specified by:
selectin interfaceSelect- Parameters:
rank- the first rank to select.dest- the destination array; it will be filled withlengthpositions of consecutive bits starting at positionoffset; must be of length greater thanoffset.offset- the first bit position written indest.length- the number of bit positions indeststarting atoffset.- Returns:
dest- See Also:
-
select
public long[] select(long rank, long[] dest) Description copied from interface:SelectPerforms a bulk select of consecutive ranks into a given array. -
numBits
public long numBits()Description copied from interface:SelectReturns the overall number of bits allocated by this structure.- Specified by:
numBitsin interfaceSelect- Returns:
- the overall number of bits allocated by this structure (not including the bits of the indexed vector).
-
bitVector
public it.unimi.dsi.bits.LongBigArrayBitVector bitVector()Description copied from interface:SelectReturns the bit vector indexed by this structure.Note that you are not supposed to modify the returned vector.
-