module BitSet:Efficient bit sets.sig..end
A bitset is an array of boolean values that can be accessed with indexes
like an array but provides a better memory usage (divided by 8) for a
very small speed trade-off.
type t
exception Negative_index of string
val empty : unit -> tval create : int -> tval copy : t -> tval clone : t -> tcopyval set : t -> int -> unitset s n sets the nth-bit in the bitset s to true.val unset : t -> int -> unitunset s n sets the nth-bit in the bitset s to false.val put : t -> bool -> int -> unitput s v n sets the nth-bit in the bitset s to v.val toggle : t -> int -> unittoggle s n changes the nth-bit value in the bitset s.val is_set : t -> int -> boolis_set s n returns true if nth-bit in the bitset s is set,
or false otherwise.val compare : t -> t -> intcompare s1 s2 compares two bitsets. Highest bit indexes are
compared first.val equals : t -> t -> boolequals s1 s2 returns true if, and only if, all bits values in s1 are
the same as in s2.val count : t -> intcount s returns the number of bits set in the bitset s.val enum : t -> int Enum.tenum s returns an enumeration of bits which are set
in the bitset s.val intersect : t -> t -> unitintersect s t sets s to the intersection of the sets s and t.val unite : t -> t -> unitunite s t sets s to the union of the sets s and t.val differentiate : t -> t -> unitdifferentiate s t removes the elements of t from s.val differentiate_sym : t -> t -> unitdifferentiate_sym s t sets s to the symmetrical difference of the
sets s and t.