Class SimpleBigSelectZero

java.lang.Object
it.unimi.dsi.sux4j.bits.SimpleBigSelectZero
All Implemented Interfaces:
SelectZero, Serializable

public class SimpleBigSelectZero extends Object implements SelectZero
A big version of SimpleSelectZero that can only be used with a LongBigArrayBitVector (or long big arrays).
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleBigSelectZero(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.
    SimpleBigSelectZero(it.unimi.dsi.bits.LongBigArrayBitVector bitVector)
    Creates a new selection structure using the specified instance of LongArrayBitVector.
  • Method Summary

    Modifier and Type
    Method
    Description
    it.unimi.dsi.bits.LongBigArrayBitVector
    Returns the bit vector indexed by this structure.
    long
    Returns the overall number of bits allocated by this structure.
    long
    selectZero(long rank)
    Returns the position of the bit of given zero rank.
    long[]
    selectZero(long rank, long[] dest)
    Performs a bulk select of consecutive zero ranks into a given array.
    long[]
    selectZero(long rank, long[] dest, int offset, int length)
    Performs a bulk select of consecutive zero ranks into a given array fragment.

    Methods inherited from class java.lang.Object

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

    • SimpleBigSelectZero

      public SimpleBigSelectZero(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 from bits.
    • SimpleBigSelectZero

      public SimpleBigSelectZero(it.unimi.dsi.bits.LongBigArrayBitVector bitVector)
      Creates a new selection structure using the specified instance of LongArrayBitVector.
      Parameters:
      bitVector - an instance of LongArrayBitVector.
  • Method Details

    • selectZero

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

      public long[] selectZero(long rank, long[] dest, int offset, int length)
      Description copied from interface: SelectZero
      Performs a bulk select of consecutive zero ranks into a given array fragment.
      Specified by:
      selectZero in interface SelectZero
      Parameters:
      rank - the first zero rank to select.
      dest - the destination array; it will be filled with length positions of consecutive bits starting at position offset; must be of length greater than offset.
      offset - the first bit position written in dest.
      length - the number of bit positions in dest starting at offset.
      Returns:
      dest
      See Also:
    • selectZero

      public long[] selectZero(long rank, long[] dest)
      Description copied from interface: SelectZero
      Performs a bulk select of consecutive zero ranks into a given array.
      Specified by:
      selectZero in interface SelectZero
      Parameters:
      rank - the first zero rank to select.
      dest - the destination array; it will be filled with position of consecutive bits.
      Returns:
      dest
      See Also:
    • numBits

      public long numBits()
      Description copied from interface: SelectZero
      Returns the overall number of bits allocated by this structure.
      Specified by:
      numBits in interface SelectZero
      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: SelectZero
      Returns the bit vector indexed by this structure.

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

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