Expand description
A fast, efficient, sparse, & ordered unsigned integer (u32
) bit set.
There are a couple of differences with super::IntSet
:
- This set is not invertible and can only record the set of integers which are members.
- This set works only with
u32
values, unlikesuper::IntSet
which supports custom integer types.
When dealing with only u32
โs and invertibility is not needed then this set is slightly faster
than the more generic super::IntSet
.
The bitset is implemented using fixed size pages which allows it to compactly represent sparse membership. However, the set excels when set members are typically clustered together. For example when representing glyph id or unicode codepoint values in a font.
When constructing a new U32Set
from an existing list of integer values the most efficient
way to create the set is to initialize it from a sorted list of values via the extend() method.
Structsยง
- Page
Info ๐ - U32Set
- A fast, efficient, sparse, & ordered
u32
set. - U32Set
Builder ๐ - This helper is used to construct
U32Set
โs from a stream of possibly sorted values. It remembers the last page index to reduce the amount of page lookups needed when inserting sorted data. If given unsorted values it will still work correctly, but may be slower then just repeatedly callinginsert()
on the bitset. - U32Set
Range ๐Iter
Constantsยง
- PAGE_
BITS_ ๐LOG_ 2