# HG changeset patch # User Peter Kovacs <kpeter@inf.elte.hu> # Date 1223458711 -7200 # Node ID 2bf7c645d5a6f188096920bf2e7533a97de7b3d3 # Parent 069f27927ba9828fe7076eede1db609e154c548e Improvements in the migration script and guide (ticket #157) diff -r 069f27927ba9 -r 2bf7c645d5a6 doc/Makefile.am --- a/doc/Makefile.am Mon Oct 06 13:02:13 2008 +0100 +++ b/doc/Makefile.am Wed Oct 08 11:38:31 2008 +0200 @@ -6,7 +6,7 @@ doc/lgf.dox \ doc/license.dox \ doc/mainpage.dox \ - doc/migration .dox \ + doc/migration.dox \ doc/named-param.dox \ doc/namespaces.dox \ doc/html \ diff -r 069f27927ba9 -r 2bf7c645d5a6 doc/migration.dox --- a/doc/migration.dox Mon Oct 06 13:02:13 2008 +0100 +++ b/doc/migration.dox Wed Oct 08 11:38:31 2008 +0200 @@ -16,12 +16,13 @@ * */ +namespace lemon { /*! \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. +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 @@ -29,33 +30,76 @@ \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 +- \ref concepts::Digraph "Directed graphs" are called \c Digraph and + they have <tt>Arc</tt>s (instead of <tt>Edge</tt>s), while + \ref concepts::Graph "undirected graphs" are called \c Graph + (instead of \c UGraph) and they have <tt>Edge</tt>s (instead of + <tt>UEdge</tt>s). These changes reflected thoroughly everywhere in the library. Namely, - \c Graph -> \c Digraph - - \c ListGraph -> \c ListDigraph, \c SmartGraph -> \c SmartDigraph etc. + - \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. + - \c Edge -> \c Arc, \c UEdge -> \c Edge + - \c EdgeMap -> \c ArcMap, \c UEdgeMap -> \c EdgeMap + - \c EdgeIt -> \c ArcIt, \c UEdgeIt -> \c EdgeIt + - Class names and function names containing the words \c graph, + \c ugraph, \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 + <tt>u()</tt> and <tt>v()</tt> member function of the graph (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). +\warning +<b>The <tt>script/lemon-0.x-to-1.x.sh</tt> tool replaces all instances of +the words \c graph, \c digraph, \c edge and \c arc, so it replaces them +in strings, comments etc. as well as in all identifiers.</b> + \section migration-lgf LGF tools \section migration-search BFS, DFS and Dijkstra +- <b>Using the function interface of BFS, DFS and %Dijkstra both source and + target nodes can be given as parameters of the <tt>run()</tt> function + (instead of \c bfs(), \c dfs() or \c dijkstra() itself).</b> +- \ref named-templ-param "Named class template parameters" of \c Bfs, + \c Dfs, \c Dijkstra, \c BfsVisit, \c DfsVisit are renamed to start + with "Set" instead of "Def". Namely, + - \c DefPredMap -> \c SetPredMap + - \c DefDistMap -> \c SetDistMap + - \c DefReachedMap -> \c SetReachedMap + - \c DefProcessedMap -> \c SetProcessedMap + - \c DefHeap -> \c SetHeap + - \c DefStandardHeap -> \c SetStandardHeap + - \c DefOperationTraits -> \c SetOperationTraits + - \c DefProcessedMapToBeDefaultMap -> \c SetStandardProcessedMap \section migration-error Exceptions and Debug tools \section migration-other Others +- <b>The contents of <tt>graph_utils.h</tt> are moved to <tt>core.h</tt> + and <tt>maps.h</tt>. <tt>core.h</tt> is included by all graph types, + therefore it usually do not have to be included directly.</b> +- <b><tt>path_utils.h</tt> is merged to \c path.h.</b> +- <b>The parameters of the graph copying tools (i.e. \c GraphCopy, + \c DigraphCopy) have to be given in the from-to order.</b> +- \c copyDigraph() and \c copyGraph() are renamed to \c digraphCopy() + and \c graphCopy(), respectively. +- The of + - DefXyzMap --> SetXyzMap + - DefHeap --> SetHeap + - DefStandardHeap --> SetStandardHeap + - DefOperationTraits --> SetOperationTraits + - DefProcessedMapToBeDefaultMap --> SetStandardProcessedMap +- Some map types should also been renamed. Namely, + - \c IntegerMap -> \c RangeMap + - \c StdMap -> \c SparseMap + - \c FunctorMap -> \c FunctorToMap + - \c MapFunctor -> \c MapToFunctor + - \c ForkWriteMap -> \c ForkMap + - \c StoreBoolMap -> \c LoggerBoolMap +- \c dim2::BoundingBox -> \c dim2::Box + */ +} diff -r 069f27927ba9 -r 2bf7c645d5a6 scripts/lemon-0.x-to-1.x.sh --- a/scripts/lemon-0.x-to-1.x.sh Mon Oct 06 13:02:13 2008 +0100 +++ b/scripts/lemon-0.x-to-1.x.sh Wed Oct 08 11:38:31 2008 +0200 @@ -10,8 +10,7 @@ TMP=`mktemp` -sed -e "s/bipartite undirected graph/bipartite graph/g"\ - -e "s/undirected graph/_gr_aph_label_/g"\ +sed -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"\ @@ -47,6 +46,82 @@ -e "s/_Blu_e_label_/Blue/g"\ -e "s/_re_d_label_/red/g"\ -e "s/_blu_e_label_/blue/g"\ + -e "s/\(\W\)DefPredMap\(\W\)/\1SetPredMap\2/g"\ + -e "s/\(\W\)DefPredMap$/\1SetPredMap/g"\ + -e "s/^DefPredMap\(\W\)/SetPredMap\1/g"\ + -e "s/^DefPredMap$/SetPredMap/g"\ + -e "s/\(\W\)DefDistMap\(\W\)/\1SetDistMap\2/g"\ + -e "s/\(\W\)DefDistMap$/\1SetDistMap/g"\ + -e "s/^DefDistMap\(\W\)/SetDistMap\1/g"\ + -e "s/^DefDistMap$/SetDistMap/g"\ + -e "s/\(\W\)DefReachedMap\(\W\)/\1SetReachedMap\2/g"\ + -e "s/\(\W\)DefReachedMap$/\1SetReachedMap/g"\ + -e "s/^DefReachedMap\(\W\)/SetReachedMap\1/g"\ + -e "s/^DefReachedMap$/SetReachedMap/g"\ + -e "s/\(\W\)DefProcessedMap\(\W\)/\1SetProcessedMap\2/g"\ + -e "s/\(\W\)DefProcessedMap$/\1SetProcessedMap/g"\ + -e "s/^DefProcessedMap\(\W\)/SetProcessedMap\1/g"\ + -e "s/^DefProcessedMap$/SetProcessedMap/g"\ + -e "s/\(\W\)DefHeap\(\W\)/\1SetHeap\2/g"\ + -e "s/\(\W\)DefHeap$/\1SetHeap/g"\ + -e "s/^DefHeap\(\W\)/SetHeap\1/g"\ + -e "s/^DefHeap$/SetHeap/g"\ + -e "s/\(\W\)DefStandardHeap\(\W\)/\1SetStandradHeap\2/g"\ + -e "s/\(\W\)DefStandardHeap$/\1SetStandradHeap/g"\ + -e "s/^DefStandardHeap\(\W\)/SetStandradHeap\1/g"\ + -e "s/^DefStandardHeap$/SetStandradHeap/g"\ + -e "s/\(\W\)DefOperationTraits\(\W\)/\1SetOperationTraits\2/g"\ + -e "s/\(\W\)DefOperationTraits$/\1SetOperationTraits/g"\ + -e "s/^DefOperationTraits\(\W\)/SetOperationTraits\1/g"\ + -e "s/^DefOperationTraits$/SetOperationTraits/g"\ + -e "s/\(\W\)DefProcessedMapToBeDefaultMap\(\W\)/\1SetStandardProcessedMap\2/g"\ + -e "s/\(\W\)DefProcessedMapToBeDefaultMap$/\1SetStandardProcessedMap/g"\ + -e "s/^DefProcessedMapToBeDefaultMap\(\W\)/SetStandardProcessedMap\1/g"\ + -e "s/^DefProcessedMapToBeDefaultMap$/SetStandardProcessedMap/g"\ + -e "s/\(\W\)IntegerMap\(\W\)/\1RangeMap\2/g"\ + -e "s/\(\W\)IntegerMap$/\1RangeMap/g"\ + -e "s/^IntegerMap\(\W\)/RangeMap\1/g"\ + -e "s/^IntegerMap$/RangeMap/g"\ + -e "s/\(\W\)integerMap\(\W\)/\1rangeMap\2/g"\ + -e "s/\(\W\)integerMap$/\1rangeMap/g"\ + -e "s/^integerMap\(\W\)/rangeMap\1/g"\ + -e "s/^integerMap$/rangeMap/g"\ + -e "s/\(\W\)copyGraph\(\W\)/\1graphCopy\2/g"\ + -e "s/\(\W\)copyGraph$/\1graphCopy/g"\ + -e "s/^copyGraph\(\W\)/graphCopy\1/g"\ + -e "s/^copyGraph$/graphCopy/g"\ + -e "s/\(\W\)copyDigraph\(\W\)/\1digraphCopy\2/g"\ + -e "s/\(\W\)copyDigraph$/\1digraphCopy/g"\ + -e "s/^copyDigraph\(\W\)/digraphCopy\1/g"\ + -e "s/^copyDigraph$/digraphCopy/g"\ + -e "s/\(\W\)\([sS]\)tdMap\(\W\)/\1\2parseMap\3/g"\ + -e "s/\(\W\)\([sS]\)tdMap$/\1\2parseMap/g"\ + -e "s/^\([sS]\)tdMap\(\W\)/\1parseMap\2/g"\ + -e "s/^\([sS]\)tdMap$/\1parseMap/g"\ + -e "s/\(\W\)\([Ff]\)unctorMap\(\W\)/\1\2unctorToMap\3/g"\ + -e "s/\(\W\)\([Ff]\)unctorMap$/\1\2unctorToMap/g"\ + -e "s/^\([Ff]\)unctorMap\(\W\)/\1unctorToMap\2/g"\ + -e "s/^\([Ff]\)unctorMap$/\1unctorToMap/g"\ + -e "s/\(\W\)\([Mm]\)apFunctor\(\W\)/\1\2apToFunctor\3/g"\ + -e "s/\(\W\)\([Mm]\)apFunctor$/\1\2apToFunctor/g"\ + -e "s/^\([Mm]\)apFunctor\(\W\)/\1apToFunctor\2/g"\ + -e "s/^\([Mm]\)apFunctor$/\1apToFunctor/g"\ + -e "s/\(\W\)\([Ff]\)orkWriteMap\(\W\)/\1\2orkMap\3/g"\ + -e "s/\(\W\)\([Ff]\)orkWriteMap$/\1\2orkMap/g"\ + -e "s/^\([Ff]\)orkWriteMap\(\W\)/\1orkMap\2/g"\ + -e "s/^\([Ff]\)orkWriteMap$/\1orkMap/g"\ + -e "s/\(\W\)StoreBoolMap\(\W\)/\1LoggerBoolMap\2/g"\ + -e "s/\(\W\)StoreBoolMap$/\1LoggerBoolMap/g"\ + -e "s/^StoreBoolMap\(\W\)/LoggerBoolMap\1/g"\ + -e "s/^StoreBoolMap$/LoggerBoolMap/g"\ + -e "s/\(\W\)storeBoolMap\(\W\)/\1loggerBoolMap\2/g"\ + -e "s/\(\W\)storeBoolMap$/\1loggerBoolMap/g"\ + -e "s/^storeBoolMap\(\W\)/loggerBoolMap\1/g"\ + -e "s/^storeBoolMap$/loggerBoolMap/g"\ + -e "s/\(\W\)BoundingBox\(\W\)/\1Box\2/g"\ + -e "s/\(\W\)BoundingBox$/\1Box/g"\ + -e "s/^BoundingBox\(\W\)/Box\1/g"\ + -e "s/^BoundingBox$/Box/g"\ <$1 > $TMP mv $TMP $1 \ No newline at end of file