@Override public EWAHIterator32 next() { this.buffer.clear(); IteratorAggregation32.andToContainer(this.buffer, this.bufferSize * this.ll.size(), this.ll.get(0), this.ll.get(1)); if (this.ll.size() > 2) { Iterator<IteratingRLW32> i = this.ll.iterator(); i.next(); i.next(); EWAHCompressedBitmap32 tmpbuffer = new EWAHCompressedBitmap32(); while (i.hasNext() && this.buffer.sizeInBytes() > 0) { IteratorAggregation32 .andToContainer(tmpbuffer, this.buffer.getIteratingRLW(), i.next()); this.buffer.swap(tmpbuffer); tmpbuffer.clear(); } } for (IteratingRLW32 aLl : this.ll) { if (aLl.size() == 0) { this.ll.clear(); break; } } return this.buffer.getEWAHIterator(); }
@Override public EWAHIterator32 next() { this.buffer.clear(); IteratorAggregation32.andToContainer(this.buffer, this.bufferSize * this.ll.size(), this.ll.get(0), this.ll.get(1)); if (this.ll.size() > 2) { Iterator<IteratingRLW32> i = this.ll.iterator(); i.next(); i.next(); EWAHCompressedBitmap32 tmpbuffer = new EWAHCompressedBitmap32(); while (i.hasNext() && this.buffer.sizeInBytes() > 0) { IteratorAggregation32 .andToContainer(tmpbuffer, this.buffer.getIteratingRLW(), i.next()); this.buffer.swap(tmpbuffer); tmpbuffer.clear(); } } for (IteratingRLW32 aLl : this.ll) { if (aLl.size() == 0) { this.ll.clear(); break; } } return this.buffer.getEWAHIterator(); }
/** * For internal use. Computes the bitwise and of the provided bitmaps * and stores the result in the container. * * The content of the container is overwritten. * * @param container where the result is stored * @param bitmaps bitmaps to AND */ public static void andWithContainer(final BitmapStorage32 container, final EWAHCompressedBitmap32... bitmaps) { if (bitmaps.length == 1) throw new IllegalArgumentException( "Need at least one bitmap"); if (bitmaps.length == 2) { bitmaps[0].andToContainer(bitmaps[1], container); return; } int initialSize = calculateInitialSize(bitmaps); EWAHCompressedBitmap32 answer = new EWAHCompressedBitmap32(initialSize); EWAHCompressedBitmap32 tmp = new EWAHCompressedBitmap32(initialSize); bitmaps[0].andToContainer(bitmaps[1], answer); for (int k = 2; k < bitmaps.length - 1; ++k) { answer.andToContainer(bitmaps[k], tmp); tmp.swap(answer); tmp.clear(); } answer.andToContainer(bitmaps[bitmaps.length - 1], container); }
/** * For internal use. Computes the bitwise and of the provided bitmaps * and stores the result in the container. * * The content of the container is overwritten. * * @param container where the result is stored * @param bitmaps bitmaps to AND */ public static void andWithContainer(final BitmapStorage32 container, final EWAHCompressedBitmap32... bitmaps) { if (bitmaps.length == 1) throw new IllegalArgumentException( "Need at least one bitmap"); if (bitmaps.length == 2) { bitmaps[0].andToContainer(bitmaps[1], container); return; } int initialSize = calculateInitialSize(bitmaps); EWAHCompressedBitmap32 answer = new EWAHCompressedBitmap32(initialSize); EWAHCompressedBitmap32 tmp = new EWAHCompressedBitmap32(initialSize); bitmaps[0].andToContainer(bitmaps[1], answer); for (int k = 2; k < bitmaps.length - 1; ++k) { answer.andToContainer(bitmaps[k], tmp); tmp.swap(answer); tmp.clear(); } answer.andToContainer(bitmaps[bitmaps.length - 1], container); }
for (int k = 2; k < bitmaps.length; ++k) { answer.andToContainer(bitmaps[k], tmp); tmp.swap(answer); tmp.clear();
for (int k = 2; k < bitmaps.length; ++k) { answer.andToContainer(bitmaps[k], tmp); tmp.swap(answer); tmp.clear();