1#ifndef LIBNAGIOS_bitmap_h__
2#define LIBNAGIOS_bitmap_h__
13typedef struct bitmap bitmap;
74#define bitmap_size bitmap_cardinality
unsigned long bitmap_cardinality(const bitmap *bm)
Obtain cardinality (max number of elements) of the bitmaptor.
int bitmap_resize(bitmap *bm, unsigned long size)
Resize a bitmap If the bitmap is made smaller, data will silently be lost.
bitmap * bitmap_diff(const bitmap *a, const bitmap *b)
Calculate set difference between two bitmaps The set difference of A / B is defined as all members of...
unsigned long bitmap_count_set_bits(const bitmap *bm)
Count set bits in map.
bitmap * bitmap_create(unsigned long size)
Create a bitmaptor of size 'size'.
void bitmap_destroy(bitmap *bm)
Destroy a bitmaptor by freeing all the memory it uses.
void bitmap_clear(bitmap *bm)
Unset all bits in a bitmap.
bitmap * bitmap_copy(const bitmap *bm)
Copy a bitmaptor.
int bitmap_set(bitmap *bm, unsigned long pos)
Set a bit in the map.
int bitmap_unset(bitmap *bm, unsigned long pos)
Unset a particular bit in the map.
bitmap * bitmap_symdiff(const bitmap *a, const bitmap *b)
Calculate symmetric difference between two bitmaps The symmetric difference between A and B is the se...
bitmap * bitmap_intersect(const bitmap *a, const bitmap *b)
Calculate intersection of two bitmaps The intersection is defined as all bits that are members of bot...
unsigned long bitmap_count_unset_bits(const bitmap *bm)
Count unset bits in map.
bitmap * bitmap_union(const bitmap *a, const bitmap *b)
Calculate union of two bitmaps The union is defined as all bits that are members of A or B or both A ...
bitmap * bitmap_unite(bitmap *res, const bitmap *addme)
Calculate union of two bitmaps and store result in one of them.
int bitmap_isset(const bitmap *bm, unsigned long pos)
Check if a particular bit is set in the map.
int bitmap_cmp(const bitmap *a, const bitmap *b)
Compare two bitmaps for equality.