Lines Matching full:bset
90 #define EBITSET_ELTS(BSET) ((BSET)->e.elts)
91 #define EBITSET_SIZE(BSET) EBITSET_N_ELTS (BITSET_NBITS_ (BSET))
92 #define EBITSET_ASIZE(BSET) ((BSET)->e.size)
97 /* Disable bitset cache and mark BSET as being zero. */
98 #define EBITSET_ZERO_SET(BSET) ((BSET)->b.cindex = BITSET_WINDEX_MAX, \
99 (BSET)->b.cdata = 0)
101 #define EBITSET_CACHE_DISABLE(BSET) ((BSET)->b.cindex = BITSET_WINDEX_MAX)
103 /* Disable bitset cache and mark BSET as being possibly non-zero. */
104 #define EBITSET_NONZERO_SET(BSET) \
105 (EBITSET_CACHE_DISABLE (BSET), (BSET)->b.cdata = (bitset_word *)~0)
109 #define EBITSET_ZERO_P(BSET) ((BSET)->b.cdata == 0)
113 #define EBITSET_CACHE_SET(BSET, EINDEX) \
114 ((BSET)->b.cindex = (EINDEX) * EBITSET_ELT_WORDS, \
115 (BSET)->b.cdata = EBITSET_WORDS (EBITSET_ELTS (BSET) [EINDEX]))
252 /* Remove element with index EINDEX from bitset BSET. */
254 ebitset_elt_remove (bitset bset, bitset_windex eindex)
259 elts = EBITSET_ELTS (bset);
268 /* Add ELT into elts at index EINDEX of bitset BSET. */
270 ebitset_elt_add (bitset bset, ebitset_elt *elt, bitset_windex eindex)
274 elts = EBITSET_ELTS (bset);
295 ebitset_elt_find (bitset bset, bitset_bindex bindex,
305 elts = EBITSET_ELTS (bset);
306 size = EBITSET_SIZE (bset);
312 if (EBITSET_WORDS (elt) == bset->b.cdata)
315 EBITSET_CACHE_SET (bset, eindex);
332 ebitset_resize (bset, bindex);
336 ebitset_elt_add (bset, elt, eindex);
337 EBITSET_CACHE_SET (bset, eindex);
348 ebitset_weed (bitset bset)
354 if (EBITSET_ZERO_P (bset))
357 elts = EBITSET_ELTS (bset);
359 for (j = 0; j < EBITSET_SIZE (bset); j++)
367 ebitset_elt_remove (bset, j);
379 For now just mark BSET as known to be zero. */
380 EBITSET_ZERO_SET (bset);
383 EBITSET_NONZERO_SET (bset);
391 ebitset_zero (bitset bset)
396 if (EBITSET_ZERO_P (bset))
399 elts = EBITSET_ELTS (bset);
400 for (j = 0; j < EBITSET_SIZE (bset); j++)
405 ebitset_elt_remove (bset, j);
409 For now just mark BSET as known to be zero. */
410 EBITSET_ZERO_SET (bset);
555 ebitset_free (bitset bset)
557 ebitset_zero (bset);
558 free (EBITSET_ELTS (bset));
562 /* Find list of up to NUM bits set in BSET starting from and including
566 ebitset_list_reverse (bitset bset, bitset_bindex *list,
581 if (EBITSET_ZERO_P (bset))
584 size = EBITSET_SIZE (bset);
591 elts = EBITSET_ELTS (bset);
651 /* Find list of up to NUM bits set in BSET starting from and including
655 ebitset_list (bitset bset, bitset_bindex *list,
667 if (EBITSET_ZERO_P (bset))
673 elts = EBITSET_ELTS (bset);
674 size = EBITSET_SIZE (bset);
1336 ebitset_init (bitset bset, bitset_bindex n_bits)
1338 bset->b.vtable = &ebitset_vtable;
1340 bset->b.csize = EBITSET_ELT_WORDS;
1342 EBITSET_ZERO_SET (bset);
1344 EBITSET_ASIZE (bset) = 0;
1345 EBITSET_ELTS (bset) = 0;
1346 ebitset_resize (bset, n_bits);
1348 return bset;