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