module BitSet: sig end
A bitset is a array of boolean values that can be accessed with indexes
like an array but provide a better memory usage (divided by 32) for a
very small speed tradeoff.
type
t
exception Negative_index of string
val empty : unit -> t
val create : int -> t
val clone : t -> t
val set : t -> int -> unit
set s n
set the nth-bit in the bitset s
to true.val unset : t -> int -> unit
unset s n
set the nth-bit in the bitset s
to false.val put : t -> bool -> int -> unit
put s v n
set the nth-bit in the bitset s
to v
.val toggle : t -> int -> unit
toggle s n
change the nth-bit value in the bitset s
.val is_set : t -> int -> bool
is_set s n
return true if nth-bit it the bitset s
is set,
or false otherwise.val compare : t -> t -> int
compare s1 s2
compare two bitsets. Highest bit indexes are
compared first.val equals : t -> t -> bool
equals s1 s2
return true if all bits value in s1 are same as s2.val count : t -> int
count s
returns the number of bits set in the bitset s
.val enum : t -> int Enum.t
enum s
return an enumeration of bit indexed which are set
in the bitset s
.