Skip to content
Commits on Source (9)
* marks some incompatible change
version 1.8.8, October 17, 2017
-------------------------------
o fixed installation (Virgile Prevosto, Jacques-Pascal Deplaix)
o safe-string compatible (Jacques-Pascal Deplaix)
* fixed method get_edge_layout of class abstract_model of DGraphModel.Make. The
bug could have occured when there are several edges between two vertices.
o [Traverse/Pack] added Dfs.fold and Dfs.fold_component (tail-recursive)
(contributed by Guillaume Chelfi)
* fixed implementation of Golberg-Tarjan maximal flow algorithm
(contributed by Guyslain Naves)
No more function min_capacity in the input interface.
Renaming as follows: Flow.Goldberg -> Flow.Goldberg_Tarjan
and Pack.goldberg -> Pack.goldberg_tarjan
o new functors [WeakTopological] and [ChaoticIteration] to compute
fixpoints with widening, following Bourdoncle's algorithms (contributed
by Thibault Suzanne)
version 1.8.7, April 12, 2016
-----------------------------
o fixed examples/demo.ml so that it also compiles with an installed OCamlGraph
o [Components] fixed stack overflow with [scc] (patch by Albin Coquereau)
o [Dominator] fixed stack overflow (patch by Albin Coquereau)
o new functor [Path.Johnson] to compute all pairs of shortest paths
using Johnson's algorithm (contributed by Mrio Pereira)
o fixed configuration on Windows (patch by Martin R. Neuhuer)
o new functor [Components.Undirected] to compute connected components
o Graphviz: fixed printing of attribute BgcolorWithTransparency
* Prim, Nonnegative: function weight now has the more general type "edge -> t"
(to be consistent with Path)
o new module type Sig.WEIGHT (used in Path, Prim, and Nonnegative)
o Fixpoint: do not catch Not_found raised by a user-provided function.
o Adding folds to BFS.
version 1.8.6, January 23, 2015
-------------------------------
o Dominator: new functor [Make_graph] with may use graph building operations,
* Dominator: new functor [Make_graph] with may use graph building operations,
while the old functor [Make] now only requires a read-only graph.
Function [compute_all] and [compute_dom_graph] are now only defined in the
new [Make_graph] functor.
o Graphviz: support for additional polygonal-shapes
o New module Clique (contributed by Giselle Reis)
o Avoid ocamldoc error with OCaml 4.02
......
===========================
How to create the library ?
===========================
= How to create the library ?
You need Objective Caml >= 3.10.2 to compile this library.
......@@ -9,6 +7,9 @@ Configure with
./configure
(If the `./configure` file does not exist,
run `autoconf` first.)
Compile with
make
......@@ -21,9 +22,7 @@ findlib users may also do
make install-findlib
=================================
How to create the documentation ?
=================================
== How to create the documentation ?
create a local documentation with
......
......@@ -2,4 +2,22 @@ version = "VERSION"
description = "Generic Graph Library"
requires=""
archive(byte) = "CMA"
archive(byte,plugin) = "CMA"
archive(native) = "CMXA"
archive(native,plugin) = "CMXS"
package "dgraph" (
exists_if = "dgraph.cmi"
description = "Library to visualize graph in a Lablgtk canvas"
requires = "ocamlgraph lablgtk2.gnomecanvas"
archive(byte) = "dgraph.cmo"
archive(native) = "dgraph.cmx"
)
package "viewgraph" (
exists_if = "viewgraph.cmi"
description = "Library to visualize graph in a Lablgtk canvas (deprecated)"
requires = "ocamlgraph lablgtk2.gnomecanvas"
archive(byte) = "viewgraph.cmo"
archive(native) = "viewgraph.cmx"
)
......@@ -43,11 +43,11 @@ LIBEXT = @LIBEXT@
OBJEXT = @OBJEXT@
# Others global variables
SRCDIR = src
LIBDIR = lib
OCAMLGRAPH_SRCDIR = src
OCAMLGRAPH_LIBDIR = lib
INCLUDES= -I $(SRCDIR) -I $(LIBDIR)
BFLAGS = $(INCLUDES) -g -dtypes
INCLUDES= -I $(OCAMLGRAPH_SRCDIR) -I $(OCAMLGRAPH_LIBDIR)
BFLAGS = $(INCLUDES) -g -dtypes -w +a -w -4 -w -44 -w -50 -w -48 -w -29
OFLAGS = $(INCLUDES)
# main target
......@@ -64,16 +64,16 @@ endif
# bytecode and native-code compilation
######################################
LIB= unionfind heap bitv
LIB:=$(patsubst %, $(LIBDIR)/%.cmo, $(LIB))
OCAMLGRAPH_LIB= unionfind heap bitv persistentQueue
OCAMLGRAPH_LIB:=$(patsubst %, $(OCAMLGRAPH_LIBDIR)/%.cmo, $(OCAMLGRAPH_LIB))
CMO = version util blocks persistent imperative \
delaunay builder classic rand oper \
components path nonnegative traverse coloring topological kruskal flow \
prim dominator graphviz gml dot_parser dot_lexer dot pack \
gmap minsep cliquetree mcs_m md strat fixpoint leaderlist contraction \
graphml merge mincut clique
CMO := $(LIB) $(patsubst %, $(SRCDIR)/%.cmo, $(CMO))
graphml merge mincut clique weakTopological chaoticIteration
CMO := $(OCAMLGRAPH_LIB) $(patsubst %, $(OCAMLGRAPH_SRCDIR)/%.cmo, $(CMO))
CMX = $(CMO:.cmo=.cmx)
CMA = graph.cma
......@@ -112,12 +112,18 @@ graph.cmo: $(CMI) $(CMO)
graph.cmx: $(CMI) $(CMX)
$(OCAMLOPT) $(INCLUDES) -pack -o $@ $^
VERSION=1.8.6
VERSION=1.8.8
ifdef SOURCE_DATE_EPOCH
BUILD_DATE=$(shell date -u -d "@$(SOURCE_DATE_EPOCH)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" 2>/dev/null || date)
else
BUILD_DATE=$(shell date)
endif
src/version.ml: Makefile
rm -f $@
echo "let version = \""$(VERSION)"\"" > $@
echo "let date = \""`date`"\"" >> $@
echo 'let date = "'"$(BUILD_DATE)"'"' >> $@
# gtk2 graph editor
###################
......@@ -246,12 +252,12 @@ graph.cmx: | $(DGRAPH_DIR)/dgraph.byte \
$(ED_DIR)/editor.byte
endif
$(CMX): | $(SRCDIR)/blocks.cmo
$(CMX): | $(OCAMLGRAPH_SRCDIR)/blocks.cmo
# No .mli for blocks.ml: so, to avoid clash when generating block.cmi
# from both ocamlc and ocamlopt, force to fully compile the bytecode library
# before the native one
$(SRCDIR)/blocks.cmx: | graph.cmo
$(OCAMLGRAPH_SRCDIR)/blocks.cmx: | graph.cmo
# Examples
##########
......@@ -316,6 +322,9 @@ test: $(CMA) tests/test.ml
test-bf: $(CMA) tests/test_bf.ml
ocaml unix.cma graphics.cma $^
test-johnson: $(CMA) tests/test_johnson.ml
ocaml unix.cma graphics.cma $^
bin/test-ts: $(CMXA) tests/test_topsort.ml
mkdir -p bin
$(OCAMLOPT) -o $@ unix.cmxa $^
......@@ -351,7 +360,7 @@ bin/testunix.opt: $(CMXA) myTest/testunix.ml
$(OCAMLOPT) -unsafe -inline 100 -o $@ unix.cmxa $^
check: $(CMA) tests/check.ml bin/test-ts
ocaml $(CMA) tests/test_clique.ml tests/check.ml
ocaml -I . $(CMA) tests/test_clique.ml tests/check.ml
bin/test-ts 10
# Additional rules
......@@ -391,7 +400,7 @@ endif
install-byte:
mkdir -p $(INSTALL_LIBDIR)
cp -f graph.cmo graph.cmi $(CMA) $(INSTALL_LIBDIR)
cp -f $(SRCDIR)/*.mli $(INSTALL_LIBDIR)
cp -f $(OCAMLGRAPH_SRCDIR)/*.mli $(INSTALL_LIBDIR)
ifeq (@LABLGNOMECANVAS@,yes)
mkdir -p $(BINDIR)
cp -f $(ED_DIR)/editor.byte $(BINDIR)/graph-editor.byte
......@@ -405,7 +414,7 @@ install-opt: install-byte
mkdir -p $(INSTALL_LIBDIR)
cp -f graph$(OBJEXT) graph$(LIBEXT) graph.cmi graph.cmx \
$(CMXA) $(CMXS) $(INSTALL_LIBDIR)
cp -f $(SRCDIR)/*.mli $(INSTALL_LIBDIR)
cp -f $(OCAMLGRAPH_SRCDIR)/*.mli $(INSTALL_LIBDIR)
ifeq (@LABLGNOMECANVAS@,yes)
mkdir -p $(BINDIR)
cp -f $(ED_DIR)/editor.opt $(BINDIR)/graph-editor.opt
......@@ -421,26 +430,37 @@ ifdef DESTDIR
OCAMLFINDDEST := -destdir $(DESTDIR)
endif
ifeq ($(OCAMLBEST),byte)
OCAMLFIND_OPT_FILES=
else
OCAMLFIND_OPT_FILES=graph$(OBJEXT) graph$(LIBEXT) graph.cmx $(CMXA) $(CMXS)
ifeq (@LABLGNOMECANVAS@,yes)
OCAMLFIND_OPT_FILES+=\
$(VIEWER_CMXLIB) $(VIEWER_CMXLIB:.cmx=.o) \
$(DGRAPH_CMXLIB) $(DGRAPH_CMXLIB:.cmx=.o)
endif
endif
install-findlib: META
ifdef OCAMLFIND
ifeq (@LABLGNOMECANVAS@,yes)
$(OCAMLFIND) install $(OCAMLFINDDEST) ocamlgraph META \
$(SRCDIR)/*.mli $(VIEWER_DIR)/*.mli $(DGRAPH_DIR)/*.mli \
graph$(OBJEXT) graph$(LIBEXT) graph.cmx graph.cmo graph.cmi \
$(CMA) $(CMXA) \
$(VIEWER_CMXLIB) $(VIEWER_CMOLIB) $(VIEWER_CMILIB) \
$(VIEWER_CMXLIB:.cmx=.o) \
$(DGRAPH_CMXLIB) $(DGRAPH_CMOLIB) $(DGRAPH_CMILIB) \
$(DGRAPH_CMXLIB:.cmx=.o)
$(OCAMLGRAPH_SRCDIR)/*.mli $(VIEWER_DIR)/*.mli $(DGRAPH_DIR)/*.mli \
graph.cmo graph.cmi \
$(CMA) \
$(VIEWER_CMOLIB) $(VIEWER_CMILIB) \
$(DGRAPH_CMOLIB) $(DGRAPH_CMILIB) \
$(OCAMLFIND_OPT_FILES)
else
$(OCAMLFIND) install $(OCAMLFINDDEST) ocamlgraph META \
$(SRCDIR)/*.mli $(VIEWER_DIR)/*.mli $(DGRAPH_DIR)/*.mli \
graph$(LIBEXT) graph.cmx graph.cmo graph.cmi $(CMA) $(CMXA)
$(OCAMLGRAPH_SRCDIR)/*.mli $(VIEWER_DIR)/*.mli $(DGRAPH_DIR)/*.mli \
graph$(LIBEXT) graph.cmo graph.cmi $(CMA) \
$(OCAMLFIND_OPT_FILES)
endif
endif
META: META.in Makefile
sed -e s/VERSION/$(VERSION)/ -e s/CMA/$(CMA)/ -e s/CMXA/$(CMXA)/ \
sed -e s/VERSION/$(VERSION)/ -e s/CMA/$(CMA)/ -e s/CMXA/$(CMXA)/ -e s/CMXS/$(CMXS)/ \
$@.in > $@
# documentation
......@@ -449,25 +469,27 @@ META: META.in Makefile
DOCFILES=$(NAME).ps $(NAME).html
NODOC = blocks dot_parser dot_lexer version
NODOC := $(patsubst %, $(SRCDIR)/%.cmo, $(NODOC))
DOC_CMO = $(filter-out $(NODOC) $(LIB), $(CMO))
NODOC := $(patsubst %, $(OCAMLGRAPH_SRCDIR)/%.cmo, $(NODOC))
DOC_CMO = $(filter-out $(NODOC) $(OCAMLGRAPH_LIB), $(CMO))
DOC_SRC = $(CMI:.cmi=.mli) $(DOC_CMO:.cmo=.mli) $(DOC_CMO:.cmo=.ml)
ifeq (@LABLGNOMECANVAS@,yes)
DOC_SRC := $(DOC_SRC) $(DGRAPH_CMI:.cmi=.mli)
endif
DOC_CHARSET = utf-8
.PHONY: doc
doc: $(DOC_CMO)
mkdir -p doc
rm -f doc/*
$(OCAMLDOC) -d doc -html $(DGRAPH_INCLUDES) -I lib -I src $(DOC_SRC)
$(OCAMLDOC) -charset $(DOC_CHARSET) -d doc -html $(DGRAPH_INCLUDES) \
-I lib -I src $(DOC_SRC)
# literate programming
$(NAME).tex: $(DOC_SRC)
$(OCAMLWEB) -o $@ $^
wc:
ocamlwc -p $(SRCDIR)/*.mli $(SRCDIR)/*.ml
ocamlwc -p $(OCAMLGRAPH_SRCDIR)/*.mli $(OCAMLGRAPH_SRCDIR)/*.ml
# file headers
##############
......@@ -476,9 +498,9 @@ headers:
headache \
-c misc/headache_config.txt \
-h misc/header.txt \
Makefile.in configure.in README \
$(LIBDIR)/*.ml $(LIBDIR)/*.ml[ily] \
$(SRCDIR)/*.ml $(SRCDIR)/*.ml[ily] \
Makefile.in configure.in README.adoc \
$(OCAMLGRAPH_LIBDIR)/*.ml $(OCAMLGRAPH_LIBDIR)/*.ml[ily] \
$(OCAMLGRAPH_SRCDIR)/*.ml $(OCAMLGRAPH_SRCDIR)/*.ml[ily] \
$(ED_DIR)/*.ml $(ED_DIR)/*.mli
headache \
-c misc/headache_config.txt \
......@@ -500,7 +522,7 @@ FILES = src/*.ml* lib/*.ml* Makefile.in configure configure.in META.in \
view_graph/README view_graph/Makefile \
dgraph/*.ml dgraph/*.mli \
examples/*.ml tests/*.ml \
README FAQ CREDITS INSTALL COPYING LICENSE CHANGES
README.adoc FAQ CREDITS INSTALL.adoc COPYING LICENSE CHANGES
export: source export-doc export-web export-delaunay
......@@ -511,7 +533,7 @@ source:
cp --parents $(FILES) export/$(EXPORTDIR)
cd export ; tar cf $(TAR) $(EXPORTDIR) ; gzip -f --best $(TAR)
cp export/$(TAR).gz $(FTP)
cp README FAQ CREDITS COPYING LICENSE CHANGES $(EXAMPLES) $(FTP)
cp README.adoc FAQ CREDITS COPYING LICENSE CHANGES $(EXAMPLES) $(FTP)
# Build and install the .tar.gz requiered by Frama-C
framac: EXPORTDIR=ocamlgraph
......@@ -611,12 +633,12 @@ configure: configure.in
clean:
rm -f *~
for d in $(SRCDIR) $(LIBDIR) $(ED_DIR) $(VIEWER_DIR) $(DGRAPH_DIR) \
for d in $(OCAMLGRAPH_SRCDIR) $(OCAMLGRAPH_LIBDIR) $(ED_DIR) $(VIEWER_DIR) $(DGRAPH_DIR) \
tests examples; \
do \
rm -f $$d/*.cm[iox] $$d/*$(OBJEXT) $$d/*~ $$d/*.annot; \
done
rm -f $(GENERATED) $(SRCDIR)/dot_parser.output
rm -f $(GENERATED) $(OCAMLGRAPH_SRCDIR)/dot_parser.output
rm -f graph.*a graph.cm* graph.o graph$(LIBEXT)
rm -f $(ED_DIR)/editor.byte $(ED_DIR)/editor.opt
rm -f $(VIEWER_DIR)/viewgraph.byte $(VIEWER_DIR)/viewgraph.opt
......@@ -638,8 +660,8 @@ svnclean svn-clean:: dist-clean
.depend depend: $(GENERATED)
rm -f .depend
$(OCAMLDEP) $(INCLUDES) -I $(ED_DIR) -I $(VIEWER_DIR) -I $(DGRAPH_DIR)\
$(LIBDIR)/*.ml $(LIBDIR)/*.mli \
$(SRCDIR)/*.ml $(SRCDIR)/*.mli \
$(OCAMLGRAPH_LIBDIR)/*.ml $(OCAMLGRAPH_LIBDIR)/*.mli \
$(OCAMLGRAPH_SRCDIR)/*.ml $(OCAMLGRAPH_SRCDIR)/*.mli \
$(ED_DIR)/*.mli $(ED_DIR)/*.ml \
$(VIEWER_DIR)/*.mli $(VIEWER_DIR)/*.ml \
$(DGRAPH_DIR)/*.mli $(DGRAPH_DIR)/*.ml > .depend
......
**************************************************************************
* *
* OCamlgraph: a generic graph library for OCaml *
* Copyright (C) 2004-2013 *
* 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. *
* *
**************************************************************************
= OCamlgraph
OCamlgraph is a graph library for Ocaml. Its contribution is three-fold:
......@@ -22,19 +6,19 @@ OCamlgraph is a graph library for Ocaml. Its contribution is three-fold:
operations and algorithms over graphs, in Graph.Pack.Digraph.
It is a reasonably efficient imperative data structure for directed graphs
with vertices and edges labeled with integers.
+
Have a look at this module first in order to get an overview of what
this library provides. See also `demo.ml'.
this library provides. See also `demo.ml`.
2. Then OCamlgraph provides several other graph implementations for those
not satisfied with the one above. Some are persistent (imutable) and other
not satisfied with the one above. Some are persistent (immutable) and other
imperative (mutable). Some are directed and other are not.
Some have labels for vertices, or labels for edges, or both.
Some have abstract types for vertices. etc.
+
See interface Sig for the graph signatures and modules Persistent and
Imperative for the implementations.
+
These implementations are written as functors: you give the types of
vertices labels, edge labels, etc. and you get the data structure as a
result.
......@@ -47,30 +31,35 @@ OCamlgraph is a graph library for Ocaml. Its contribution is three-fold:
all vertices, over the successors of a vertex, etc.
How to link with OCamlgraph
---------------------------
== How to link with OCamlgraph
OCamlgraph is packaged as a single module `Graph'. Link is done as follows:
You can use the `ocamlgraph` ocamlfind package:
- bytecode
ocamlfind ocamlopt -package ocamlgraph ...
(To produce an executable, also add the `-linkpkg` option.)
If you want to invoke the compiler directly, OCamlgraph is packaged as
a single module `Graph`. Linking is done as follows:
bytecode::
ocamlc graph.cma <other files>
- native code
native code::
ocamlopt graph.cmxa <other files>
== Examples
Examples
--------
You'll find examples of OCamlgraph use in demo.ml, demo_planar.ml and color.ml
(you can compile these programs with "make demo.opt", "make demo_planar.opt"
and "make color.opt" respectively).
You'll find examples of OCamlgraph use in subdirectory examples/
(demo.ml, demo_planar.ml, color.ml, etc.). You can compile these
programs with `make examples`. Corresponding binaries are produced in
subdirectory bin/. You can also build them individually, e.g. `make
bin/demo.opt` compiles examples/demo.ml.
Bug reports
-----------
== Bug reports
Bug reports can be sent to
......
......@@ -1745,7 +1745,7 @@ esac
# OCAMLLIB=`$OCAMLC -v | tail -n 1 | cut -f 4 -d " "`
# OCAMLLIB=`$OCAMLC -v | tail -n 1 | sed -e 's|[[^:]]*: \(.*\)|\1|' `
OCAMLLIB=`$OCAMLC -where | tr -d '\r'`
OCAMLLIB=`$OCAMLC -where | tr -d '\\r' | tr '\\\\' '/'`
echo "ocaml library path is $OCAMLLIB"
# then we look for ocamlopt; if not present, we issue a warning
......@@ -2249,7 +2249,7 @@ fi
if test "$OCAMLFIND" = "" ; then
echo "No ocamlfind detected"
else
OCAMLLIB_BY_FINDLIB=`ocamlfind printconf stdlib | tr -d '\\r'`
OCAMLLIB_BY_FINDLIB=`ocamlfind printconf stdlib | tr -d '\\r' | tr '\\\\' '/'`
if test "$OCAMLLIB_BY_FINDLIB" = "$OCAMLLIB" ; then
echo "OCamlfind detected and enabled"
else
......
......@@ -59,7 +59,7 @@ esac
# OCAMLLIB=`$OCAMLC -v | tail -n 1 | cut -f 4 -d " "`
# OCAMLLIB=`$OCAMLC -v | tail -n 1 | sed -e 's|[[^:]]*: \(.*\)|\1|' `
OCAMLLIB=`$OCAMLC -where | tr -d '\r'`
OCAMLLIB=`$OCAMLC -where | tr -d '\\r' | tr '\\\\' '/'`
echo "ocaml library path is $OCAMLLIB"
# then we look for ocamlopt; if not present, we issue a warning
......@@ -146,7 +146,7 @@ AC_CHECK_PROG(OCAMLFIND,ocamlfind,ocamlfind)
if test "$OCAMLFIND" = "" ; then
echo "No ocamlfind detected"
else
OCAMLLIB_BY_FINDLIB=`ocamlfind printconf stdlib | tr -d '\\r'`
OCAMLLIB_BY_FINDLIB=`ocamlfind printconf stdlib | tr -d '\\r' | tr '\\\\' '/'`
if test "$OCAMLLIB_BY_FINDLIB" = "$OCAMLLIB" ; then
echo "OCamlfind detected and enabled"
else
......
ocamlgraph (1.8.8-1) unstable; urgency=medium
* New upstream release
* Update Vcs-* fields to target Salsa instead of Alioth
-- Mehdi Dogguy <mehdi@debian.org> Sun, 02 Dec 2018 16:38:02 +0100
ocamlgraph (1.8.6-1) unstable; urgency=medium
* New upstream release.
......
......@@ -18,8 +18,8 @@ Build-Depends:
po4a
Standards-Version: 3.9.6
Homepage: http://ocamlgraph.lri.fr/
Vcs-Git: git://git.debian.org/git/pkg-ocaml-maint/packages/ocamlgraph.git
Vcs-Browser: http://git.debian.org/?p=pkg-ocaml-maint/packages/ocamlgraph.git
Vcs-Git: https://salsa.debian.org/ocaml-team/ocamlgraph.git
Vcs-Browser: https://salsa.debian.org/ocaml-team/ocamlgraph
Package: libocamlgraph-ocaml-dev
Architecture: any
......
#TODO: reactivate when doc/intro.txt will be back
#doc/* /usr/share/doc/libocamlgraph-ocaml-dev/html/api
META usr/lib/ocaml/ocamlgraph/
......@@ -3,14 +3,14 @@ Date: Sun, 25 Apr 2010 14:50:30 +0200
Subject: prefix binary names with 'ocaml' and do not install useless files
---
Makefile.in | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
Makefile.in | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 6890a65..85c02ef 100644
index fb2cbc3..0d19aaf 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -380,11 +380,13 @@ install: install-$(OCAMLBEST) install-byte
@@ -389,11 +389,13 @@ install: install-$(OCAMLBEST) install-byte
mkdir -p $(BINDIR)
ifeq (@LABLGNOMECANVAS@,yes)
ifeq ($(OCAMLBEST),byte)
......@@ -28,11 +28,3 @@ index 6890a65..85c02ef 100644
endif
endif
@@ -392,6 +394,7 @@ install-byte:
mkdir -p $(INSTALL_LIBDIR)
cp -f graph.cmo graph.cmi $(CMA) $(INSTALL_LIBDIR)
cp -f $(SRCDIR)/*.mli $(INSTALL_LIBDIR)
+ cp -f META $(SRCDIR)/*.mli $(INSTALL_LIBDIR)
ifeq (@LABLGNOMECANVAS@,yes)
mkdir -p $(BINDIR)
cp -f $(ED_DIR)/editor.byte $(BINDIR)/graph-editor.byte
......@@ -7,10 +7,10 @@ Subject: avoid referencing non existent icon ed_icon.xpm
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/editor/ed_main.ml b/editor/ed_main.ml
index b5ece22..e66fb4a 100644
index b7309cd..b48ef1a 100644
--- a/editor/ed_main.ml
+++ b/editor/ed_main.ml
@@ -899,7 +899,7 @@ described in file LICENSE.
@@ -895,7 +895,7 @@ 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."
......@@ -19,7 +19,7 @@ index b5ece22..e66fb4a 100644
~name:ed_name
~version:"0.99"
~website:"http://ocamlgraph.lri.fr/"
@@ -929,11 +929,13 @@ let handbook_text (view:GText.view) =
@@ -925,11 +925,13 @@ let handbook_text (view:GText.view) =
(* title *)
buffer#insert ~iter ~tag_names:["title"] (ed_name^" Handbook\n");
(* editor's icon *)
......
......@@ -27,7 +27,6 @@
open Graph
open XDot
open Printf
exception DotError of string
......@@ -62,12 +61,16 @@ end
(* BUILDING A MODEL WITH AN OCAML GRAPH *)
module Make(G : Graphviz.GraphWithDotAttrs) = struct
module Make(G : Graphviz.GraphWithDotAttrs)
= struct
exception Multiple_layouts of (G.E.t * edge_layout) list
type cluster = string
module X = XDot.Make(G)
class model layout g : [G.vertex, G.edge, cluster] abstract_model = object
class model layout g : [G.vertex, G.edge, cluster] abstract_model =
object (self)
(* Iterators *)
method iter_edges f = G.iter_edges f g
......@@ -79,7 +82,7 @@ module Make(G : Graphviz.GraphWithDotAttrs) = struct
method iter_vertex f = G.iter_vertex f g
method iter_associated_vertex f v = f v
method iter_clusters f =
Hashtbl.iter (fun k v -> f k) layout.X.cluster_layouts
Hashtbl.iter (fun k _ -> f k) layout.X.cluster_layouts
(* Membership functions *)
method find_edge = try G.find_edge g with Not_found -> assert false
......@@ -97,8 +100,28 @@ module Make(G : Graphviz.GraphWithDotAttrs) = struct
with Not_found -> assert false
method get_edge_layout e =
try X.HE.find layout.X.edge_layouts e
with Not_found -> assert false
try X.HE.find e layout.X.edge_layouts
with Not_found ->
(* if there are several edges from a vertex [v1] to a vertex [v2], they
can share the same layout. In that case, one these edges is
unfortunately not in the layout table because of key sharing. Try to
recover it when possible by creating a list of all possible layouts
for the given edge. If there is only one, easy win, otherwise return
them all in an exception and let the caller decide what to do *)
let layouts = ref [] in
self#iter_succ_e
(fun e' ->
if G.V.equal (self#dst e) (self#dst e') then
try
let layout = X.HE.find e' layout.X.edge_layouts in
if not (List.exists (fun (_, l) -> layout = l) !layouts) then
layouts := (e', layout) :: !layouts
with Not_found -> ())
(self#src e);
match !layouts with
| [] -> assert false
| [ _, x ] -> x
| _ :: _ :: _ -> raise (Multiple_layouts !layouts)
method get_cluster_layout c =
try Hashtbl.find layout.X.cluster_layouts c
......@@ -114,8 +137,7 @@ module Make(G : Graphviz.GraphWithDotAttrs) = struct
close_out out;
(* Get layout from dot file *)
let layout =
try
X.layout_of_dot ~cmd ~dot_file g
try X.layout_of_dot ~cmd ~dot_file g
with X.DotError err -> raise (DotError err)
in
let model = new model layout g in
......@@ -160,7 +182,6 @@ module DotParser =
module DotModel = struct
type cluster = string
type clusters_hash = (cluster, Graph.Dot_ast.attr list) Hashtbl.t
class model g clusters_hash bounding_box
: [DotG.vertex, DotG.edge, cluster] abstract_model
=
......
......@@ -55,6 +55,9 @@ class type ['vertex, 'edge, 'cluster] abstract_model = object
(** Dot layout *)
method bounding_box : bounding_box
method get_edge_layout : 'edge -> edge_layout
(** @raise Multiple_layouts when there are several possible layouts for the
given edge *)
method get_vertex_layout : 'vertex -> node_layout
method get_cluster_layout : 'cluster -> cluster_layout
end
......@@ -62,9 +65,8 @@ end
(** This functor creates a model from a graph *)
module Make(G : Graph.Graphviz.GraphWithDotAttrs) : sig
open G
type cluster = string
exception Multiple_layouts of (G.E.t * edge_layout) list
class model:
XDot.Make(G).graph_layout -> G.t -> [G.V.t, G.E.t, cluster] abstract_model
......
......@@ -24,10 +24,6 @@
(**************************************************************************)
open Graph
open DGraphView
open Printf
let ($) f x = f x
let element = function
| [] -> invalid_arg "empty list in element"
......
......@@ -133,7 +133,7 @@ struct
let complete_to_depth v missing =
let pred_vertex = ref v in
let next_vertex = ref v in
for i = 1 to missing - 1 do
for _i = 1 to missing - 1 do
next_vertex := Tree.V.create (Tree.V.label v);
HT.add tree.ghost_vertices !next_vertex ();
let new_ghost_edge =
......