Module type CCMultiSet.S
val empty : t
val is_empty : t -> bool
val mem : t -> elt -> bool
val count : t -> elt -> int
val singleton : elt -> t
val add : t -> elt -> t
val remove : t -> elt -> t
val add_mult : t -> elt -> int -> t
add_mult set x n
addsn
occurrences ofx
toset
.- raises Invalid_argument
if
n < 0
.
- since
- 0.6
val remove_mult : t -> elt -> int -> t
remove_mult set x n
removes at mostn
occurrences ofx
fromset
.- raises Invalid_argument
if
n < 0
.
- since
- 0.6
val update : t -> elt -> (int -> int) -> t
update set x f
callsf n
wheren
is the current multiplicity ofx
inset
(0
to indicate its absence); the result off n
is the new multiplicity ofx
.- raises Invalid_argument
if
f n < 0
.
- since
- 0.6
val union : t -> t -> t
union a b
contains as many occurrences of an elementx
ascount a x + count b x
.
val meet : t -> t -> t
meet a b
is a multiset such thatcount (meet a b) x = max (count a x) (count b x)
.
val intersection : t -> t -> t
intersection a b
is a multiset such thatcount (intersection a b) x = min (count a x) (count b x)
.
val compare : t -> t -> int
val equal : t -> t -> bool
val cardinal : t -> int
Number of distinct elements.