package ocamlgraph
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A generic graph library for OCaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
ocamlgraph-2.0.0.tbz
sha256=20fe267797de5322088a4dfb52389b2ea051787952a8a4f6ed70fcb697482609
sha512=c4973ac03bdff52d1c8a1ed01c81e0fbe2f76486995e57ff4e4a11bcc7b1793556139d52a81ff14ee8c8de52f1b40e4bd359e60a2ae626cc630ebe8bccefb3f1
doc/src/ocamlgraph/gmap.ml.html
Source file gmap.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105(**************************************************************************) (* *) (* Ocamlgraph: a generic graph library for OCaml *) (* Copyright (C) 2004-2010 *) (* Sylvain Conchon, Jean-Christophe Filliatre and Julien Signoles *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Library General Public *) (* License version 2.1, with the special exception on linking *) (* described in file LICENSE. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (**************************************************************************) (** {2 Mapping of vertices} *) module type V_SRC = sig type t module V : Sig.HASHABLE val fold_vertex : (V.t -> 'a -> 'a) -> t -> 'a -> 'a end module type V_DST = sig type t type vertex val empty : unit -> t val add_vertex : t -> vertex -> t end module Vertex(G_Src : V_SRC)(G_Dst : V_DST ) = struct module H = Hashtbl.Make(G_Src.V) let vertices = H.create 97 let convert_vertex f x = try H.find vertices x with Not_found -> let x' = f x in H.add vertices x x'; x' let map f g = H.clear vertices; G_Src.fold_vertex (fun x g -> G_Dst.add_vertex g (convert_vertex f x)) g (G_Dst.empty ()) let filter_map f g = G_Src.fold_vertex (fun x g -> match f x with | Some e -> G_Dst.add_vertex g e | None -> g ) g (G_Dst.empty ()) end (** {2 Mapping of edges} *) module type E_SRC = sig type t module E : Sig.ORDERED_TYPE val fold_edges_e : (E.t -> 'a -> 'a) -> t -> 'a -> 'a end module type E_DST = sig type t type edge val empty : unit -> t val add_edge_e : t -> edge -> t end module Edge(G_Src: E_SRC)(G_Dst: E_DST) = struct module M = Map.Make(G_Src.E) let edges = ref M.empty let convert_edge f x = try M.find x !edges with Not_found -> let x' = f x in edges := M.add x x' !edges; x' let map f g = edges := M.empty; G_Src.fold_edges_e (fun x g -> G_Dst.add_edge_e g (convert_edge f x)) g (G_Dst.empty ()) let filter_map f g = G_Src.fold_edges_e (fun x g -> match f x with | Some e -> G_Dst.add_edge_e g e | None -> g ) g (G_Dst.empty ()) end (* Vertex (struct include G_Src module V = E let fold_vertex = fold_edges_e end) (struct include G_Dst type vertex = edge let add_vertex = add_edge_e end) *)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>