Lely core libraries
2.2.5
|
Go to the documentation of this file.
22 #ifndef LELY_UTIL_BITSET_H_
23 #define LELY_UTIL_BITSET_H_
117 #endif // !LELY_UTIL_BITSET_H_
int bitset_init(struct bitset *set, int size)
Initializes a bitset.
void bitset_compl(struct bitset *set)
Flip all bits in set.
void bitset_fini(struct bitset *set)
Finalizes a bitset.
void bitset_clr(struct bitset *set, int n)
Clears bit n in set.
void bitset_clr_all(struct bitset *set)
Clears all bits in set.
int bitset_resize(struct bitset *set, int size)
Resizes a bitset.
void bitset_set(struct bitset *set, int n)
Sets bit n in set.
int bitset_test(const struct bitset *set, int n)
Returns 1 if bit n in set is set, and 0 otherwise.
int size
The number of integers in bits.
int bitset_fnz(const struct bitset *set, int n)
Returns the index (starting from one) of the first zero bit higher or equal to n in set,...
int bitset_size(const struct bitset *set)
Returns the size (in number of bits) of set.
int bitset_ffz(const struct bitset *set)
Returns the index (starting from one) of the first zero bit in set, or 0 if all bits are set.
int bitset_fns(const struct bitset *set, int n)
Returns the index (starting from one) of the first set bit higher or equal to n in set,...
void bitset_set_all(struct bitset *set)
Sets all bits in set.
int bitset_ffs(const struct bitset *set)
Returns the index (starting from one) of the first set bit in set, or 0 if all bits are zero.
unsigned int * bits
An array of size integers.