CRoaring
CRoaring copied to clipboard
Converting from bitmap/bitarray to roaring bitmap
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
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.