Class MappedEliasFanoMonotoneLongBigList

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int l
      The number of lower bits.
      protected long length
      The length of the sequence.
      static java.lang.String LOWER_BITS_EXTENSION  
      protected it.unimi.dsi.fastutil.longs.LongMappedBigList lowerBits
      The list of lower bits of each element, stored explicitly.
      protected long lowerBitsMask
      The mask for the lower bits.
      static java.lang.String OBJECT_EXTENSION  
      protected SimpleBigSelect selectUpper
      The select structure used to extract the upper bits.
      protected long[][] upperBits
      The upper bits, stored as unary gaps.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      MappedEliasFanoMonotoneLongBigList copy()  
      long[] get​(long index, long[] dest)
      Extracts a number of consecutive entries into a given array.
      long[] get​(long index, long[] dest, int offset, int length)
      Extracts a number of consecutive entries into a given array fragment.
      long getDelta​(long index)
      Returns the difference between two consecutive elements of the sequence.
      long getLong​(long index)
      Returns the element at the specified position.
      MappedEliasFanoMonotoneLongBigList.MappedEliasFanoMonotoneLongBigListIterator iterator()
      Returns a list iterator over the values of this MappedEliasFanoMonotoneLongBigList.
      MappedEliasFanoMonotoneLongBigList.MappedEliasFanoMonotoneLongBigListIterator listIterator()
      Returns a list iterator over the values of this MappedEliasFanoMonotoneLongBigList.
      MappedEliasFanoMonotoneLongBigList.MappedEliasFanoMonotoneLongBigListIterator listIterator​(long from)
      Returns a list iterator over the values of this MappedEliasFanoMonotoneLongBigList.
      static MappedEliasFanoMonotoneLongBigList load​(java.lang.String basename)
      Maps an Elias–Fano monotone list into memory.
      MappedEliasFanoMonotoneLongBigList lowerBits​(java.lang.String lowerBits)
      Maps the lower bits of this list from a file.
      long numBits()  
      long size64()  
      • Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongBigList

        add, add, add, addAll, addAll, addAll, addAll, addElements, addElements, clear, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, forEach, get, getElements, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, peek, peekLong, pop, popLong, push, push, rem, remove, removeElements, removeLong, set, set, setElements, size, size, subList, top, topLong, toString
      • Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection

        add, contains, containsAll, containsAll, forEach, remove, removeAll, removeAll, removeIf, retainAll, retainAll, toArray, toLongArray, toLongArray
      • Methods inherited from class java.util.AbstractCollection

        isEmpty, toArray, toArray
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toArray
      • Methods inherited from interface it.unimi.dsi.fastutil.longs.LongBigList

        addAll, addAll, addAll, addAll, getElements, setElements, setElements, spliterator
      • Methods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection

        add, contains, containsAll, longIterator, longParallelStream, longSpliterator, longStream, parallelStream, remove, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toLongArray, toLongArray
      • Methods inherited from interface it.unimi.dsi.fastutil.longs.LongIterable

        forEach, forEach
      • Methods inherited from interface it.unimi.dsi.fastutil.Stack

        isEmpty
    • Field Detail

      • OBJECT_EXTENSION

        public static final java.lang.String OBJECT_EXTENSION
        See Also:
        Constant Field Values
      • LOWER_BITS_EXTENSION

        public static final java.lang.String LOWER_BITS_EXTENSION
        See Also:
        Constant Field Values
      • length

        protected final long length
        The length of the sequence.
      • l

        protected final int l
        The number of lower bits.
      • upperBits

        protected long[][] upperBits
        The upper bits, stored as unary gaps.
      • lowerBits

        protected it.unimi.dsi.fastutil.longs.LongMappedBigList lowerBits
        The list of lower bits of each element, stored explicitly.
      • selectUpper

        protected final SimpleBigSelect selectUpper
        The select structure used to extract the upper bits.
      • lowerBitsMask

        protected final long lowerBitsMask
        The mask for the lower bits.
    • Constructor Detail

      • MappedEliasFanoMonotoneLongBigList

        protected MappedEliasFanoMonotoneLongBigList​(long length,
                                                     int l,
                                                     long[][] upperBits,
                                                     SimpleBigSelect selectUpper,
                                                     boolean littleEndian)
    • Method Detail

      • load

        public static MappedEliasFanoMonotoneLongBigList load​(java.lang.String basename)
                                                       throws java.io.IOException,
                                                              java.lang.ClassNotFoundException
        Maps an Elias–Fano monotone list into memory.
        Parameters:
        basename - the basename of the dumped list. From the basename, two files will be derived: a serialized object with extension OBJECT_EXTENSION and a list of longs with extension LOWER_BITS_EXTENSION.
        Returns:
        an instance of this class.
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • lowerBits

        public MappedEliasFanoMonotoneLongBigList lowerBits​(java.lang.String lowerBits)
                                                     throws java.io.IOException
        Maps the lower bits of this list from a file.

        This method is low level and should not be used in geneneral. There is no check that the file you are using is actually the right file for this instance.

        Parameters:
        lowerBits - the name of the file containing the lower bits.
        Returns:
        this instance.
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • numBits

        public long numBits()
      • getLong

        public long getLong​(long index)
        Returns the element at the specified position.
        Specified by:
        getLong in interface it.unimi.dsi.fastutil.longs.LongBigList
        Parameters:
        index - a position in the list.
        Returns:
        the element at the specified position; if index is out of bounds, behavior is undefined.
      • getDelta

        public long getDelta​(long index)
        Returns the difference between two consecutive elements of the sequence.
        Parameters:
        index - the index of an element (smaller then size64() - 1).
        Returns:
        the difference between the element of position index + 1 and that of position index; if index is out of bounds, behavior is undefined.
        See Also:
        get(long, long[])
      • get

        public long[] get​(long index,
                          long[] dest,
                          int offset,
                          int length)
        Extracts a number of consecutive entries into a given array fragment.
        Parameters:
        index - the index of the first entry returned.
        dest - the destination array; it will be filled with length consecutive entries starting at position offset; must be of length greater than offset.
        offset - the first position written in dest.
        length - the number of elements written in dest starting at offset.
        Returns:
        dest; if the arguments are out of bounds, behavior is undefined.
        See Also:
        get(long, long[])
      • get

        public long[] get​(long index,
                          long[] dest)
        Extracts a number of consecutive entries into a given array.
        Parameters:
        index - the index of the first entry returned.
        dest - the destination array, of nonzero length; it will be filled with consecutive entries.
        Returns:
        dest; if index is out of bounds or dest has length zero, behavior is undefined.
        See Also:
        get(long, long[], int, int)
      • size64

        public long size64()
        Specified by:
        size64 in interface it.unimi.dsi.fastutil.Size64