Improvements in the migration script and guide (ticket #157)
authorPeter Kovacs <kpeter@inf.elte.hu>
Wed, 08 Oct 2008 11:38:31 +0200
changeset 3062bf7c645d5a6
parent 305 069f27927ba9
child 307 47ec522b838e
Improvements in the migration script and guide (ticket #157)
doc/Makefile.am
doc/migration.dox
scripts/lemon-0.x-to-1.x.sh
     1.1 --- a/doc/Makefile.am	Mon Oct 06 13:02:13 2008 +0100
     1.2 +++ b/doc/Makefile.am	Wed Oct 08 11:38:31 2008 +0200
     1.3 @@ -6,7 +6,7 @@
     1.4  	doc/lgf.dox \
     1.5  	doc/license.dox \
     1.6  	doc/mainpage.dox \
     1.7 -	doc/migration	.dox \
     1.8 +	doc/migration.dox \
     1.9  	doc/named-param.dox \
    1.10  	doc/namespaces.dox \
    1.11  	doc/html \
     2.1 --- a/doc/migration.dox	Mon Oct 06 13:02:13 2008 +0100
     2.2 +++ b/doc/migration.dox	Wed Oct 08 11:38:31 2008 +0200
     2.3 @@ -16,12 +16,13 @@
     2.4   *
     2.5   */
     2.6  
     2.7 +namespace lemon {
     2.8  /*!
     2.9  
    2.10  \page migration Migration from the 0.x Series
    2.11  
    2.12  This guide gives an in depth description on what has changed compared
    2.13 -to the 0.x release series. 
    2.14 +to the 0.x release series.
    2.15  
    2.16  Many of these changes adjusted automatically by the
    2.17  <tt>script/lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual
    2.18 @@ -29,33 +30,76 @@
    2.19  
    2.20  \section migration-graph Graph Related Name Changes
    2.21  
    2.22 -- Directed graphs are called \c Digraph and they have <tt>Arc</tt>s
    2.23 -  instead of <tt>Edge</tt>s, while the undirected graph is called \c
    2.24 -  Graph (instead of \c UGraph) and they have <tt>Edge</tt>s (instead
    2.25 -  of <tt>UEdge</tt>s). This changes reflected thoroughly everywhere in
    2.26 +- \ref concepts::Digraph "Directed graphs" are called \c Digraph and
    2.27 +  they have <tt>Arc</tt>s (instead of <tt>Edge</tt>s), while
    2.28 +  \ref concepts::Graph "undirected graphs" are called \c Graph
    2.29 +  (instead of \c UGraph) and they have <tt>Edge</tt>s (instead of
    2.30 +  <tt>UEdge</tt>s). These changes reflected thoroughly everywhere in
    2.31    the library. Namely,
    2.32    - \c Graph -> \c Digraph
    2.33 -    - \c ListGraph -> \c ListDigraph, \c SmartGraph -> \c SmartDigraph etc.
    2.34 +    - \c %ListGraph -> \c ListDigraph, \c %SmartGraph -> \c SmartDigraph etc.
    2.35    - \c UGraph -> \c Graph
    2.36      - \c ListUGraph -> \c ListGraph, \c SmartUGraph -> \c SmartGraph etc.
    2.37 -  - \c Edge -> \c Arc
    2.38 -  - \c UEdge -> \c Edge
    2.39 -  - \c EdgeMap -> \c ArcMap
    2.40 -  - \c UEdgeMap -> \c EdgeMap
    2.41 -  - Class names and function names containing the words \e edge or \e arc
    2.42 -    should also be updated.
    2.43 +  - \c Edge -> \c Arc, \c UEdge -> \c Edge
    2.44 +  - \c EdgeMap -> \c ArcMap, \c UEdgeMap -> \c EdgeMap
    2.45 +  - \c EdgeIt -> \c ArcIt, \c UEdgeIt -> \c EdgeIt
    2.46 +  - Class names and function names containing the words \c graph,
    2.47 +    \c ugraph, \e edge or \e arc should also be updated.
    2.48  - <b>The two endpoints of an (\e undirected) \c Edge can be obtained by the
    2.49 -  <tt>u()</tt> and <tt>v()</tt> member function of the graph class
    2.50 +  <tt>u()</tt> and <tt>v()</tt> member function of the graph
    2.51    (instead of <tt>source()</tt> and <tt>target()</tt>). This change
    2.52    must be done by hand.</b>
    2.53    \n Of course, you can still use <tt>source()</tt> and <tt>target()</tt>
    2.54    for <tt>Arc</tt>s (directed edges).
    2.55  
    2.56 +\warning
    2.57 +<b>The <tt>script/lemon-0.x-to-1.x.sh</tt> tool replaces all instances of
    2.58 +the words \c graph, \c digraph, \c edge and \c arc, so it replaces them
    2.59 +in strings, comments etc. as well as in all identifiers.</b>
    2.60 +
    2.61  \section migration-lgf LGF tools
    2.62  
    2.63  \section migration-search BFS, DFS and Dijkstra
    2.64 +- <b>Using the function interface of BFS, DFS and %Dijkstra both source and
    2.65 +  target nodes can be given as parameters of the <tt>run()</tt> function
    2.66 +  (instead of \c bfs(), \c dfs() or \c dijkstra() itself).</b>
    2.67 +- \ref named-templ-param "Named class template parameters" of \c Bfs,
    2.68 +  \c Dfs, \c Dijkstra, \c BfsVisit, \c DfsVisit are renamed to start
    2.69 +  with "Set" instead of "Def". Namely,
    2.70 +  - \c DefPredMap -> \c SetPredMap
    2.71 +  - \c DefDistMap -> \c SetDistMap
    2.72 +  - \c DefReachedMap -> \c SetReachedMap
    2.73 +  - \c DefProcessedMap -> \c SetProcessedMap
    2.74 +  - \c DefHeap -> \c SetHeap
    2.75 +  - \c DefStandardHeap -> \c SetStandardHeap
    2.76 +  - \c DefOperationTraits -> \c SetOperationTraits
    2.77 +  - \c DefProcessedMapToBeDefaultMap -> \c SetStandardProcessedMap
    2.78  
    2.79  \section migration-error Exceptions and Debug tools
    2.80  
    2.81  \section migration-other Others
    2.82 +- <b>The contents of <tt>graph_utils.h</tt> are moved to <tt>core.h</tt>
    2.83 +  and <tt>maps.h</tt>. <tt>core.h</tt> is included by all graph types,
    2.84 +  therefore it usually do not have to be included directly.</b>
    2.85 +- <b><tt>path_utils.h</tt> is merged to \c path.h.</b>
    2.86 +- <b>The parameters of the graph copying tools (i.e. \c GraphCopy,
    2.87 +  \c DigraphCopy) have to be given in the from-to order.</b>
    2.88 +- \c copyDigraph() and \c copyGraph() are renamed to \c digraphCopy()
    2.89 +  and \c graphCopy(), respectively.
    2.90 +- The of
    2.91 + - DefXyzMap --> SetXyzMap
    2.92 + - DefHeap --> SetHeap
    2.93 + - DefStandardHeap --> SetStandardHeap
    2.94 + - DefOperationTraits --> SetOperationTraits
    2.95 + - DefProcessedMapToBeDefaultMap --> SetStandardProcessedMap
    2.96 +- Some map types should also been renamed. Namely,
    2.97 +  - \c IntegerMap -> \c RangeMap
    2.98 +  - \c StdMap -> \c SparseMap
    2.99 +  - \c FunctorMap -> \c FunctorToMap
   2.100 +  - \c MapFunctor -> \c MapToFunctor
   2.101 +  - \c ForkWriteMap -> \c ForkMap
   2.102 +  - \c StoreBoolMap -> \c LoggerBoolMap
   2.103 +- \c dim2::BoundingBox -> \c dim2::Box
   2.104 +
   2.105  */
   2.106 +}
     3.1 --- a/scripts/lemon-0.x-to-1.x.sh	Mon Oct 06 13:02:13 2008 +0100
     3.2 +++ b/scripts/lemon-0.x-to-1.x.sh	Wed Oct 08 11:38:31 2008 +0200
     3.3 @@ -10,8 +10,7 @@
     3.4  
     3.5  TMP=`mktemp`
     3.6  
     3.7 -sed -e "s/bipartite undirected graph/bipartite graph/g"\
     3.8 -	-e "s/undirected graph/_gr_aph_label_/g"\
     3.9 +sed	-e "s/undirected graph/_gr_aph_label_/g"\
    3.10  	-e "s/undirected edge/_ed_ge_label_/g"\
    3.11  	-e "s/graph_/_gr_aph_label__/g"\
    3.12  	-e "s/_graph/__gr_aph_label_/g"\
    3.13 @@ -47,6 +46,82 @@
    3.14  	-e "s/_Blu_e_label_/Blue/g"\
    3.15  	-e "s/_re_d_label_/red/g"\
    3.16  	-e "s/_blu_e_label_/blue/g"\
    3.17 +	-e "s/\(\W\)DefPredMap\(\W\)/\1SetPredMap\2/g"\
    3.18 +	-e "s/\(\W\)DefPredMap$/\1SetPredMap/g"\
    3.19 +	-e "s/^DefPredMap\(\W\)/SetPredMap\1/g"\
    3.20 +	-e "s/^DefPredMap$/SetPredMap/g"\
    3.21 +	-e "s/\(\W\)DefDistMap\(\W\)/\1SetDistMap\2/g"\
    3.22 +	-e "s/\(\W\)DefDistMap$/\1SetDistMap/g"\
    3.23 +	-e "s/^DefDistMap\(\W\)/SetDistMap\1/g"\
    3.24 +	-e "s/^DefDistMap$/SetDistMap/g"\
    3.25 +	-e "s/\(\W\)DefReachedMap\(\W\)/\1SetReachedMap\2/g"\
    3.26 +	-e "s/\(\W\)DefReachedMap$/\1SetReachedMap/g"\
    3.27 +	-e "s/^DefReachedMap\(\W\)/SetReachedMap\1/g"\
    3.28 +	-e "s/^DefReachedMap$/SetReachedMap/g"\
    3.29 +	-e "s/\(\W\)DefProcessedMap\(\W\)/\1SetProcessedMap\2/g"\
    3.30 +	-e "s/\(\W\)DefProcessedMap$/\1SetProcessedMap/g"\
    3.31 +	-e "s/^DefProcessedMap\(\W\)/SetProcessedMap\1/g"\
    3.32 +	-e "s/^DefProcessedMap$/SetProcessedMap/g"\
    3.33 +	-e "s/\(\W\)DefHeap\(\W\)/\1SetHeap\2/g"\
    3.34 +	-e "s/\(\W\)DefHeap$/\1SetHeap/g"\
    3.35 +	-e "s/^DefHeap\(\W\)/SetHeap\1/g"\
    3.36 +	-e "s/^DefHeap$/SetHeap/g"\
    3.37 +	-e "s/\(\W\)DefStandardHeap\(\W\)/\1SetStandradHeap\2/g"\
    3.38 +	-e "s/\(\W\)DefStandardHeap$/\1SetStandradHeap/g"\
    3.39 +	-e "s/^DefStandardHeap\(\W\)/SetStandradHeap\1/g"\
    3.40 +	-e "s/^DefStandardHeap$/SetStandradHeap/g"\
    3.41 +	-e "s/\(\W\)DefOperationTraits\(\W\)/\1SetOperationTraits\2/g"\
    3.42 +	-e "s/\(\W\)DefOperationTraits$/\1SetOperationTraits/g"\
    3.43 +	-e "s/^DefOperationTraits\(\W\)/SetOperationTraits\1/g"\
    3.44 +	-e "s/^DefOperationTraits$/SetOperationTraits/g"\
    3.45 +	-e "s/\(\W\)DefProcessedMapToBeDefaultMap\(\W\)/\1SetStandardProcessedMap\2/g"\
    3.46 +	-e "s/\(\W\)DefProcessedMapToBeDefaultMap$/\1SetStandardProcessedMap/g"\
    3.47 +	-e "s/^DefProcessedMapToBeDefaultMap\(\W\)/SetStandardProcessedMap\1/g"\
    3.48 +	-e "s/^DefProcessedMapToBeDefaultMap$/SetStandardProcessedMap/g"\
    3.49 +	-e "s/\(\W\)IntegerMap\(\W\)/\1RangeMap\2/g"\
    3.50 +	-e "s/\(\W\)IntegerMap$/\1RangeMap/g"\
    3.51 +	-e "s/^IntegerMap\(\W\)/RangeMap\1/g"\
    3.52 +	-e "s/^IntegerMap$/RangeMap/g"\
    3.53 +	-e "s/\(\W\)integerMap\(\W\)/\1rangeMap\2/g"\
    3.54 +	-e "s/\(\W\)integerMap$/\1rangeMap/g"\
    3.55 +	-e "s/^integerMap\(\W\)/rangeMap\1/g"\
    3.56 +	-e "s/^integerMap$/rangeMap/g"\
    3.57 +	-e "s/\(\W\)copyGraph\(\W\)/\1graphCopy\2/g"\
    3.58 +	-e "s/\(\W\)copyGraph$/\1graphCopy/g"\
    3.59 +	-e "s/^copyGraph\(\W\)/graphCopy\1/g"\
    3.60 +	-e "s/^copyGraph$/graphCopy/g"\
    3.61 +	-e "s/\(\W\)copyDigraph\(\W\)/\1digraphCopy\2/g"\
    3.62 +	-e "s/\(\W\)copyDigraph$/\1digraphCopy/g"\
    3.63 +	-e "s/^copyDigraph\(\W\)/digraphCopy\1/g"\
    3.64 +	-e "s/^copyDigraph$/digraphCopy/g"\
    3.65 +	-e "s/\(\W\)\([sS]\)tdMap\(\W\)/\1\2parseMap\3/g"\
    3.66 +	-e "s/\(\W\)\([sS]\)tdMap$/\1\2parseMap/g"\
    3.67 +	-e "s/^\([sS]\)tdMap\(\W\)/\1parseMap\2/g"\
    3.68 +	-e "s/^\([sS]\)tdMap$/\1parseMap/g"\
    3.69 +	-e "s/\(\W\)\([Ff]\)unctorMap\(\W\)/\1\2unctorToMap\3/g"\
    3.70 +	-e "s/\(\W\)\([Ff]\)unctorMap$/\1\2unctorToMap/g"\
    3.71 +	-e "s/^\([Ff]\)unctorMap\(\W\)/\1unctorToMap\2/g"\
    3.72 +	-e "s/^\([Ff]\)unctorMap$/\1unctorToMap/g"\
    3.73 +	-e "s/\(\W\)\([Mm]\)apFunctor\(\W\)/\1\2apToFunctor\3/g"\
    3.74 +	-e "s/\(\W\)\([Mm]\)apFunctor$/\1\2apToFunctor/g"\
    3.75 +	-e "s/^\([Mm]\)apFunctor\(\W\)/\1apToFunctor\2/g"\
    3.76 +	-e "s/^\([Mm]\)apFunctor$/\1apToFunctor/g"\
    3.77 +	-e "s/\(\W\)\([Ff]\)orkWriteMap\(\W\)/\1\2orkMap\3/g"\
    3.78 +	-e "s/\(\W\)\([Ff]\)orkWriteMap$/\1\2orkMap/g"\
    3.79 +	-e "s/^\([Ff]\)orkWriteMap\(\W\)/\1orkMap\2/g"\
    3.80 +	-e "s/^\([Ff]\)orkWriteMap$/\1orkMap/g"\
    3.81 +	-e "s/\(\W\)StoreBoolMap\(\W\)/\1LoggerBoolMap\2/g"\
    3.82 +	-e "s/\(\W\)StoreBoolMap$/\1LoggerBoolMap/g"\
    3.83 +	-e "s/^StoreBoolMap\(\W\)/LoggerBoolMap\1/g"\
    3.84 +	-e "s/^StoreBoolMap$/LoggerBoolMap/g"\
    3.85 +	-e "s/\(\W\)storeBoolMap\(\W\)/\1loggerBoolMap\2/g"\
    3.86 +	-e "s/\(\W\)storeBoolMap$/\1loggerBoolMap/g"\
    3.87 +	-e "s/^storeBoolMap\(\W\)/loggerBoolMap\1/g"\
    3.88 +	-e "s/^storeBoolMap$/loggerBoolMap/g"\
    3.89 +	-e "s/\(\W\)BoundingBox\(\W\)/\1Box\2/g"\
    3.90 +	-e "s/\(\W\)BoundingBox$/\1Box/g"\
    3.91 +	-e "s/^BoundingBox\(\W\)/Box\1/g"\
    3.92 +	-e "s/^BoundingBox$/Box/g"\
    3.93  <$1 > $TMP
    3.94  
    3.95  mv $TMP $1
    3.96 \ No newline at end of file