Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting from bitmap/bitarray to roaring bitmap #505

Open
touisteur opened this issue Sep 18, 2023 · 1 comment
Open

Converting from bitmap/bitarray to roaring bitmap #505

touisteur opened this issue Sep 18, 2023 · 1 comment

Comments

@touisteur
Copy link

Hi,

Is there a simple way to initiate/fill a roaring_bitmap_t from an flat bitmap (simple example of an "flat bitmap" would be: one-byte [0000 0101]b that translates to the integer set { 1 , 4 }, or 2-bytes [0000 1000 1001 0000]b that translate to the integer set {5, 8, 12} - (I'm probably messing up some bit-order or endianness here...) instead of a array of integer (actual values) ?

I'm sorry if it's self-evident from the headers or existing issues, I couldn't find it with my poor search-fu.

Thanks in advance

@lemire
Copy link
Member

lemire commented Sep 18, 2023

No, we do not offer this functionality. The reverse is supported, however:

bool roaring_bitmap_to_bitset(const roaring_bitmap_t *r, bitset_t * bitset);

An implementation would not be very difficult.

Pull request invited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants