[Lemon-commits] Alpar Juttner: 0.x -> 1.x migration script and g...
Lemon HG
hg at lemon.cs.elte.hu
Wed Oct 8 18:20:28 CEST 2008
details: http://lemon.cs.elte.hu/hg/lemon/rev/069f27927ba9
changeset: 305:069f27927ba9
user: Alpar Juttner <alpar [at] cs.elte.hu>
date: Mon Oct 06 13:02:13 2008 +0100
description:
0.x -> 1.x migration script and guide (preliminary version) (#157)
diffstat:
3 files changed, 114 insertions(+)
doc/Makefile.am | 1
doc/migration.dox | 61 +++++++++++++++++++++++++++++++++++++++++++
scripts/lemon-0.x-to-1.x.sh | 52 ++++++++++++++++++++++++++++++++++++
diffs (133 lines):
diff -r 74eb8b425d82 -r 069f27927ba9 doc/Makefile.am
--- a/doc/Makefile.am Mon Oct 06 11:41:05 2008 +0100
+++ b/doc/Makefile.am Mon Oct 06 13:02:13 2008 +0100
@@ -6,6 +6,7 @@
doc/lgf.dox \
doc/license.dox \
doc/mainpage.dox \
+ doc/migration .dox \
doc/named-param.dox \
doc/namespaces.dox \
doc/html \
diff -r 74eb8b425d82 -r 069f27927ba9 doc/migration.dox
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/migration.dox Mon Oct 06 13:02:13 2008 +0100
@@ -0,0 +1,61 @@
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library.
+ *
+ * Copyright (C) 2003-2008
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+/*!
+
+\page migration Migration from the 0.x Series
+
+This guide gives an in depth description on what has changed compared
+to the 0.x release series.
+
+Many of these changes adjusted automatically by the
+<tt>script/lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual
+update are typeset <b>boldface</b>.
+
+\section migration-graph Graph Related Name Changes
+
+- Directed graphs are called \c Digraph and they have <tt>Arc</tt>s
+ instead of <tt>Edge</tt>s, while the undirected graph is called \c
+ Graph (instead of \c UGraph) and they have <tt>Edge</tt>s (instead
+ of <tt>UEdge</tt>s). This changes reflected thoroughly everywhere in
+ the library. Namely,
+ - \c Graph -> \c Digraph
+ - \c ListGraph -> \c ListDigraph, \c SmartGraph -> \c SmartDigraph etc.
+ - \c UGraph -> \c Graph
+ - \c ListUGraph -> \c ListGraph, \c SmartUGraph -> \c SmartGraph etc.
+ - \c Edge -> \c Arc
+ - \c UEdge -> \c Edge
+ - \c EdgeMap -> \c ArcMap
+ - \c UEdgeMap -> \c EdgeMap
+ - Class names and function names containing the words \e edge or \e arc
+ should also be updated.
+- <b>The two endpoints of an (\e undirected) \c Edge can be obtained by the
+ <tt>u()</tt> and <tt>v()</tt> member function of the graph class
+ (instead of <tt>source()</tt> and <tt>target()</tt>). This change
+ must be done by hand.</b>
+ \n Of course, you can still use <tt>source()</tt> and <tt>target()</tt>
+ for <tt>Arc</tt>s (directed edges).
+
+\section migration-lgf LGF tools
+
+\section migration-search BFS, DFS and Dijkstra
+
+\section migration-error Exceptions and Debug tools
+
+\section migration-other Others
+*/
diff -r 74eb8b425d82 -r 069f27927ba9 scripts/lemon-0.x-to-1.x.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/lemon-0.x-to-1.x.sh Mon Oct 06 13:02:13 2008 +0100
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+set -e
+
+if [ $# -eq 0 -o x$1 = "x-h" -o x$1 = "x-help" -o x$1 = "x--help" ]; then
+ echo "Usage:"
+ echo " $0 source-file"
+ exit
+fi
+
+TMP=`mktemp`
+
+sed -e "s/bipartite undirected graph/bipartite graph/g"\
+ -e "s/undirected graph/_gr_aph_label_/g"\
+ -e "s/undirected edge/_ed_ge_label_/g"\
+ -e "s/graph_/_gr_aph_label__/g"\
+ -e "s/_graph/__gr_aph_label_/g"\
+ -e "s/UGraph/_Gr_aph_label_/g"\
+ -e "s/uGraph/_gr_aph_label_/g"\
+ -e "s/ugraph/_gr_aph_label_/g"\
+ -e "s/Graph/_Digr_aph_label_/g"\
+ -e "s/graph/_digr_aph_label_/g"\
+ -e "s/UEdge/_Ed_ge_label_/g"\
+ -e "s/uEdge/_ed_ge_label_/g"\
+ -e "s/uedge/_ed_ge_label_/g"\
+ -e "s/IncEdgeIt/_In_cEd_geIt_label_/g"\
+ -e "s/Edge/_Ar_c_label_/g"\
+ -e "s/edge/_ar_c_label_/g"\
+ -e "s/ANode/_Re_d_label_/g"\
+ -e "s/BNode/_Blu_e_label_/g"\
+ -e "s/A-Node/_Re_d_label_/g"\
+ -e "s/B-Node/_Blu_e_label_/g"\
+ -e "s/anode/_re_d_label_/g"\
+ -e "s/bnode/_blu_e_label_/g"\
+ -e "s/aNode/_re_d_label_/g"\
+ -e "s/bNode/_blu_e_label_/g"\
+ -e "s/_Digr_aph_label_/Digraph/g"\
+ -e "s/_digr_aph_label_/digraph/g"\
+ -e "s/_Gr_aph_label_/Graph/g"\
+ -e "s/_gr_aph_label_/graph/g"\
+ -e "s/_Ar_c_label_/Arc/g"\
+ -e "s/_ar_c_label_/arc/g"\
+ -e "s/_Ed_ge_label_/Edge/g"\
+ -e "s/_ed_ge_label_/edge/g"\
+ -e "s/_In_cEd_geIt_label_/IncEdgeIt/g"\
+ -e "s/_Re_d_label_/Red/g"\
+ -e "s/_Blu_e_label_/Blue/g"\
+ -e "s/_re_d_label_/red/g"\
+ -e "s/_blu_e_label_/blue/g"\
+<$1 > $TMP
+
+mv $TMP $1
\ No newline at end of file
More information about the Lemon-commits
mailing list