Top Description Fields Constructors Methods
com.googlecode.javaewah.symmetric

public final Class ThresholdFuncBitmap

extends UpdateableBitmapFunction
Class Inheritance
Imports
com.googlecode.javaewah.BitmapStorage, java.util.Arrays

A threshold Boolean function returns true if the number of true values exceed a threshold. It is a symmetric Boolean function. This class implements an algorithm described in the following paper: Owen Kaser and Daniel Lemire, Compressed bitmap indexes: beyond unions and intersections http://arxiv.org/abs/1402.4466 It is not thread safe: you should use one object per thread.
Author
Daniel Lemire
Since
0.8.0
See Also
http://en.wikipedia.org/wiki/Symmetric_Boolean_function

Field Summary

Modifier and TypeField and Description
private final int[]
private long[]
private int
private final int
private static final int[]
Inherited from com.googlecode.javaewah.symmetric.UpdateableBitmapFunction:
bhammingWeightlitWeightlitwlistrw

Constructor Summary

AccessConstructor and Description
public
ThresholdFuncBitmap(final int
threshold
min
)

Construction a threshold function with a given threshold

Method Summary

Modifier and TypeMethod and Description
private void
andLiterals(final BitmapStorage out, final int runBegin, final int runLength)

public void
dispatch(BitmapStorage
output buffer
out
,
int
beginning of the run
runBegin
,
int
end of the run
runEnd
)

Implements abstract com.googlecode.javaewah.symmetric.UpdateableBitmapFunction.dispatch.

Writes out the answer.

private void
generalLiterals(final int deficit, final BitmapStorage out, final int runBegin, final int runLength)

private void
orLiterals(final BitmapStorage out, final int runBegin, final int runLength)

private long
threshold2buf(final int t, final long[] buf, final int bufUsed)

private static long
threshold3(final int t, final long[] buffers, final int bufUsed)

private long
threshold4(final int T, final long[] buf, final int bufUsed)

Inherited from com.googlecode.javaewah.symmetric.UpdateableBitmapFunction:
clearLiteralfillWithLiteralsgetLiteralsgetNumberOfLiteralsresizesetLiteralsetOnesetZero

Field Detail

bufCountersback to summary
private final int[] bufCounters
buffersback to summary
private long[] buffers
bufferUsedback to summary
private int bufferUsed
minback to summary
private final int min
zeroes64back to summary
private static final int[] zeroes64

Constructor Detail

ThresholdFuncBitmapback to summary
public ThresholdFuncBitmap(final int min)

Construction a threshold function with a given threshold

Parameters
min:int

threshold

Method Detail

andLiteralsback to summary
private void andLiterals(final BitmapStorage out, final int runBegin, final int runLength)
dispatchback to summary
public void dispatch(BitmapStorage out, int runBegin, int runEnd)

Implements abstract com.googlecode.javaewah.symmetric.UpdateableBitmapFunction.dispatch.

Doc from com.googlecode.javaewah.symmetric.UpdateableBitmapFunction.dispatch.

Writes out the answer.

Parameters
out:BitmapStorage

output buffer

runBegin:int

beginning of the run

runEnd:int

end of the run

Annotations
@Override
generalLiteralsback to summary
private void generalLiterals(final int deficit, final BitmapStorage out, final int runBegin, final int runLength)
orLiteralsback to summary
private void orLiterals(final BitmapStorage out, final int runBegin, final int runLength)
threshold2bufback to summary
private long threshold2buf(final int t, final long[] buf, final int bufUsed)
threshold3back to summary
private static long threshold3(final int t, final long[] buffers, final int bufUsed)
threshold4back to summary
private long threshold4(final int T, final long[] buf, final int bufUsed)