roaring.c

Undocumented in source.

Members

Aliases

roaring_iterator
alias roaring_iterator = bool function(uint32_t value, void* param)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Functions

roaring_advance_uint32_iterator
bool roaring_advance_uint32_iterator(roaring_uint32_iterator_t* it)

Advance the iterator. If there is a new value, then it->has_value is true. The new value is in it->current_value. Values are traversed in increasing orders. For convenience, returns it->has_value.

roaring_bitmap_add
void roaring_bitmap_add(roaring_bitmap_t* r, uint32_t x)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_add_checked
bool roaring_bitmap_add_checked(roaring_bitmap_t* r, uint32_t x)

Add value x Returns true if a new value was added, false if the value was already existing.

roaring_bitmap_add_many
void roaring_bitmap_add_many(roaring_bitmap_t* r, size_t n_args, uint32_t* vals)

Add value n_args from pointer vals, faster than repeatedly calling roaring_bitmap_add

roaring_bitmap_add_range
void roaring_bitmap_add_range(roaring_bitmap_t* ra, uint64_t min, uint64_t max)

Add all values in range [min, max)

roaring_bitmap_add_range_closed
void roaring_bitmap_add_range_closed(roaring_bitmap_t* ra, uint32_t min, uint32_t max)

Add all values in range [min, max]

roaring_bitmap_and
roaring_bitmap_t* roaring_bitmap_and(roaring_bitmap_t* x1, roaring_bitmap_t* x2)

Computes the intersection between two bitmaps and returns new bitmap. The caller is responsible for memory management.

roaring_bitmap_and_inplace
void roaring_bitmap_and_inplace(roaring_bitmap_t* x1, roaring_bitmap_t* x2)

Inplace version modifies x1, x1 == x2 is allowed

roaring_bitmap_andnot
roaring_bitmap_t* roaring_bitmap_andnot(roaring_bitmap_t* x1, roaring_bitmap_t* x2)

Computes the difference (andnot) between two bitmaps and returns new bitmap. The caller is responsible for memory management.

roaring_bitmap_andnot_inplace
void roaring_bitmap_andnot_inplace(roaring_bitmap_t* x1, roaring_bitmap_t* x2)

Inplace version of roaring_bitmap_andnot, modifies x1. x1 != x2.

roaring_bitmap_contains
bool roaring_bitmap_contains(roaring_bitmap_t* r, uint32_t val)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_contains_range
bool roaring_bitmap_contains_range(roaring_bitmap_t* r, uint64_t range_start, uint64_t range_end)

Check whether a range of values from range_start (included) to range_end (excluded) is present

roaring_bitmap_copy
roaring_bitmap_t* roaring_bitmap_copy(roaring_bitmap_t* r)

Copies a bitmap. This does memory allocation. The caller is responsible for memory management.

roaring_bitmap_create
roaring_bitmap_t* roaring_bitmap_create()
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_create_with_capacity
roaring_bitmap_t* roaring_bitmap_create_with_capacity(uint32_t cap)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_deserialize
roaring_bitmap_t* roaring_bitmap_deserialize(void* buf)

use with roaring_bitmap_serialize see roaring_bitmap_portable_deserialize if you want a format that's compatible with Java and Go implementations

roaring_bitmap_equals
bool roaring_bitmap_equals(roaring_bitmap_t* ra1, roaring_bitmap_t* ra2)

Return true if the two bitmaps contain the same elements.

roaring_bitmap_free
void roaring_bitmap_free(roaring_bitmap_t* r)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_from_range
roaring_bitmap_t* roaring_bitmap_from_range(uint64_t min, uint64_t max, uint32_t step)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_get_cardinality
uint64_t roaring_bitmap_get_cardinality(roaring_bitmap_t* ra)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_is_subset
bool roaring_bitmap_is_subset(roaring_bitmap_t* ra1, roaring_bitmap_t* ra2)

Return true if all the elements of ra1 are also in ra2.

roaring_bitmap_maximum
uint32_t roaring_bitmap_maximum(roaring_bitmap_t* bm)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_minimum
uint32_t roaring_bitmap_minimum(roaring_bitmap_t* bm)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_or
roaring_bitmap_t* roaring_bitmap_or(roaring_bitmap_t* x1, roaring_bitmap_t* x2)

Computes the union between two bitmaps and returns new bitmap. The caller is responsible for memory management.

roaring_bitmap_or_inplace
void roaring_bitmap_or_inplace(roaring_bitmap_t* x1, roaring_bitmap_t* x2)

Inplace version of roaring_bitmap_or, modifies x1. TDOO: decide whether x1 == x2 ok

roaring_bitmap_portable_deserialize
roaring_bitmap_t* roaring_bitmap_portable_deserialize(char* buf)

read a bitmap from a serialized version. This is meant to be compatible with the Java and Go versions. See format specification at https://github.com/RoaringBitmap/RoaringFormatSpec

In case of failure, a null pointer is returned. This function is unsafe in the sense that if there is no valid serialized bitmap at the pointer, then many bytes could be read, possibly causing a buffer overflow. For a safer approach, call roaring_bitmap_portable_deserialize_safe.

roaring_bitmap_portable_deserialize_safe
roaring_bitmap_t* roaring_bitmap_portable_deserialize_safe(char* buf, size_t maxbytes)

read a bitmap from a serialized version in a safe manner (reading up to maxbytes). This is meant to be compatible with the Java and Go versions. See format specification at https://github.com/RoaringBitmap/RoaringFormatSpec

In case of failure, a null pointer is returned.

roaring_bitmap_portable_deserialize_size
size_t roaring_bitmap_portable_deserialize_size(char* buf, size_t maxbytes)

Check how many bytes would be read (up to maxbytes) at this pointer if there is a bitmap, returns zero if there is no valid bitmap. This is meant to be compatible with the Java and Go versions. See format specification at https://github.com/RoaringBitmap/RoaringFormatSpec

roaring_bitmap_portable_serialize
size_t roaring_bitmap_portable_serialize(roaring_bitmap_t* ra, char* buf)

write a bitmap to a char buffer. The output buffer should refer to at least roaring_bitmap_portable_size_in_bytes(ra) bytes of allocated memory. This is meant to be compatible with the Java and Go versions. Returns how many bytes were written which should be roaring_bitmap_portable_size_in_bytes(ra). See format specification at https://github.com/RoaringBitmap/RoaringFormatSpec

roaring_bitmap_portable_size_in_bytes
size_t roaring_bitmap_portable_size_in_bytes(roaring_bitmap_t* ra)

How many bytes are required to serialize this bitmap (meant to be compatible with Java and Go versions). See format specification at https://github.com/RoaringBitmap/RoaringFormatSpec

roaring_bitmap_range_cardinality
uint64_t roaring_bitmap_range_cardinality(roaring_bitmap_t* ra, uint64_t range_start, uint64_t range_end)

Returns number of elements in range [range_start, range_end).

roaring_bitmap_rank
uint64_t roaring_bitmap_rank(roaring_bitmap_t* bm, uint32_t x)

roaring_bitmap_rank returns the number of integers that are smaller or equal to x.

roaring_bitmap_remove
void roaring_bitmap_remove(roaring_bitmap_t* r, uint32_t x)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_run_optimize
bool roaring_bitmap_run_optimize(roaring_bitmap_t* r)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_select
bool roaring_bitmap_select(roaring_bitmap_t* bm, uint32_t rank, uint32_t* element)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_serialize
size_t roaring_bitmap_serialize(roaring_bitmap_t* ra, char* buf)

write the bitmap to an output pointer, this output buffer should refer to at least roaring_bitmap_size_in_bytes(ra) allocated bytes.

roaring_bitmap_size_in_bytes
size_t roaring_bitmap_size_in_bytes(roaring_bitmap_t* ra)

How many bytes are required to serialize this bitmap (NOT compatible with Java and Go versions)

roaring_bitmap_to_uint32_array
void roaring_bitmap_to_uint32_array(roaring_bitmap_t* ra, uint32_t* ans)

Convert the bitmap to an array. Write the output to "ans", caller is responsible to ensure that there is enough memory allocated (e.g., ans = malloc(roaring_bitmap_get_cardinality(mybitmap) * sizeof(uint32_t)) )

roaring_bitmap_xor
roaring_bitmap_t* roaring_bitmap_xor(roaring_bitmap_t* x1, roaring_bitmap_t* x2)

Computes the symmetric difference (xor) between two bitmaps and returns new bitmap. The caller is responsible for memory management.

roaring_bitmap_xor_inplace
void roaring_bitmap_xor_inplace(roaring_bitmap_t* x1, roaring_bitmap_t* x2)

Inplace version of roaring_bitmap_xor, modifies x1. x1 != x2.

roaring_create_iterator
roaring_uint32_iterator_t* roaring_create_iterator(roaring_bitmap_t* ra)

Create an iterator object that can be used to iterate through the values. Caller is responsible for calling roaring_free_iterator. The iterator is initialized. If there is a value, then it->has_value is true. The first value is in it->current_value. The iterator traverses the values in increasing order.

roaring_free_uint32_iterator
void roaring_free_uint32_iterator(roaring_uint32_iterator_t* it)

Free memory following roaring_create_iterator

Structs

roaring_array_t
struct roaring_array_t
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_bitmap_t
struct roaring_bitmap_t
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
roaring_uint32_iterator_t
struct roaring_uint32_iterator_t
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Meta