Class ThresholdFuncBitmap
java.lang.Object
com.googlecode.javaewah.symmetric.UpdateableBitmapFunction
com.googlecode.javaewah.symmetric.ThresholdFuncBitmap
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.
- Since:
- 0.8.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]private long[]private intprivate final intprivate static final int[]Fields inherited from class com.googlecode.javaewah.symmetric.UpdateableBitmapFunction
b, hammingWeight, litWeight, litwlist, rw -
Constructor Summary
ConstructorsConstructorDescriptionThresholdFuncBitmap(int min) Construction a threshold function with a given threshold -
Method Summary
Modifier and TypeMethodDescriptionprivate voidandLiterals(BitmapStorage out, int runBegin, int runLength) voiddispatch(BitmapStorage out, int runBegin, int runEnd) Writes out the answer.private voidgeneralLiterals(int deficit, BitmapStorage out, int runBegin, int runLength) private voidorLiterals(BitmapStorage out, int runBegin, int runLength) private longthreshold2buf(int t, long[] buf, int bufUsed) private static longthreshold3(int t, long[] buffers, int bufUsed) private longthreshold4(int T, long[] buf, int bufUsed) Methods inherited from class com.googlecode.javaewah.symmetric.UpdateableBitmapFunction
clearLiteral, fillWithLiterals, getLiterals, getNumberOfLiterals, resize, setLiteral, setOne, setZero
-
Field Details
-
min
private final int min -
buffers
private long[] buffers -
bufferUsed
private int bufferUsed -
bufCounters
private final int[] bufCounters -
zeroes64
private static final int[] zeroes64
-
-
Constructor Details
-
ThresholdFuncBitmap
public ThresholdFuncBitmap(int min) Construction a threshold function with a given threshold- Parameters:
min- threshold
-
-
Method Details
-
dispatch
Description copied from class:UpdateableBitmapFunctionWrites out the answer.- Specified by:
dispatchin classUpdateableBitmapFunction- Parameters:
out- output bufferrunBegin- beginning of the runrunEnd- end of the run
-
threshold2buf
private long threshold2buf(int t, long[] buf, int bufUsed) -
threshold3
private static long threshold3(int t, long[] buffers, int bufUsed) -
threshold4
private long threshold4(int T, long[] buf, int bufUsed) -
orLiterals
-
andLiterals
-
generalLiterals
-