Package com.googlecode.javaewah
Class FastAggregation
java.lang.Object
com.googlecode.javaewah.FastAggregation
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 Summary
Modifier and TypeMethodDescriptionstatic EWAHCompressedBitmapbufferedand(int bufSize, EWAHCompressedBitmap... bitmaps)Compute the and aggregate using a temporary uncompressed bitmap.static voidbufferedandWithContainer(BitmapStorage container, int bufSize, EWAHCompressedBitmap... bitmaps)Compute the and aggregate using a temporary uncompressed bitmap.static EWAHCompressedBitmapbufferedor(int bufSize, EWAHCompressedBitmap... bitmaps)Compute the or aggregate using a temporary uncompressed bitmap.static voidbufferedorWithContainer(BitmapStorage container, int bufSize, EWAHCompressedBitmap... bitmaps)Compute the or aggregate using a temporary uncompressed bitmap.static EWAHCompressedBitmapbufferedxor(int bufSize, EWAHCompressedBitmap... bitmaps)Compute the xor aggregate using a temporary uncompressed bitmap.static voidbufferedxorWithContainer(BitmapStorage container, int bufSize, EWAHCompressedBitmap... bitmaps)Compute the xor aggregate using a temporary uncompressed bitmap.static EWAHCompressedBitmapor(EWAHCompressedBitmap... bitmaps)Simple algorithm that computes the OR aggregate.static EWAHCompressedBitmapor(Iterator<EWAHCompressedBitmap> bitmaps)Simple algorithm that computes the OR aggregate.static <T extends LogicalElement>
Tor(T... bitmaps)Uses a priority queue to compute the or aggregate.static voidorToContainer(BitmapStorage container, EWAHCompressedBitmap... bitmaps)Uses a priority queue to compute the or aggregate.static EWAHCompressedBitmapxor(EWAHCompressedBitmap... bitmaps)Simple algorithm that computes the XOR aggregate.static EWAHCompressedBitmapxor(Iterator<EWAHCompressedBitmap> bitmaps)Simple algorithm that computes the XOR aggregate.static <T extends LogicalElement>
Txor(T... bitmaps)Uses a priority queue to compute the xor aggregate.static voidxorToContainer(BitmapStorage container, EWAHCompressedBitmap... bitmaps)Uses a priority queue to compute the xor aggregate.
-
Method Details
-
bufferedand
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 bitmapsbufSize- buffer size used during the computation in 64-bit words (per input bitmap)- Returns:
- the or aggregate.
-
bufferedandWithContainer
public static void bufferedandWithContainer(BitmapStorage container, int bufSize, EWAHCompressedBitmap... 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 writtenbufSize- buffer size used during the computation in 64-bit words (per input bitmap)bitmaps- the source bitmaps
-
bufferedor
Compute the or aggregate using a temporary uncompressed bitmap.- Parameters:
bitmaps- the source bitmapsbufSize- buffer size used during the computation in 64-bit words- Returns:
- the or aggregate.
-
bufferedorWithContainer
public static void bufferedorWithContainer(BitmapStorage container, int bufSize, EWAHCompressedBitmap... bitmaps)Compute the or aggregate using a temporary uncompressed bitmap.- Parameters:
container- where the aggregate is writtenbufSize- buffer size used during the computation in 64-bit wordsbitmaps- the source bitmaps
-
bufferedxor
Compute the xor aggregate using a temporary uncompressed bitmap.- Parameters:
bitmaps- the source bitmapsbufSize- buffer size used during the computation in 64-bit words- Returns:
- the xor aggregate.
-
bufferedxorWithContainer
public static void bufferedxorWithContainer(BitmapStorage container, int bufSize, EWAHCompressedBitmap... bitmaps)Compute the xor aggregate using a temporary uncompressed bitmap.- Parameters:
container- where the aggregate is writtenbufSize- buffer size used during the computation in 64-bit wordsbitmaps- the source bitmaps
-
or
Uses a priority queue to compute the or aggregate. This algorithm runs in linearithmic time (O(n log n)) with respect to the number of bitmaps.- Type Parameters:
T- a class extending LogicalElement (like a compressed bitmap)- Parameters:
bitmaps- bitmaps to be aggregated- Returns:
- the or aggregate
-
orToContainer
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 resultbitmaps- to be aggregated
-
or
Simple algorithm that computes the OR aggregate.- Parameters:
bitmaps- input bitmaps- Returns:
- new bitmap containing the aggregate
-
xor
Simple algorithm that computes the XOR aggregate.- Parameters:
bitmaps- input bitmaps- Returns:
- new bitmap containing the aggregate
-
or
Simple algorithm that computes the OR aggregate.- Parameters:
bitmaps- input bitmaps- Returns:
- new bitmap containing the aggregate
-
xor
Simple algorithm that computes the XOR aggregate.- Parameters:
bitmaps- input bitmaps- Returns:
- new bitmap containing the aggregate
-
xor
Uses a priority queue to compute the xor aggregate. This algorithm runs in linearithmic time (O(n log n)) with respect to the number of bitmaps.- Type Parameters:
T- a class extending LogicalElement (like a compressed bitmap)- Parameters:
bitmaps- bitmaps to be aggregated- Returns:
- the xor aggregate
-
xorToContainer
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 resultbitmaps- to be aggregated
-