Top Description Constructors Methods
com.googlecode.javaewah

public final Class FastAggregation

extends Object
Class Inheritance
Imports
java.util.Arrays, .Collections, .Comparator, .Iterator, .PriorityQueue

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

Constructor Summary

AccessConstructor and Description
private
FastAggregation()

Private constructor to prevent instantiation

Method Summary

Modifier and TypeMethod and Description
public static EWAHCompressedBitmap

Returns:

the or aggregate.
bufferedand
(final int
buffer size used during the computation in 64-bit words (per input bitmap)
bufSize
,
final EWAHCompressedBitmap...
the source bitmaps
bitmaps
)

Compute the and aggregate using a temporary uncompressed bitmap.

public static void
bufferedandWithContainer(final BitmapStorage
where the aggregate is written
container
,
final int
buffer size used during the computation in 64-bit words (per input bitmap)
bufSize
,
final EWAHCompressedBitmap...
the source bitmaps
bitmaps
)

Compute the and aggregate using a temporary uncompressed bitmap.

public static EWAHCompressedBitmap

Returns:

the or aggregate.
bufferedor
(final int
buffer size used during the computation in 64-bit words
bufSize
,
final EWAHCompressedBitmap...
the source bitmaps
bitmaps
)

Compute the or aggregate using a temporary uncompressed bitmap.

public static void
bufferedorWithContainer(final BitmapStorage
where the aggregate is written
container
,
final int
buffer size used during the computation in 64-bit words
bufSize
,
final EWAHCompressedBitmap...
the source bitmaps
bitmaps
)

Compute the or aggregate using a temporary uncompressed bitmap.

public static EWAHCompressedBitmap

Returns:

the xor aggregate.
bufferedxor
(final int
buffer size used during the computation in 64-bit words
bufSize
,
final EWAHCompressedBitmap...
the source bitmaps
bitmaps
)

Compute the xor aggregate using a temporary uncompressed bitmap.

public static void
bufferedxorWithContainer(final BitmapStorage
where the aggregate is written
container
,
final int
buffer size used during the computation in 64-bit words
bufSize
,
final EWAHCompressedBitmap...
the source bitmaps
bitmaps
)

Compute the xor aggregate using a temporary uncompressed bitmap.

public static <
a class extending LogicalElement (like a compressed bitmap)
T extends LogicalElement
>
T

Returns:

the or aggregate
or
(T...
bitmaps to be aggregated
bitmaps
)

Uses a priority queue to compute the or aggregate.

public static EWAHCompressedBitmap

Returns:

new bitmap containing the aggregate
or
(final EWAHCompressedBitmap...
input bitmaps
bitmaps
)

Simple algorithm that computes the OR aggregate.

public static EWAHCompressedBitmap

Returns:

new bitmap containing the aggregate
or
(final Iterator<EWAHCompressedBitmap>
input bitmaps
bitmaps
)

Simple algorithm that computes the OR aggregate.

public static void
orToContainer(final BitmapStorage
where we write the result
container
,
final EWAHCompressedBitmap...
to be aggregated
bitmaps
)

Uses a priority queue to compute the or aggregate.

public static EWAHCompressedBitmap

Returns:

new bitmap containing the aggregate
xor
(final EWAHCompressedBitmap...
input bitmaps
bitmaps
)

Simple algorithm that computes the XOR aggregate.

public static EWAHCompressedBitmap

Returns:

new bitmap containing the aggregate
xor
(final Iterator<EWAHCompressedBitmap>
input bitmaps
bitmaps
)

Simple algorithm that computes the XOR aggregate.

public static <
a class extending LogicalElement (like a compressed bitmap)
T extends LogicalElement
>
T

Returns:

the xor aggregate
xor
(T...
bitmaps to be aggregated
bitmaps
)

Uses a priority queue to compute the xor aggregate.

public static void
xorToContainer(final BitmapStorage
where we write the result
container
,
final EWAHCompressedBitmap...
to be aggregated
bitmaps
)

Uses a priority queue to compute the xor aggregate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FastAggregationback to summary
private FastAggregation()

Private constructor to prevent instantiation

Method Detail

bufferedandback to summary
public static EWAHCompressedBitmap bufferedand(final int bufSize, final 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
bufSize:int

buffer size used during the computation in 64-bit words (per input bitmap)

bitmaps:EWAHCompressedBitmap[]

the source bitmaps

Returns:EWAHCompressedBitmap

the or aggregate.

bufferedandWithContainerback to summary
public static void bufferedandWithContainer(final BitmapStorage container, final int bufSize, final 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:BitmapStorage

where the aggregate is written

bufSize:int

buffer size used during the computation in 64-bit words (per input bitmap)

bitmaps:EWAHCompressedBitmap[]

the source bitmaps

bufferedorback to summary
public static EWAHCompressedBitmap bufferedor(final int bufSize, final EWAHCompressedBitmap... bitmaps)

Compute the or aggregate using a temporary uncompressed bitmap.

Parameters
bufSize:int

buffer size used during the computation in 64-bit words

bitmaps:EWAHCompressedBitmap[]

the source bitmaps

Returns:EWAHCompressedBitmap

the or aggregate.

bufferedorWithContainerback to summary
public static void bufferedorWithContainer(final BitmapStorage container, final int bufSize, final EWAHCompressedBitmap... bitmaps)

Compute the or aggregate using a temporary uncompressed bitmap.

Parameters
container:BitmapStorage

where the aggregate is written

bufSize:int

buffer size used during the computation in 64-bit words

bitmaps:EWAHCompressedBitmap[]

the source bitmaps

bufferedxorback to summary
public static EWAHCompressedBitmap bufferedxor(final int bufSize, final EWAHCompressedBitmap... bitmaps)

Compute the xor aggregate using a temporary uncompressed bitmap.

Parameters
bufSize:int

buffer size used during the computation in 64-bit words

bitmaps:EWAHCompressedBitmap[]

the source bitmaps

Returns:EWAHCompressedBitmap

the xor aggregate.

bufferedxorWithContainerback to summary
public static void bufferedxorWithContainer(final BitmapStorage container, final int bufSize, final EWAHCompressedBitmap... bitmaps)

Compute the xor aggregate using a temporary uncompressed bitmap.

Parameters
container:BitmapStorage

where the aggregate is written

bufSize:int

buffer size used during the computation in 64-bit words

bitmaps:EWAHCompressedBitmap[]

the source bitmaps

orback to summary
public static <T extends LogicalElement> T or(T... bitmaps)

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.

Parameters
<T>
a class extending LogicalElement (like a compressed bitmap)
bitmaps:T[]

bitmaps to be aggregated

Returns:T

the or aggregate

Annotations
@SuppressWarnings:rawtypes, unchecked
orback to summary
public static EWAHCompressedBitmap or(final EWAHCompressedBitmap... bitmaps)

Simple algorithm that computes the OR aggregate.

Parameters
bitmaps:EWAHCompressedBitmap[]

input bitmaps

Returns:EWAHCompressedBitmap

new bitmap containing the aggregate

orback to summary
public static EWAHCompressedBitmap or(final Iterator<EWAHCompressedBitmap> bitmaps)

Simple algorithm that computes the OR aggregate.

Parameters
bitmaps:Iterator<EWAHCompressedBitmap>

input bitmaps

Returns:EWAHCompressedBitmap

new bitmap containing the aggregate

orToContainerback to summary
public static void orToContainer(final BitmapStorage container, final EWAHCompressedBitmap... 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:BitmapStorage

where we write the result

bitmaps:EWAHCompressedBitmap[]

to be aggregated

xorback to summary
public static EWAHCompressedBitmap xor(final EWAHCompressedBitmap... bitmaps)

Simple algorithm that computes the XOR aggregate.

Parameters
bitmaps:EWAHCompressedBitmap[]

input bitmaps

Returns:EWAHCompressedBitmap

new bitmap containing the aggregate

xorback to summary
public static EWAHCompressedBitmap xor(final Iterator<EWAHCompressedBitmap> bitmaps)

Simple algorithm that computes the XOR aggregate.

Parameters
bitmaps:Iterator<EWAHCompressedBitmap>

input bitmaps

Returns:EWAHCompressedBitmap

new bitmap containing the aggregate

xorback to summary
public static <T extends LogicalElement> T xor(T... bitmaps)

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.

Parameters
<T>
a class extending LogicalElement (like a compressed bitmap)
bitmaps:T[]

bitmaps to be aggregated

Returns:T

the xor aggregate

Annotations
@SuppressWarnings:rawtypes, unchecked
xorToContainerback to summary
public static void xorToContainer(final BitmapStorage container, final EWAHCompressedBitmap... 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:BitmapStorage

where we write the result

bitmaps:EWAHCompressedBitmap[]

to be aggregated