Binsec.BitsetBitsets
A dense representation for sets of integers.
If your set is sparse with a big upper-bound, think twice about using this data structure since both absence and presence are explicitly marked as a bit value.
val create : int -> tcreate n creates a bitset containing at most n 0-indexed elements.
val get : t -> int -> boolget b i gets the ith bit of bitset b
subset b1 b2 tests if b1 is a subset of b2.
@requires size b1 <= size b2. Otherwise returns false.
val size : t -> intsize b returns the number of elements that b can contain
val cardinal : t -> intcardinal b returns the number of elements that b does contain, i.e, the number of bits actually set in b.
val pp : Format.formatter -> t -> unitpp ppf b outputs a string representation of b into the pretty-print formatter ppf.
The string representation is the hexadecimal string representing the bitset.
val fold : ('a -> int -> 'a) -> 'a -> t -> 'a