Class FastAggregation32

java.lang.Object
com.googlecode.javaewah32.FastAggregation32

public final class FastAggregation32 extends Object
Fast algorithms to aggregate many bitmaps. These algorithms are just given as reference. They may not be faster than the corresponding methods in the EWAHCompressedBitmap class.
Author:
Daniel Lemire
  • Method Details

    • bufferedand

      public static EWAHCompressedBitmap32 bufferedand(int bufSize, EWAHCompressedBitmap32... bitmaps)
      Compute the and aggregate using a temporary uncompressed bitmap. This function does not seek to match the "sizeinbits" attributes of the input bitmaps.
      Parameters:
      bitmaps - the source bitmaps
      bufSize - buffer size used during the computation in 64-bit words (per input bitmap)
      Returns:
      the or aggregate.
    • bufferedandWithContainer

      public static void bufferedandWithContainer(BitmapStorage32 container, int bufSize, EWAHCompressedBitmap32... bitmaps)
      Compute the and aggregate using a temporary uncompressed bitmap. This function does not seek to match the "sizeinbits" attributes of the input bitmaps.
      Parameters:
      container - where the aggregate is written
      bufSize - buffer size used during the computation in 64-bit words (per input bitmap)
      bitmaps - the source bitmaps
    • bufferedor

      public static EWAHCompressedBitmap32 bufferedor(int bufSize, EWAHCompressedBitmap32... bitmaps)
      Compute the or aggregate using a temporary uncompressed bitmap.
      Parameters:
      bitmaps - the source bitmaps
      bufSize - buffer size used during the computation in 64-bit words
      Returns:
      the or aggregate.
    • bufferedorWithContainer

      public static void bufferedorWithContainer(BitmapStorage32 container, int bufSize, EWAHCompressedBitmap32... bitmaps)
      Compute the or aggregate using a temporary uncompressed bitmap.
      Parameters:
      container - where the aggregate is written
      bufSize - buffer size used during the computation in 64-bit words
      bitmaps - the source bitmaps
    • bufferedxor

      public static EWAHCompressedBitmap32 bufferedxor(int bufSize, EWAHCompressedBitmap32... bitmaps)
      Compute the xor aggregate using a temporary uncompressed bitmap.
      Parameters:
      bitmaps - the source bitmaps
      bufSize - buffer size used during the computation in 64-bit words
      Returns:
      the xor aggregate.
    • bufferedxorWithContainer

      public static void bufferedxorWithContainer(BitmapStorage32 container, int bufSize, EWAHCompressedBitmap32... bitmaps)
      Compute the xor aggregate using a temporary uncompressed bitmap.
      Parameters:
      container - where the aggregate is written
      bufSize - buffer size used during the computation in 64-bit words
      bitmaps - the source bitmaps
    • orToContainer

      public static void orToContainer(BitmapStorage32 container, EWAHCompressedBitmap32... bitmaps)
      Uses a priority queue to compute the or aggregate. The content of the container is overwritten. This algorithm runs in linearithmic time (O(n log n)) with respect to the number of bitmaps.
      Parameters:
      container - where we write the result
      bitmaps - to be aggregated
    • or

      public static EWAHCompressedBitmap32 or(EWAHCompressedBitmap32... bitmaps)
      Simple algorithm that computes the OR aggregate.
      Parameters:
      bitmaps - input bitmaps
      Returns:
      new bitmap containing the aggregate
    • xor

      public static EWAHCompressedBitmap32 xor(EWAHCompressedBitmap32... bitmaps)
      Simple algorithm that computes the XOR aggregate.
      Parameters:
      bitmaps - input bitmaps
      Returns:
      new bitmap containing the aggregate
    • or

      public static EWAHCompressedBitmap32 or(Iterator<EWAHCompressedBitmap32> bitmaps)
      Simple algorithm that computes the OR aggregate.
      Parameters:
      bitmaps - input bitmaps
      Returns:
      new bitmap containing the aggregate
    • xor

      public static EWAHCompressedBitmap32 xor(Iterator<EWAHCompressedBitmap32> bitmaps)
      Simple algorithm that computes the XOR aggregate.
      Parameters:
      bitmaps - input bitmaps
      Returns:
      new bitmap containing the aggregate
    • xorToContainer

      public static void xorToContainer(BitmapStorage32 container, EWAHCompressedBitmap32... bitmaps)
      Uses a priority queue to compute the xor aggregate. The content of the container is overwritten. This algorithm runs in linearithmic time (O(n log n)) with respect to the number of bitmaps.
      Parameters:
      container - where we write the result
      bitmaps - to be aggregated