Computes the difference (andnot) between two bitmaps and returns a new
bitmap. The caller is responsible for free-ing the result.
The returned pointer may be NULL in case of errors.
Dynamically allocates a new bitmap (initially empty).
Client is responsible for calling roaring64_bitmap_free().
The returned pointer may be NULL in case of errors.
Compute the negation of the bitmap in the interval [min, max).
The number of negated values is max - min. Areas outside the range are
passed through unchanged.
The returned pointer may be NULL in case of errors.
Compute the negation of the bitmap in the interval [min, max].
The number of negated values is max - min + 1. Areas outside the range are
passed through unchanged.
The returned pointer may be NULL in case of errors.
In-place version of roaring64_bitmap_flip_closed. Compute the negation of
the bitmap in the interval [min, max]. The number of negated values is max - min + 1. Areas outside the range are passed through unchanged.
In-place version of roaring64_bitmap_flip. Compute the negation of the
bitmap in the interval [min, max). The number of negated values is max - min. Areas outside the range are passed through unchanged.
Create a new bitmap containing all the values in [min, max) that are at a
distance k*step from min.
The returned pointer may be NULL in case of errors.
Serializes the bitmap in a “frozen” format. The given buffer must be at least
roaring64_bitmap_frozen_size_in_bytes() in size. Returns the number of
bytes used for serialization.
Creates a readonly bitmap that is a view of the given buffer. The buffer
must be created with roaring64_bitmap_frozen_serialize(), and must be
aligned by 64 bytes.
Returns true if the given value is in the bitmap, and sets out_index to the
(0-based) index of the value in the bitmap. Returns false if the value is not
in the bitmap.
Computes the union between two bitmaps and returns new bitmap. The caller is
responsible for free-ing the result.
The returned pointer may be NULL in case of errors.
Returns the number of integers that are smaller or equal to x. Thus if x is
the first element, this function will return 1. If x is smaller than the
smallest element, this function will return 0.
Selects the element at index ‘rank’ where the smallest element is at index 0.
If the size of the bitmap is strictly greater than rank, then this function
returns true and sets element to the element of given rank. Otherwise, it
returns false.
Computes the symmetric difference (xor) between two bitmaps and returns a new
bitmap. The caller is responsible for free-ing the result.
The returned pointer may be NULL in case of errors.
Advance the iterator. If there is a new value, then
roaring64_iterator_has_value() returns true. Values are traversed in
increasing order. For convenience, returns the result of
roaring64_iterator_has_value().
Move the iterator to the first value greater than or equal to val, if it
exists at or after the current position of the iterator. If there is a new
value, then roaring64_iterator_has_value() returns true. Values are
traversed in increasing order. For convenience, returns the result of
roaring64_iterator_has_value().
Decrement the iterator. If there is a new value, then
roaring64_iterator_has_value() returns true. Values are traversed in
decreasing order. For convenience, returns the result of
roaring64_iterator_has_value().
Reads up to count values from the iterator into the given buf. Returns
the number of elements read. The number of elements read can be smaller than
count, which means that there are no more elements in the bitmap.
Return a copy of the bitmap with all values shifted by offset.
The returned pointer may be NULL in case of errors. The caller is responsible
for freeing the return bitmap.
Computes the difference (andnot) between two bitmaps and returns new bitmap.
Caller is responsible for freeing the result.
The returned pointer may be NULL in case of errors.
Empties the bitmap. It will have no auxiliary allocations (so if the bitmap
was initialized in client memory via roaring_bitmap_init(), then a call to
roaring_bitmap_clear() would be enough to “free” it)
Dynamically allocates a new bitmap (initially empty).
Returns NULL if the allocation fails.
Capacity is a performance hint for how many “containers” the data will need.
Client is responsible for calling roaring_bitmap_free().
Compute the negation of the bitmap in the interval [range_start, range_end).
The number of negated values is range_end - range_start.
Areas outside the range are passed through unchanged.
The returned pointer may be NULL in case of errors.
Compute the negation of the bitmap in the interval [range_start, range_end].
The number of negated values is range_end - range_start + 1.
Areas outside the range are passed through unchanged.
The returned pointer may be NULL in case of errors.
compute (in place) the negation of the roaring bitmap within a specified
interval: [range_start, range_end). The number of negated values is
range_end - range_start.
Areas outside the range are passed through unchanged.
compute (in place) the negation of the roaring bitmap within a specified
interval: [range_start, range_end]. The number of negated values is
range_end - range_start + 1.
Areas outside the range are passed through unchanged.
Add all the values between min (included) and max (excluded) that are at a
distance k*step from min.
The returned pointer may be NULL in case of errors.
Creates constant bitmap that is a view of a given buffer.
Buffer data should have been written by roaring_bitmap_frozen_serialize()
Its beginning must also be aligned by 32 bytes.
Length must be equal exactly to roaring_bitmap_frozen_size_in_bytes().
In case of failure, NULL is returned.
Returns the index of x in the given roaring bitmap.
If the roaring bitmap doesn’t contain x , this function will return -1.
The difference with rank function is that this function will return -1 when x
is not the element of roaring bitmap, but the rank function will return a
non-negative number.
Initialize a roaring bitmap structure in memory controlled by client.
The bitmap will be in a “clear” state, with no auxiliary allocations.
Since this performs no allocations, the function will not fail.
Initialize a roaring bitmap structure in memory controlled by client.
Capacity is a performance hint for how many “containers” the data will need.
Can return false if auxiliary allocations fail when capacity greater than 0.
Perform internal consistency checks. Returns true if the bitmap is
consistent. It may be useful to call this after deserializing bitmaps from
untrusted sources. If roaring_bitmap_internal_validate returns true, then the
bitmap should be consistent and can be trusted not to cause crashes or memory
corruption.
Computes the union between two bitmaps and returns new bitmap. The caller is
responsible for memory management.
The returned pointer may be NULL in case of errors.
Compute the union of ‘number’ bitmaps.
Caller is responsible for freeing the result.
See also roaring_bitmap_or_many_heap()
The returned pointer may be NULL in case of errors.
Compute the union of ‘number’ bitmaps using a heap. This can sometimes be
faster than `roaring_bitmap_or_many() which uses a naive algorithm.
Caller is responsible for freeing the result.
Copies a bitmap from src to dest. It is assumed that the pointer dest
is to an already allocated bitmap. The content of the dest bitmap is
freed/deleted.
roaring_bitmap_rank returns the number of integers that are smaller or equal
to x. Thus if x is the first element, this function will return 1. If
x is smaller than the smallest element, this function will return 0.
Selects the element at index ‘rank’ where the smallest element is at index 0.
If the size of the roaring bitmap is strictly greater than rank, then this
function returns true and sets element to the element of given rank.
Otherwise, it returns false.
Store the bitmap to a bitset. This can be useful for people
who need the performance and simplicity of a standard bitset.
We assume that the input bitset is originally empty (does not
have any set bit).
Computes the symmetric difference (xor) between two bitmaps
and returns new bitmap. The caller is responsible for memory management.
The returned pointer may be NULL in case of errors.
Initialize an iterator object that can be used to iterate through the values.
If there is a value, then this iterator points to the first value and
it->has_value is true. The value is in it->current_value.
Initialize an iterator object that can be used to iterate through the values.
If there is a value, then this iterator points to the last value and
it->has_value is true. The value is in it->current_value.
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.
Move the iterator to the first value >= val. If there is a such a value,
then it->has_value is true. The new value is in it->current_value.
For convenience, returns it->has_value.
Decrement the iterator. If there’s a new value, then it->has_value is true.
The new value is in it->current_value. Values are traversed in decreasing
order. For convenience, returns it->has_value.
Reads next ${count} values from iterator into user-supplied ${buf}.
Returns the number of read elements.
This number can be smaller than ${count}, which means that iterator is
drained.
Skip the next ${count} values from iterator.
Returns the number of values actually skipped.
The number can be smaller than ${count}, which means that iterator is
drained.
Skip the previous ${count} values from iterator (move backwards).
Returns the number of values actually skipped backwards.
The number can be smaller than ${count}, which means that iterator reached
the beginning.