fixedbitset icon indicating copy to clipboard operation
fixedbitset copied to clipboard

Add zeros iterator

Open fuine opened this issue 8 years ago • 3 comments

This closes #7 and #9. I have written the code such that it 'just works' and is not pathological in terms of speed. As mentioned in #9 once i will have more time i will gladly make both iterators optimal. @bluss tell me what do you think about the proposed implementation.

fuine avatar Dec 09 '16 13:12 fuine

Looks good. If you need this for your project, please use it locally.

bluss avatar Dec 09 '16 14:12 bluss

While using the zeros iterator i have hit an edge-case -- if the bitset consisted of only one block, then such block wouldn't get masked and so iterator would yield indices higher than length of the bitset. I have fixed that behavior and added unit tests to test this case for both zeros and ones iterators. Hopefully this was the last bug in this PR :)

fuine avatar Dec 17 '16 15:12 fuine

I cherry-picked inline count_ones inline commit to this branch, as i'm using it for the project. If this is a problem then i will revert it and manage otherwise, although for simplicity reasons i would like to leave it here, especially if you are not planning on merging this PR soon. Btw i think that it is ready to be merged as-is.

fuine avatar Dec 29 '16 15:12 fuine

Closing in favor of #89. Will try to adopt the benchmarks you have here for that implementation.

james7132 avatar Jan 16 '23 20:01 james7132