roaring icon indicating copy to clipboard operation
roaring copied to clipboard

Add Bitmap.NextAbsentValue

Open ghost opened this issue 2 years ago • 5 comments

Java implementation has nextAbsentValue method. Go implementation doesn't. Could you please add it?

https://www.javadoc.io/doc/org.roaringbitmap/RoaringBitmap

public long nextAbsentValue​(int fromValue)

Returns the first absent value equal to or larger than
the provided value (interpreted as an unsigned integer).
It is not necessarily a computationally effective way
to iterate through the values.

Parameters:
    fromValue - the lower bound (inclusive)
Returns:
    the smallest absent value larger than or equal to
    the specified value.

ghost avatar Jan 27 '23 03:01 ghost

That's a good issue. Do you want to try it out?

lemire avatar Jan 27 '23 16:01 lemire

A PR is invited.

lemire avatar Jan 27 '23 16:01 lemire

Looks like a lot of work. I don't think I need this method anymore, nor do I need the companion functions previousAbsentValue, nextValue, previousValue.

ghost avatar Feb 06 '23 02:02 ghost

Looks like a lot of work.

It is not too bad, but it requires a minimum of care and a few hours.

lemire avatar Feb 06 '23 14:02 lemire

@lemire Once the validation stuff gets in I'll grab this. I think have a good enough grasp on the data structures to do this.

bearrito avatar May 05 '24 21:05 bearrito

Can be closed by linked issue.

bearrito avatar Jun 12 '24 00:06 bearrito

Closed.

lemire avatar Jun 12 '24 01:06 lemire