5 The module @samp{bitset} provides a common interface to several
6 implementations of bitsets. It also provides routines for vectors of bitsets.
8 To look at an existing use, see GNU Bison.
10 Currently it supports five flavours of bitsets:
13 Array of bits (fixed size, fast for dense bitsets). Memory for bit array
14 and bitset structure allocated contiguously.
16 Linked list of arrays of bits (variable size, least storage for large
19 Expandable table of pointers to arrays of bits (variable size, less
20 storage for large sparse sets). Faster than @code{BITSET_LIST} for
23 Variable array of bits (variable size, fast for dense bitsets).
25 Wrapper bitset for internal use only. Used for gathering statistics
26 and/or better run-time checking.
29 However, the choice of the actual implementation is performed by the
30 library, based on the user provided attributes:
44 Prefer fastest at memory expense.
51 bitset bs0 = bitset_create (nbits, BITSET_FIXED);
56 bitset bs1 = bitset_create (nbits, BITSET_FIXED);
61 bitset bs = bitset_create (nbits, BITSET_FIXED);
62 bitset_or (bs, bs0, bs1);
63 ASSERT (bitset_count (bs) == 6);