123456789101112131415161718192021222324252627282930313233343536373839404142434445464748moduletypeRANKED=sigtypetvalidx:t->int(** Index in heap. return -1 if never set *)valset_idx:t->int->unit(** Update index in heap *)valcmp:t->t->boolendmoduletypeS=sigtypeelt(** Type of elements *)typet(** Heap of {!elt}, whose priority is increased or decreased
incrementally (see {!decrease} for instance) *)valcreate:unit->t(** Create a heap *)valdecrease:t->elt->unit(** [decrease h x] decreases the value associated to [x] within [h] *)valin_heap:elt->bool(*val increase : (int -> int -> bool) -> t -> int -> unit*)valsize:t->int(** Number of integers within the heap *)valis_empty:t->boolvalclear:t->unit(** Clear the content of the heap *)valinsert:t->elt->unit(** Insert a new element into the heap *)(*val update : (int -> int -> bool) -> t -> int -> unit*)valremove_min:t->elt(** Remove and return the integer that has the lowest value from the heap
@raise Not_found if the heap is empty *)valfilter:t->(elt->bool)->unit(** Filter out values that don't satisfy the predicate *)valto_iter:t->eltIter.tend