module Make_set:Functor building an implementation of sets over indices.
Parameters: |
|
type
elt
type
t
val create : unit -> t
val size : t -> int
size s >= 0
val is_empty : t -> bool
val mem : t -> elt -> bool
val add : t -> elt -> unit
add s e
adds element e
to the set s
in (amortized)
constant time.
Index.Set.mem
s n
not (
Index.Set.is_empty
s)
val remove : t -> elt -> unit
val clear : t -> unit
val iter : (elt -> unit) -> t -> unit
iter c s
applies c
to all elements of s
.val iter_const : ('a -> elt -> unit) -> 'a -> t -> unit
val fold : ('a -> elt -> 'a) -> 'a -> t -> 'a
fold f a s
applies f
to an accumulated value and each
element in the set s
.val fold_const : ('a -> 'b -> elt -> 'b) -> 'a -> 'b -> t -> 'b