/** * Returns a new compressed bitmap containing the bitwise XOR values of * the provided bitmaps. This is typically faster than doing the * aggregation two-by-two (A.xor(B).xor(C).xor(D)). * * If only one bitmap is provided, it is returned as is. * * If you are not planning on adding to the resulting bitmap, you may * call the trim() method to reduce memory usage. * * @param bitmaps bitmaps to XOR together * @return result of the XOR */ public static EWAHCompressedBitmap xor( final EWAHCompressedBitmap... bitmaps) { if (bitmaps.length == 1) return bitmaps[0]; int largestSize = calculateInitialSize(bitmaps); int size = (int) (largestSize * 1.5); final EWAHCompressedBitmap container = new EWAHCompressedBitmap(size); xorWithContainer(container, bitmaps); return container; }
/** * Returns a new compressed bitmap containing the bitwise OR values of * the provided bitmaps. This is typically faster than doing the * aggregation two-by-two (A.or(B).or(C).or(D)). * * If only one bitmap is provided, it is returned as is. * * If you are not planning on adding to the resulting bitmap, you may * call the trim() method to reduce memory usage. * * @param bitmaps bitmaps to OR together * @return result of the OR * @since 0.4.0 */ public static EWAHCompressedBitmap or( final EWAHCompressedBitmap... bitmaps) { if (bitmaps.length == 1) return bitmaps[0]; int largestSize = calculateInitialSize(bitmaps); final EWAHCompressedBitmap container = new EWAHCompressedBitmap((int) (largestSize * 1.5)); orWithContainer(container, bitmaps); return container; }
/** * Returns a new compressed bitmap containing the bitwise XOR values of * the provided bitmaps. This is typically faster than doing the * aggregation two-by-two (A.xor(B).xor(C).xor(D)). * * If only one bitmap is provided, it is returned as is. * * If you are not planning on adding to the resulting bitmap, you may * call the trim() method to reduce memory usage. * * @param bitmaps bitmaps to XOR together * @return result of the XOR */ public static EWAHCompressedBitmap xor( final EWAHCompressedBitmap... bitmaps) { if (bitmaps.length == 1) return bitmaps[0]; int largestSize = calculateInitialSize(bitmaps); int size = (int) (largestSize * 1.5); final EWAHCompressedBitmap container = new EWAHCompressedBitmap(size); xorWithContainer(container, bitmaps); return container; }
/** * Returns a new compressed bitmap containing the bitwise OR values of * the provided bitmaps. This is typically faster than doing the * aggregation two-by-two (A.or(B).or(C).or(D)). * * If only one bitmap is provided, it is returned as is. * * If you are not planning on adding to the resulting bitmap, you may * call the trim() method to reduce memory usage. * * @param bitmaps bitmaps to OR together * @return result of the OR * @since 0.4.0 */ public static EWAHCompressedBitmap or( final EWAHCompressedBitmap... bitmaps) { if (bitmaps.length == 1) return bitmaps[0]; int largestSize = calculateInitialSize(bitmaps); final EWAHCompressedBitmap container = new EWAHCompressedBitmap((int) (largestSize * 1.5)); orWithContainer(container, bitmaps); return container; }
int initialSize = calculateInitialSize(bitmaps); EWAHCompressedBitmap answer = new EWAHCompressedBitmap(initialSize); EWAHCompressedBitmap tmp = new EWAHCompressedBitmap(initialSize);
int initialSize = calculateInitialSize(bitmaps); EWAHCompressedBitmap answer = new EWAHCompressedBitmap(initialSize); EWAHCompressedBitmap tmp = new EWAHCompressedBitmap(initialSize);
return bitmaps[0].and(bitmaps[1]); int initialSize = calculateInitialSize(bitmaps); EWAHCompressedBitmap answer = new EWAHCompressedBitmap(initialSize); EWAHCompressedBitmap tmp = new EWAHCompressedBitmap(initialSize);
return bitmaps[0].and(bitmaps[1]); int initialSize = calculateInitialSize(bitmaps); EWAHCompressedBitmap answer = new EWAHCompressedBitmap(initialSize); EWAHCompressedBitmap tmp = new EWAHCompressedBitmap(initialSize);