Class BufferFastAggregation


  • public final class BufferFastAggregation
    extends Object
    Fast algorithms to aggregate many bitmaps.
    Author:
    Daniel Lemire
    • Method Detail

      • and

        public static MutableRoaringBitmap and​(ImmutableRoaringBitmap... bitmaps)
        Compute the AND aggregate. In practice, calls {#link naive_and}
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
      • and

        public static MutableRoaringBitmap and​(Iterator bitmaps)
        Compute the AND aggregate. In practice, calls {#link naive_and}
        Parameters:
        bitmaps - input bitmaps (ImmutableRoaringBitmap or MutableRoaringBitmap)
        Returns:
        aggregated bitmap
      • and

        public static MutableRoaringBitmap and​(MutableRoaringBitmap... bitmaps)
        Compute the AND aggregate. In practice, calls {#link naive_and}
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
      • convertToImmutable

        public static Iterator<ImmutableRoaringBitmap> convertToImmutable​(Iterator<MutableRoaringBitmap> i)
        Convenience method converting one type of iterator into another, to avoid unnecessary warnings.
        Parameters:
        i - input bitmaps
        Returns:
        an iterator over the provided iterator, with a different type
      • horizontal_or

        public static MutableRoaringBitmap horizontal_or​(ImmutableRoaringBitmap... bitmaps)
        Minimizes memory usage while computing the or aggregate on a moderate number of bitmaps. This function runs in linearithmic (O(n log n)) time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
        See Also:
        or(ImmutableRoaringBitmap...)
      • horizontal_or

        @Deprecated
        public static MutableRoaringBitmap horizontal_or​(Iterator bitmaps)
        Deprecated.
        Calls naive_or.
        Parameters:
        bitmaps - input bitmaps (ImmutableRoaringBitmap or MutableRoaringBitmap)
        Returns:
        aggregated bitmap
      • horizontal_or

        public static MutableRoaringBitmap horizontal_or​(MutableRoaringBitmap... bitmaps)
        Minimizes memory usage while computing the or aggregate on a moderate number of bitmaps. This function runs in linearithmic (O(n log n)) time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
        See Also:
        or(ImmutableRoaringBitmap...)
      • horizontal_xor

        public static MutableRoaringBitmap horizontal_xor​(ImmutableRoaringBitmap... bitmaps)
        Minimizes memory usage while computing the xor aggregate on a moderate number of bitmaps. This function runs in linearithmic (O(n log n)) time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
        See Also:
        xor(ImmutableRoaringBitmap...)
      • horizontal_xor

        public static MutableRoaringBitmap horizontal_xor​(MutableRoaringBitmap... bitmaps)
        Minimizes memory usage while computing the xor aggregate on a moderate number of bitmaps. This function runs in linearithmic (O(n log n)) time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
        See Also:
        xor(ImmutableRoaringBitmap...)
      • naive_and

        public static MutableRoaringBitmap naive_and​(ImmutableRoaringBitmap... bitmaps)
        Compute overall AND between bitmaps two-by-two. This function runs in linear time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
      • naive_and

        public static MutableRoaringBitmap naive_and​(Iterator bitmaps)
        Compute overall AND between bitmaps two-by-two. This function runs in linear time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps (ImmutableRoaringBitmap or MutableRoaringBitmap)
        Returns:
        aggregated bitmap
      • naive_and

        public static MutableRoaringBitmap naive_and​(MutableRoaringBitmap... bitmaps)
        Compute overall AND between bitmaps two-by-two. This function runs in linear time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
      • naive_or

        public static MutableRoaringBitmap naive_or​(ImmutableRoaringBitmap... bitmaps)
        Compute overall OR between bitmaps two-by-two. This function runs in linear time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
      • naive_or

        public static MutableRoaringBitmap naive_or​(Iterator bitmaps)
        Compute overall OR between bitmaps two-by-two. This function runs in linear time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps (ImmutableRoaringBitmap or MutableRoaringBitmap)
        Returns:
        aggregated bitmap
      • naive_or

        public static MutableRoaringBitmap naive_or​(MutableRoaringBitmap... bitmaps)
        Compute overall OR between bitmaps two-by-two. This function runs in linear time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
      • naive_xor

        public static MutableRoaringBitmap naive_xor​(ImmutableRoaringBitmap... bitmaps)
        Compute overall XOR between bitmaps two-by-two. This function runs in linear time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
      • naive_xor

        public static MutableRoaringBitmap naive_xor​(Iterator bitmaps)
        Compute overall XOR between bitmaps two-by-two. This function runs in linear time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps (ImmutableRoaringBitmap or MutableRoaringBitmap)
        Returns:
        aggregated bitmap
      • naive_xor

        public static MutableRoaringBitmap naive_xor​(MutableRoaringBitmap... bitmaps)
        Compute overall XOR between bitmaps two-by-two. This function runs in linear time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
      • or

        public static MutableRoaringBitmap or​(Iterator bitmaps)
        Compute overall OR between bitmaps.
        Parameters:
        bitmaps - input bitmaps (ImmutableRoaringBitmap or MutableRoaringBitmap)
        Returns:
        aggregated bitmap
      • priorityqueue_or

        public static MutableRoaringBitmap priorityqueue_or​(Iterator bitmaps)
        Uses a priority queue to compute the or aggregate. This function runs in linearithmic (O(n log n)) time with respect to the number of bitmaps.
        Parameters:
        bitmaps - input bitmaps
        Returns:
        aggregated bitmap
        See Also:
        horizontal_or(ImmutableRoaringBitmap...)
      • xor

        public static MutableRoaringBitmap xor​(Iterator bitmaps)
        Compute overall XOR between bitmaps.
        Parameters:
        bitmaps - input bitmaps (ImmutableRoaringBitmap or MutableRoaringBitmap)
        Returns:
        aggregated bitmap