CRoaring icon indicating copy to clipboard operation
CRoaring copied to clipboard

Implement bit shift functions

Open lemire opened this issue 7 years ago • 7 comments

See http://bitmagic.io/dna-search.html

lemire avatar Oct 27 '18 22:10 lemire

Would it suffice to add an offset field? That would mean the shift itself is quite fast but would require an extra arithmetic operation for every kind of query. Does it make sense?

Oppen avatar Jun 07 '21 16:06 Oppen

Would it suffice to add an offset field? That would mean the shift itself is quite fast but would require an extra arithmetic operation for every kind of query. Does it make sense?

I expect that you probably want to shift the whole bitmap.

In Go and Java, we have add offset functions which are akin to a shift.

https://github.com/RoaringBitmap/RoaringBitmap/blob/master/RoaringBitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L193

https://github.com/RoaringBitmap/roaring/blob/4eb34b71d54a94c3c9996f7adaa55f0cc1a083c4/roaring.go#L506

lemire avatar Jun 07 '21 19:06 lemire

I'm working on this. I think I can have the PR today (I made my "draft" locally, will need to touch here and there when compilation invariably fails and port tests from Go and then add my own, as that's the easiest approach for me).

Oppen avatar Jun 08 '21 17:06 Oppen

:-)

lemire avatar Jun 08 '21 17:06 lemire

I got distracted with many other ideas. I have code but I'm still fixing bugs (the tests catch them tho! :) ).

Oppen avatar Jun 11 '21 16:06 Oppen

I'll try to have the PR today or during this weekend.

Oppen avatar Jun 11 '21 16:06 Oppen

I resumed work on this. Pretty much rewrote what I had. I still have some failing tests, but will make a draft PR just so I can receive feedback in the meantime.

Oppen avatar Dec 27 '21 02:12 Oppen