@Override public Bitmap aggregate(final Iterable<Bitmap> bitmaps) { Iterator<EWAHCompressedBitmap> iterator = new Iterator<EWAHCompressedBitmap>() { final Iterator<Bitmap> i = bitmaps.iterator(); @Override public boolean hasNext() { return i.hasNext(); } @Override public EWAHCompressedBitmap next() { return ((EwahBitmapWrapper) i.next()).bitmap; } @Override public void remove() { throw new UnsupportedOperationException(); } }; return new EwahBitmapWrapper(FastAggregation.or(iterator)); } };
/** * Compute the xor aggregate using a temporary uncompressed bitmap. * * @param bitmaps the source bitmaps * @param bufSize buffer size used during the computation in 64-bit * words * @return the xor aggregate. */ public static EWAHCompressedBitmap bufferedxor(final int bufSize, final EWAHCompressedBitmap... bitmaps) { EWAHCompressedBitmap answer = new EWAHCompressedBitmap(); bufferedxorWithContainer(answer, bufSize, bitmaps); return answer; }
/** * Compute the or aggregate using a temporary uncompressed bitmap. * * @param bitmaps the source bitmaps * @param bufSize buffer size used during the computation in 64-bit * words * @return the or aggregate. */ public static EWAHCompressedBitmap bufferedor(final int bufSize, final EWAHCompressedBitmap... bitmaps) { EWAHCompressedBitmap answer = new EWAHCompressedBitmap(); bufferedorWithContainer(answer, bufSize, bitmaps); return answer; }
/** * Compute the and aggregate using a temporary uncompressed bitmap. * * This function does not seek to match the "sizeinbits" attributes * of the input bitmaps. * * @param bitmaps the source bitmaps * @param bufSize buffer size used during the computation in 64-bit * words (per input bitmap) * @return the or aggregate. */ public static EWAHCompressedBitmap bufferedand(final int bufSize, final EWAHCompressedBitmap... bitmaps) { EWAHCompressedBitmap answer = new EWAHCompressedBitmap(); bufferedandWithContainer(answer, bufSize, bitmaps); return answer; }
/** * Uses an adaptive technique to compute the logical XOR. Mostly for * internal use. * * The content of the container is overwritten. * * @param container where the aggregate is written. * @param bitmaps to be aggregated */ public static void xorWithContainer(final BitmapStorage container, final EWAHCompressedBitmap... bitmaps) { if (bitmaps.length < 2) throw new IllegalArgumentException( "You should provide at least two bitmaps, provided " + bitmaps.length ); FastAggregation.xorToContainer(container, bitmaps); }
/** * Uses an adaptive technique to compute the logical OR. Mostly for * internal use. * * The content of the container is overwritten. * * @param container where the aggregate is written. * @param bitmaps to be aggregated */ public static void orWithContainer(final BitmapStorage container, final EWAHCompressedBitmap... bitmaps) { if (bitmaps.length < 2) throw new IllegalArgumentException( "You should provide at least two bitmaps, provided " + bitmaps.length ); FastAggregation.orToContainer(container, bitmaps); }
/** * Compute the xor aggregate using a temporary uncompressed bitmap. * * @param bitmaps the source bitmaps * @param bufSize buffer size used during the computation in 64-bit * words * @return the xor aggregate. */ public static EWAHCompressedBitmap bufferedxor(final int bufSize, final EWAHCompressedBitmap... bitmaps) { EWAHCompressedBitmap answer = new EWAHCompressedBitmap(); bufferedxorWithContainer(answer, bufSize, bitmaps); return answer; }
/** * Compute the or aggregate using a temporary uncompressed bitmap. * * @param bitmaps the source bitmaps * @param bufSize buffer size used during the computation in 64-bit * words * @return the or aggregate. */ public static EWAHCompressedBitmap bufferedor(final int bufSize, final EWAHCompressedBitmap... bitmaps) { EWAHCompressedBitmap answer = new EWAHCompressedBitmap(); bufferedorWithContainer(answer, bufSize, bitmaps); return answer; }
/** * Compute the and aggregate using a temporary uncompressed bitmap. * * This function does not seek to match the "sizeinbits" attributes * of the input bitmaps. * * @param bitmaps the source bitmaps * @param bufSize buffer size used during the computation in 64-bit * words (per input bitmap) * @return the or aggregate. */ public static EWAHCompressedBitmap bufferedand(final int bufSize, final EWAHCompressedBitmap... bitmaps) { EWAHCompressedBitmap answer = new EWAHCompressedBitmap(); bufferedandWithContainer(answer, bufSize, bitmaps); return answer; }
/** * Uses an adaptive technique to compute the logical XOR. Mostly for * internal use. * * The content of the container is overwritten. * * @param container where the aggregate is written. * @param bitmaps to be aggregated */ public static void xorWithContainer(final BitmapStorage container, final EWAHCompressedBitmap... bitmaps) { if (bitmaps.length < 2) throw new IllegalArgumentException( "You should provide at least two bitmaps, provided " + bitmaps.length ); FastAggregation.xorToContainer(container, bitmaps); }
/** * Uses an adaptive technique to compute the logical OR. Mostly for * internal use. * * The content of the container is overwritten. * * @param container where the aggregate is written. * @param bitmaps to be aggregated */ public static void orWithContainer(final BitmapStorage container, final EWAHCompressedBitmap... bitmaps) { if (bitmaps.length < 2) throw new IllegalArgumentException( "You should provide at least two bitmaps, provided " + bitmaps.length ); FastAggregation.orToContainer(container, bitmaps); }