module Make: functor (
T
:
T
) ->
S
with type vertex=T.vertex
and type hedge=T.hedge
and module SetV=T.SetV
and module SetH=T.SetH
and module HashV=T.HashV
and module HashH=T.HashH
type
vertex
type
hedge
val vertex_dummy : vertex
val hedge_dummy : hedge
module SetV: Sette.S
with type elt=vertex
module SetH: Sette.S
with type elt=hedge
module HashV: Hashhe.S
with type key=vertex
module HashH: Hashhe.S
with type key=hedge
val stdcompare : (vertex, hedge) SHGraph.compare
type ('a, 'b, 'c)
t
Type of hypergraphs, where
- 'a : information associated to vertices
- 'b : information associated to hedges
- 'c : user-information associated to an hypergraph
val create : int -> 'c -> ('a, 'b, 'c) t
val clear : ('a, 'b, 'c) t -> unit
val is_empty : ('a, 'b, 'c) t -> bool
Statistics
val size_vertex : ('a, 'b, 'c) t -> int
val size_hedge : ('a, 'b, 'c) t -> int
val size_edgevh : ('a, 'b, 'c) t -> int
val size_edgehv : ('a, 'b, 'c) t -> int
val size : ('a, 'b, 'c) t -> int * int * int * int
Information associated to vertives and edges
val attrvertex : ('a, 'b, 'c) t -> vertex -> 'a
val attrhedge : ('a, 'b, 'c) t -> hedge -> 'b
val info : ('a, 'b, 'c) t -> 'c
Membership tests
val is_vertex : ('a, 'b, 'c) t -> vertex -> bool
val is_hedge : ('a, 'b, 'c) t -> hedge -> bool
Successors and predecessors
val succhedge : ('a, 'b, 'c) t -> vertex -> SetH.t
val predhedge : ('a, 'b, 'c) t -> vertex -> SetH.t
val succvertex : ('a, 'b, 'c) t -> hedge -> vertex array
val predvertex : ('a, 'b, 'c) t -> hedge -> vertex array
val succ_vertex : ('a, 'b, 'c) t -> vertex -> SetV.t
val pred_vertex : ('a, 'b, 'c) t -> vertex -> SetV.t
Adding and removing elements
val add_vertex : ('a, 'b, 'c) t -> vertex -> 'a -> unit
val add_hedge : ('a, 'b, 'c) t ->
hedge ->
'b -> pred:vertex array -> succ:vertex array -> unit
val replace_attrvertex : ('a, 'b, 'c) t -> vertex -> 'a -> unit
val replace_attrhedge : ('a, 'b, 'c) t -> hedge -> 'b -> unit
val remove_vertex : ('a, 'b, 'c) t -> vertex -> unit
val remove_hedge : ('a, 'b, 'c) t -> hedge -> unit
Iterators
val iter_vertex : ('a, 'b, 'c) t ->
(vertex ->
'a -> pred:SetH.t -> succ:SetH.t -> unit) ->
unit
val iter_hedge : ('a, 'b, 'c) t ->
(hedge ->
'b -> pred:vertex array -> succ:vertex array -> unit) ->
unit
val fold_vertex : ('a, 'b, 'c) t ->
(vertex ->
'a -> pred:SetH.t -> succ:SetH.t -> 'g -> 'g) ->
'g -> 'g
val fold_hedge : ('a, 'b, 'c) t ->
(hedge ->
'b -> pred:vertex array -> succ:vertex array -> 'g -> 'g) ->
'g -> 'g
Copy and Transpose
val map : ('a, 'b, 'c) t ->
(vertex -> 'a -> 'aa) ->
(hedge -> 'b -> 'bb) -> ('c -> 'cc) -> ('aa, 'bb, 'cc) t
val copy : (vertex -> 'a -> 'aa) ->
(hedge -> 'b -> 'bb) ->
('c -> 'cc) -> ('a, 'b, 'c) t -> ('aa, 'bb, 'cc) t
val transpose : (vertex -> 'a -> 'aa) ->
(hedge -> 'b -> 'bb) ->
('c -> 'cc) -> ('a, 'b, 'c) t -> ('aa, 'bb, 'cc) t
Algorithms
val min : ('a, 'b, 'c) t -> SetV.t
val max : ('a, 'b, 'c) t -> SetV.t
val topological_sort : ?priority:hedge SHGraph.priority ->
('a, 'b, 'c) t -> vertex -> vertex list
val topological_sort_multi : ?priority:hedge SHGraph.priority ->
('a, 'b, 'c) t -> SetV.t -> vertex list
val reachable : ?filter:(hedge -> bool) ->
('a, 'b, 'c) t ->
vertex -> SetV.t * SetH.t
val reachable_multi : ?filter:(hedge -> bool) ->
('a, 'b, 'c) t ->
SetV.t -> SetV.t * SetH.t
val cfc : ?priority:hedge SHGraph.priority ->
('a, 'b, 'c) t -> vertex -> vertex list list
val cfc_multi : ?priority:hedge SHGraph.priority ->
('a, 'b, 'c) t -> SetV.t -> vertex list list
val scfc : ?priority:hedge SHGraph.priority ->
('a, 'b, 'c) t ->
vertex -> (unit, vertex) Ilist.t
val scfc_multi : ?priority:hedge SHGraph.priority ->
('a, 'b, 'c) t ->
SetV.t -> (unit, vertex) Ilist.t
Printing
val print : (Format.formatter -> vertex -> unit) ->
(Format.formatter -> hedge -> unit) ->
(Format.formatter -> 'a -> unit) ->
(Format.formatter -> 'b -> unit) ->
(Format.formatter -> 'c -> unit) ->
Format.formatter -> ('a, 'b, 'c) t -> unit
val print_dot : ?style:string ->
?titlestyle:string ->
?vertexstyle:string ->
?hedgestyle:string ->
?fvertexstyle:(vertex -> string) ->
?fhedgestyle:(hedge -> string) ->
?title:string ->
(Format.formatter -> vertex -> unit) ->
(Format.formatter -> hedge -> unit) ->
(Format.formatter -> vertex -> 'a -> unit) ->
(Format.formatter -> hedge -> 'b -> unit) ->
Format.formatter -> ('a, 'b, 'c) t -> unit