Implement bit shift functions
See http://bitmagic.io/dna-search.html
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?
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
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).
:-)
I got distracted with many other ideas. I have code but I'm still fixing bugs (the tests catch them tho! :) ).
I'll try to have the PR today or during this weekend.
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.