Open llogiq opened 3 months ago
Hey @llogiq 👋
Happy to see you there. Unfortunately, there is no direct operation to do the following. What I would do is create a second bitmap with numbers in between 7 (> 6) and 39 (<40), do an intersection to get the real numbers. Do the increment by 2 by by iterating on this subset and creating a new bitmap (yes, again). Using the RoaringBitmap::remove_range
method to delete the range of values in between 7 and 39 then do the union with the previously shifted bitmap (using the BitOrAssign
operator).
fn extract_range(&self, impl Range) -> RoaringBitmap
.
fn increment_all(&mut self, n: usize) -> u64
.fn increment_range(&mut self, r: impl Range, n: usize) -> u64
.Yeah, I guess having RoaringBitmap::
{in
, de
}crement_range
functions would probably get the most bang for the buck, and could also easily be SIMD-optimized.
Let's say I have a RoaringBitmap with the values 0, 1, 32, 35 and 70. Now I want to reduce all values > 6 and < 40 by, say, 2. Is there a thing I'm overlooking or would I have to remove and recreate the values via
from_sorted_iter
?