denseBitset(
options?):Bitset
Defined in: packages/bitset/src/dense-bitset.ts:25
A bitset of unsigned 32-bit ids over one flat bitmap.
One bit per possible id up to the largest stored id, with no chunk directory, so it is the faster layout for a set whose ids fill a compact range — and the layout whose memory follows the span rather than the content. Choose it only when the largest id is known and per-id traffic dominates.
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional items, added as if by add.
Returns
Section titled “Returns”Throws
Section titled “Throws”With code INVALID_ID when an item is not in 0 … BITSET_MAX_ID.
Throws
Section titled “Throws”With code MAX_CAPACITY_EXCEEDED when the bitmap the items span cannot be allocated.
Example
Section titled “Example”const visited = denseBitset({ items: [0, 2, 4] })visited.size // 3visited.rank(2) // 2