Lines Matching defs:sparsebit
9 * with an index size of 2^64. A sparsebit array is allocated through
13 * struct sparsebit *s;
17 * The struct sparsebit type resolves down to a struct sparsebit.
18 * Note that, sparsebit_free() takes a pointer to the sparsebit
20 * the pointer (e.g. set it to NULL) to the struct sparsebit before
25 * that can be performed on the allocated sparsebit array. All of
44 * sparsebit array. This can be done via code with the following structure:
63 * sparsebit array has at least a single bit set before calling
67 * For the most part the internal implementation of sparsebit is
70 * implementation. This implementation of a sparsebit array is not
159 #include "sparsebit.h"
177 struct sparsebit {
181 * the entire sparsebit array.
205 static struct node *node_first(struct sparsebit *s)
219 static struct node *node_next(struct sparsebit *s, struct node *np)
247 static struct node *node_prev(struct sparsebit *s, struct node *np)
310 static struct node *node_find(struct sparsebit *s, sparsebit_idx_t idx)
333 static struct node *node_add(struct sparsebit *s, sparsebit_idx_t idx)
395 /* Returns whether all the bits in the sparsebit array are set. */
396 bool sparsebit_all_set(struct sparsebit *s)
409 static void node_rm(struct sparsebit *s, struct node *nodep)
498 static struct node *node_split(struct sparsebit *s, sparsebit_idx_t idx)
599 static void node_reduce(struct sparsebit *s, struct node *nodep)
776 * sparsebit array is set or not.
778 bool sparsebit_is_set(struct sparsebit *s, sparsebit_idx_t idx)
801 /* Within the sparsebit array pointed to by s, sets the bit
804 static void bit_set(struct sparsebit *s, sparsebit_idx_t idx)
828 /* Within the sparsebit array pointed to by s, clears the bit
831 static void bit_clear(struct sparsebit *s, sparsebit_idx_t idx)
924 static void sparsebit_dump_internal(FILE *stream, struct sparsebit *s,
935 /* Allocates and returns a new sparsebit array. The initial state
936 * of the newly allocated sparsebit array has all bits cleared.
938 struct sparsebit *sparsebit_alloc(void)
940 struct sparsebit *s;
952 /* Frees the implementation dependent data for the sparsebit array
955 void sparsebit_free(struct sparsebit **sbitp)
957 struct sparsebit *s = *sbitp;
967 /* Makes a copy of the sparsebit array given by s, to the sparsebit
972 void sparsebit_copy(struct sparsebit *d, struct sparsebit *s)
984 bool sparsebit_is_set_num(struct sparsebit *s,
1008 bool sparsebit_is_clear(struct sparsebit *s,
1015 bool sparsebit_is_clear_num(struct sparsebit *s,
1042 * to determine if the sparsebit array has any bits set.
1044 sparsebit_num_t sparsebit_num_set(struct sparsebit *s)
1049 /* Returns whether any bit is set in the sparsebit array. */
1050 bool sparsebit_any_set(struct sparsebit *s)
1072 /* Returns whether all the bits in the sparsebit array are cleared. */
1073 bool sparsebit_all_clear(struct sparsebit *s)
1078 /* Returns whether all the bits in the sparsebit array are set. */
1079 bool sparsebit_any_clear(struct sparsebit *s)
1086 sparsebit_idx_t sparsebit_first_set(struct sparsebit *s)
1100 sparsebit_idx_t sparsebit_first_clear(struct sparsebit *s)
1154 sparsebit_idx_t sparsebit_next_set(struct sparsebit *s,
1247 sparsebit_idx_t sparsebit_next_clear(struct sparsebit *s,
1303 sparsebit_idx_t sparsebit_next_set_num(struct sparsebit *s,
1338 sparsebit_idx_t sparsebit_next_clear_num(struct sparsebit *s,
1370 void sparsebit_set_num(struct sparsebit *s,
1452 void sparsebit_clear_num(struct sparsebit *s,
1521 void sparsebit_set(struct sparsebit *s, sparsebit_idx_t idx)
1527 void sparsebit_clear(struct sparsebit *s, sparsebit_idx_t idx)
1532 /* Sets the bits in the entire addressable range of the sparsebit array. */
1533 void sparsebit_set_all(struct sparsebit *s)
1540 /* Clears the bits in the entire addressable range of the sparsebit array. */
1541 void sparsebit_clear_all(struct sparsebit *s)
1577 * is an example output of a sparsebit array that has bits:
1581 * This corresponds to a sparsebit whose bits 5, 8, 10, 11, 12, 13, 14, 18
1586 void sparsebit_dump(FILE *stream, struct sparsebit *s,
1680 /* Validates the internal state of the sparsebit array given by
1684 void sparsebit_validate_internal(struct sparsebit *s)
1886 * of some invariants and of a trivial representation of sparsebit.
1898 struct sparsebit *s;