22 #ifndef __CCL_BITTABLE_H__
23 # define __CCL_BITTABLE_H__
53 #define ccl_bittable_delete ccl_bittable_del_reference
92 ccl_bittable_set_array (
ccl_bittable *bt,
int size,
int *array);
197 extern ccl_int_iterator *
int ccl_bittable_get_size(const ccl_bittable *bt)
Returns the number of bits of the table.
unsigned int ccl_bittable_hash(const ccl_bittable *bt)
Computes an hashed value of the content of bt.
ccl_bittable * ccl_bittable_resize(ccl_bittable *bt, int newsize)
Resize the table of bits bt for newsize bits.
int ccl_bittable_get_nb_one(const ccl_bittable *bt)
Returns the number of bits set to 1 in bt/.
ccl_int_iterator * ccl_bittable_get_ones(ccl_bittable *bt)
Returns an iterator that gives positions of bit equal to 1.
ccl_bittable * ccl_bittable_dup(const ccl_bittable *bt)
Duplicates the table bt.
A generic iterator interface.
ccl_bittable * ccl_bittable_sub(const ccl_bittable *bt1, const ccl_bittable *bt2)
Computes the bitwise difference of tables bt1 and bt2.
ccl_bittable * ccl_bittable_create(int size)
Creates a new table of bits large enough for size bits.
void ccl_bittable_set(ccl_bittable *bt, int index)
Set the bit at position index.
void ccl_bittable_window_union(ccl_bittable *bt_dst, int dst, const ccl_bittable *bt_src, int src, int w)
Makes a bitwise disjunction between bts_dst and bt_src but on a restricted part of indices...
ccl_bittable * ccl_bittable_union(const ccl_bittable *bt1, const ccl_bittable *bt2)
Computes the bitwise disjunction of tables bt1 and bt2.
int ccl_bittable_equals(const ccl_bittable *bt1, const ccl_bittable *bt2)
Checks if bt1 and bt2 are equal.
int ccl_bittable_get_next(const ccl_bittable *bt, int prev)
Returns the index of the first non-null bit encountered after the position prev.
void ccl_bittable_log(ccl_log_type log, const ccl_bittable *bt)
Display the content of the table bt to the stream log.
void ccl_bittable_clear(ccl_bittable *bt)
Sets to zero all bits of bt.
ccl_bittable * ccl_bittable_intersection(const ccl_bittable *bt1, const ccl_bittable *bt2)
Computes the bitwise conjunction of tables bt1 and bt2.
void ccl_bittable_unset(ccl_bittable *bt, int index)
Unset the bit at position index.
int ccl_bittable_is_included_in(const ccl_bittable *bt1, const ccl_bittable *bt2)
Checks if the set represented by bt1 is included in bt2.
struct ccl_bittable_st ccl_bittable
Abstract type of a vector of bytes.
int ccl_bittable_has(const ccl_bittable *bt, int index)
Checks if the bit at position index is set or not.
int ccl_bittable_window_union_with_roll(ccl_bittable *bt_dst, int dst, const ccl_bittable *bt_src, int src, int w)
Does the same work than ccl_bittable_window_union but the window of bt_src is rolled for 1 bit on the...
ccl_bittable * ccl_bittable_nary_union(ccl_bittable **bts, int nb_bts)
Computes the bitwise disjunction of tables bt[0], ..., bt[nb_bts-1].
Some useful and common macros.
enum ccl_log_type_enum ccl_log_type
Enum that indicates which kind of message has to be displayed. Each kind of message can be displayed ...
ccl_bittable * ccl_bittable_complement(const ccl_bittable *bt)
Negate the bits of bt.
int ccl_bittable_get_first(const ccl_bittable *bt)
Returns the index of the first non-null bit.