lemire/javaewah — pull request #36 by gssiyankai (2014-08-10 08:03:24+00:00)
Title: Bitmaps composition

This PR adds a new operation on bitmaps: bitmaps composition. Composition filters out the ones of a bitmap with another bitmap.

For example, if you have the following bitmap A = { 0, 1, 0, 1, 1, 0 } and want to keep only the second and third ones, you can call A.compose(B) with B = { 0, 1, 1 } and you will get C = { 0, 0, 0, 1, 1, 0 }.

The current implementation is very basic and just consists in iterating over bitmaps. So there is place for optimization, in particular with consecutive ones to keep.