ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
CRoaring.h File Reference

The sets of ADS as the bitmaps of CRoaring (https://github.com/RoaringBitmap/CRoaring), and back: a program that keeps a RoaringBitmap hands it to a library that takes a roaring_bitmap_t (or a roaring::Roaring of its C++ interface), and reads one that such a library returns, e.g., to combine it with the other structures of ADS. More...

#include "ADS/set/RoaringBitmap.h"
#include <roaring/roaring.h>
#include <roaring/roaring.hh>
#include <cstddef>
#include <new>
#include <span>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  ADS

Functions

roaring_bitmap_t * ADS::toCRoaring (const RoaringBitmap &s)
 the set \( s \) as a new bitmap of CRoaring, which the caller frees by roaring_bitmap_free()
RoaringBitmap ADS::fromCRoaring (const roaring_bitmap_t *r)
 the bitmap \( r \) of CRoaring as a RoaringBitmap
roaring::Roaring ADS::toRoaring (const RoaringBitmap &s)
 the set \( s \) as a roaring::Roaring of the C++ interface of CRoaring
RoaringBitmap ADS::fromCRoaring (const roaring::Roaring &r)
 the roaring::Roaring \( r \) of the C++ interface of CRoaring as a RoaringBitmap

Detailed description

The sets of ADS as the bitmaps of CRoaring (https://github.com/RoaringBitmap/CRoaring), and back: a program that keeps a RoaringBitmap hands it to a library that takes a roaring_bitmap_t (or a roaring::Roaring of its C++ interface), and reads one that such a library returns, e.g., to combine it with the other structures of ADS.

Both sides pass through the portable format of Roaring, which RoaringBitmap writes and reads [see ADS/set/RoaringBitmap.h] and CRoaring deserializes and serializes by its own functions, so that this header depends on no internal of either library: a conversion costs a buffer of portableSizeInBytes() bytes and two linear passes over it, and the containers of runs of a bitmap of CRoaring become arrays or bitmaps in ADS, which has no runs (roaring_bitmap_run_optimize() turns them back into runs on the other side, if wanted).

This header is of the set interop: no entry point of ADS includes it, and it needs CRoaring (its headers and its library), found by CMake when ADS_WITH_CROARING is AUTO or ON (the target ADS::CRoaring).

See also
D. Lemire, O. Kaser, N. Kurz, L. Deri, C. O'Hara, F. Saint-Jacques, G. Ssi-Yan-Kai, Roaring bitmaps: implementation of an optimized software library, Software: Practice and Experience 48(4), 867-895, 2018, doi:10.1002/spe.2560
Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa