/** * Returns the cardinality of the result of a bitwise AND NOT of the * values of the current bitmap with some other bitmap. Avoids allocating * an intermediate bitmap to hold the result of the OR. * The current bitmap is not modified. * * @param a the other bitmap (it will not be modified) * @return the cardinality */ public int andNotCardinality(final EWAHCompressedBitmap32 a) { final BitCounter32 counter = new BitCounter32(); andNotToContainer(a, counter); return counter.getCount(); }
/** * Returns the cardinality of the result of a bitwise AND NOT of the * values of the current bitmap with some other bitmap. Avoids allocating * an intermediate bitmap to hold the result of the OR. * The current bitmap is not modified. * * @param a the other bitmap (it will not be modified) * @return the cardinality */ public int andNotCardinality(final EWAHCompressedBitmap32 a) { final BitCounter32 counter = new BitCounter32(); andNotToContainer(a, counter); return counter.getCount(); }
/** * Returns a new compressed bitmap containing the bitwise AND NOT values * of the current bitmap with some other bitmap. The current bitmap * is not modified. * * The running time is proportional to the sum of the compressed sizes * (as reported by sizeInBytes()). * * If you are not planning on adding to the resulting bitmap, you may * call the trim() method to reduce memory usage. * * @param a the other bitmap (it will not be modified) * @return the EWAH compressed bitmap */ @Override public EWAHCompressedBitmap32 andNot(final EWAHCompressedBitmap32 a) { int size = this.buffer.sizeInWords() > a.buffer.sizeInWords() ? this.buffer.sizeInWords() : a.buffer.sizeInWords(); final EWAHCompressedBitmap32 container = new EWAHCompressedBitmap32(size); andNotToContainer(a, container); return container; }
/** * Returns a new compressed bitmap containing the bitwise AND NOT values * of the current bitmap with some other bitmap. The current bitmap * is not modified. * * The running time is proportional to the sum of the compressed sizes * (as reported by sizeInBytes()). * * If you are not planning on adding to the resulting bitmap, you may * call the trim() method to reduce memory usage. * * @param a the other bitmap (it will not be modified) * @return the EWAH compressed bitmap */ @Override public EWAHCompressedBitmap32 andNot(final EWAHCompressedBitmap32 a) { int size = this.buffer.sizeInWords() > a.buffer.sizeInWords() ? this.buffer.sizeInWords() : a.buffer.sizeInWords(); final EWAHCompressedBitmap32 container = new EWAHCompressedBitmap32(size); andNotToContainer(a, container); return container; }