Top Description Constructors Methods
com.googlecode.javaewah32

public final Class FastAggregation32

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
FastAggregation32()

Private constructor to prevent instantiation

Method Summary

Modifier and TypeMethod and Description
public static EWAHCompressedBitmap32

Returns:

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

Compute the and aggregate using a temporary uncompressed bitmap.

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

Compute the and aggregate using a temporary uncompressed bitmap.

public static EWAHCompressedBitmap32

Returns:

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

Compute the or aggregate using a temporary uncompressed bitmap.

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

Compute the or aggregate using a temporary uncompressed bitmap.

public static EWAHCompressedBitmap32

Returns:

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

Compute the xor aggregate using a temporary uncompressed bitmap.

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

Compute the xor aggregate using a temporary uncompressed bitmap.

public static EWAHCompressedBitmap32

Returns:

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

Simple algorithm that computes the OR aggregate.

public static EWAHCompressedBitmap32

Returns:

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

Simple algorithm that computes the OR aggregate.

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

Uses a priority queue to compute the or aggregate.

public static EWAHCompressedBitmap32

Returns:

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

Simple algorithm that computes the XOR aggregate.

public static EWAHCompressedBitmap32

Returns:

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

Simple algorithm that computes the XOR aggregate.

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

Uses a priority queue to compute the xor aggregate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FastAggregation32back to summary
private FastAggregation32()

Private constructor to prevent instantiation

Method Detail

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

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

bitmaps:EWAHCompressedBitmap32[]

the source bitmaps

Returns:EWAHCompressedBitmap32

the or aggregate.

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

where the aggregate is written

bufSize:int

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

bitmaps:EWAHCompressedBitmap32[]

the source bitmaps

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

Compute the or aggregate using a temporary uncompressed bitmap.

Parameters
bufSize:int

buffer size used during the computation in 64-bit words

bitmaps:EWAHCompressedBitmap32[]

the source bitmaps

Returns:EWAHCompressedBitmap32

the or aggregate.

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

Compute the or aggregate using a temporary uncompressed bitmap.

Parameters
container:BitmapStorage32

where the aggregate is written

bufSize:int

buffer size used during the computation in 64-bit words

bitmaps:EWAHCompressedBitmap32[]

the source bitmaps

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

Compute the xor aggregate using a temporary uncompressed bitmap.

Parameters
bufSize:int

buffer size used during the computation in 64-bit words

bitmaps:EWAHCompressedBitmap32[]

the source bitmaps

Returns:EWAHCompressedBitmap32

the xor aggregate.

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

Compute the xor aggregate using a temporary uncompressed bitmap.

Parameters
container:BitmapStorage32

where the aggregate is written

bufSize:int

buffer size used during the computation in 64-bit words

bitmaps:EWAHCompressedBitmap32[]

the source bitmaps

orback to summary
public static EWAHCompressedBitmap32 or(final EWAHCompressedBitmap32... bitmaps)

Simple algorithm that computes the OR aggregate.

Parameters
bitmaps:EWAHCompressedBitmap32[]

input bitmaps

Returns:EWAHCompressedBitmap32

new bitmap containing the aggregate

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

Simple algorithm that computes the OR aggregate.

Parameters
bitmaps:Iterator<EWAHCompressedBitmap32>

input bitmaps

Returns:EWAHCompressedBitmap32

new bitmap containing the aggregate

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

where we write the result

bitmaps:EWAHCompressedBitmap32[]

to be aggregated

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

Simple algorithm that computes the XOR aggregate.

Parameters
bitmaps:EWAHCompressedBitmap32[]

input bitmaps

Returns:EWAHCompressedBitmap32

new bitmap containing the aggregate

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

Simple algorithm that computes the XOR aggregate.

Parameters
bitmaps:Iterator<EWAHCompressedBitmap32>

input bitmaps

Returns:EWAHCompressedBitmap32

new bitmap containing the aggregate

xorToContainerback to summary
public static void xorToContainer(final BitmapStorage32 container, final 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:BitmapStorage32

where we write the result

bitmaps:EWAHCompressedBitmap32[]

to be aggregated