Class HintedBsearchSelect

java.lang.Object
it.unimi.dsi.sux4j.bits.HintedBsearchSelect
All Implemented Interfaces:
Select, Serializable

public class HintedBsearchSelect extends Object implements Select
A hinted binary-search select implementation.

Instances of this class perform selection using a hinted binary search over an underlying Rank9 instance. We use 12.5% additional space for a small inventory.

See Also:
  • Constructor Details

    • HintedBsearchSelect

      public HintedBsearchSelect(Rank9 rank9)
  • Method Details

    • select

      public long select(long rank)
      Description copied from interface: Select
      Returns the position of the bit of given rank. Equivalently, returns the greatest position that is preceded by the specified number of ones.
      Specified by:
      select in interface Select
      Parameters:
      rank - a rank.
      Returns:
      the position of the bit of given rank; if no such bit exists, behavior is undefined .
    • numBits

      public long numBits()
      Description copied from interface: Select
      Returns the overall number of bits allocated by this structure.
      Specified by:
      numBits in interface Select
      Returns:
      the overall number of bits allocated by this structure (not including the bits of the indexed vector).
    • bitVector

      public BitVector bitVector()
      Description copied from interface: Select
      Returns the bit vector indexed by this structure.

      Note that you are not supposed to modify the returned vector.

      Specified by:
      bitVector in interface Select
      Returns:
      the bit vector indexed by this structure.