I have two bitmaps a and b, I find one point inside b (say using an iterator), and then I want to intersect / union / compute the set difference of a with the tail of b after that point.
That is, I'd like the equivalent of
b.removeRange(0, x);
a &= b;
without the overhead of mutating b (the memmove from array containers shows up meaningfully in my CPU profile).
Roaring iterators already have all the information needed to implement this efficiently, and I sometimes need to walk through a to find the right spot (it's not as easy as rank(x)) so I'd prefer this:
auto it = b.begin();
it.move(x);
a.intersectTail(it);
// intersectRange(it, b.end()) would be nice too, but that means you have to be able to
// deal with partial containers at both ends instead of just at the beginning so it's a bit
// harder to implement
Do you think this is worth implementing?
Thanks,
-Tudor.
I have two bitmaps
aandb, I find one point insideb(say using an iterator), and then I want to intersect / union / compute the set difference ofawith the tail ofbafter that point.That is, I'd like the equivalent of
without the overhead of mutating
b(thememmovefrom array containers shows up meaningfully in my CPU profile).Roaring iterators already have all the information needed to implement this efficiently, and I sometimes need to walk through
ato find the right spot (it's not as easy asrank(x)) so I'd prefer this:Do you think this is worth implementing?
Thanks,
-Tudor.