Class Select9

  • All Implemented Interfaces:
    Select, java.io.Serializable

    public class Select9
    extends java.lang.Object
    implements Select
    A select9 implementation.

    select9 is based on an underlying rank9 instance and uses 25%-37.5% additional space (beside the 25% due to rank9), depending on density. It guarantees practical constant time evaluation.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Select9​(Rank9 rank9)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      it.unimi.dsi.bits.BitVector bitVector()
      Returns the bit vector indexed by this structure.
      long numBits()
      Returns the overall number of bits allocated by this structure.
      long select​(long rank)
      Returns the position of the bit of given rank.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Select9

        public Select9​(Rank9 rank9)
    • Method Detail

      • 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 it.unimi.dsi.bits.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.