1.1 --- a/doc/Makefile.am Wed Oct 08 13:18:33 2008 +0100
1.2 +++ b/doc/Makefile.am Wed Oct 08 17:05:01 2008 +0100
1.3 @@ -6,6 +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/named-param.dox \
1.9 doc/namespaces.dox \
1.10 doc/html \
2.1 --- a/doc/mainpage.dox Wed Oct 08 13:18:33 2008 +0100
2.2 +++ b/doc/mainpage.dox Wed Oct 08 17:05:01 2008 +0100
2.3 @@ -56,5 +56,5 @@
2.4 <a class="el" href="modules.html">Modules</a>
2.5 section.
2.6
2.7 -
2.8 +If you are a user of the old (0.x) series of LEMON, please check out the \ref migration "Migration Guide" for the backward incompatibilities.
2.9 */
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/doc/migration.dox Wed Oct 08 17:05:01 2008 +0100
3.3 @@ -0,0 +1,143 @@
3.4 +/* -*- mode: C++; indent-tabs-mode: nil; -*-
3.5 + *
3.6 + * This file is a part of LEMON, a generic C++ optimization library.
3.7 + *
3.8 + * Copyright (C) 2003-2008
3.9 + * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
3.10 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
3.11 + *
3.12 + * Permission to use, modify and distribute this software is granted
3.13 + * provided that this copyright notice appears in all copies. For
3.14 + * precise terms see the accompanying LICENSE file.
3.15 + *
3.16 + * This software is provided "AS IS" with no warranty of any kind,
3.17 + * express or implied, and with no claim as to its suitability for any
3.18 + * purpose.
3.19 + *
3.20 + */
3.21 +
3.22 +namespace lemon {
3.23 +/*!
3.24 +
3.25 +\page migration Migration from the 0.x Series
3.26 +
3.27 +This guide gives an in depth description on what has changed compared
3.28 +to the 0.x release series.
3.29 +
3.30 +Many of these changes adjusted automatically by the
3.31 +<tt>script/lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual
3.32 +update are typeset <b>boldface</b>.
3.33 +
3.34 +\section migration-graph Graph Related Name Changes
3.35 +
3.36 +- \ref concepts::Digraph "Directed graphs" are called \c Digraph and
3.37 + they have <tt>Arc</tt>s (instead of <tt>Edge</tt>s), while
3.38 + \ref concepts::Graph "undirected graphs" are called \c Graph
3.39 + (instead of \c UGraph) and they have <tt>Edge</tt>s (instead of
3.40 + <tt>UEdge</tt>s). These changes reflected thoroughly everywhere in
3.41 + the library. Namely,
3.42 + - \c Graph -> \c Digraph
3.43 + - \c %ListGraph -> \c ListDigraph, \c %SmartGraph -> \c SmartDigraph etc.
3.44 + - \c UGraph -> \c Graph
3.45 + - \c ListUGraph -> \c ListGraph, \c SmartUGraph -> \c SmartGraph etc.
3.46 + - \c Edge -> \c Arc, \c UEdge -> \c Edge
3.47 + - \c EdgeMap -> \c ArcMap, \c UEdgeMap -> \c EdgeMap
3.48 + - \c EdgeIt -> \c ArcIt, \c UEdgeIt -> \c EdgeIt
3.49 + - Class names and function names containing the words \c graph,
3.50 + \c ugraph, \e edge or \e arc should also be updated.
3.51 +- <b>The two endpoints of an (\e undirected) \c Edge can be obtained by the
3.52 + <tt>u()</tt> and <tt>v()</tt> member function of the graph
3.53 + (instead of <tt>source()</tt> and <tt>target()</tt>). This change
3.54 + must be done by hand.</b>
3.55 + \n Of course, you can still use <tt>source()</tt> and <tt>target()</tt>
3.56 + for <tt>Arc</tt>s (directed edges).
3.57 +
3.58 +\warning
3.59 +<b>The <tt>script/lemon-0.x-to-1.x.sh</tt> tool replaces all instances of
3.60 +the words \c graph, \c digraph, \c edge and \c arc, so it replaces them
3.61 +in strings, comments etc. as well as in all identifiers.</b>
3.62 +
3.63 +\section migration-lgf LGF tools
3.64 + - The \ref lgf-format "LGF file format" has changed,
3.65 + <tt>\@nodeset</tt> has changed to <tt>\@nodes</tt>,
3.66 + <tt>\@edgeset</tt> and <tt>\@uedgeset</tt> to <tt>\@arcs</tt> or
3.67 + <tt>\@edges</tt>, which become completely equivalents. The
3.68 + <tt>\@nodes</tt>, <tt>\@edges</tt> and <tt>\@uedges</tt> sections are
3.69 + removed from the format, the content of them should be
3.70 + the part of <tt>\@attributes</tt> section. The data fields in
3.71 + the sections must follow a strict format, they must be either character
3.72 + sequences without whitespaces or quoted strings.
3.73 + - The <tt>LemonReader</tt> and <tt>LemonWriter</tt> core interfaces
3.74 + are no longer available.
3.75 + - The implementation of the general section readers and writers has changed
3.76 + they are simple functors now. Beside the old
3.77 + stream based section handling, currently line oriented section
3.78 + reading and writing are also supported. In the
3.79 + section readers the lines must be counted manually. The sections
3.80 + should be read and written with the SectionWriter and SectionReader
3.81 + classes.
3.82 + - Instead of the item readers and writers, item converters should be
3.83 + used. The converters are functors, which map the type to
3.84 + std::string or std::string to the type. The converters for standard
3.85 + containers hasn't yet been implemented in the new LEMON. The converters
3.86 + can return strings in any format, because if it is necessary, the LGF
3.87 + writer and reader will quote and unquote the given value.
3.88 + - The DigraphReader and DigraphWriter can used similarly to the
3.89 + 0.x series, however the <tt>read</tt> or <tt>write</tt> prefix of
3.90 + the member functions are removed.
3.91 + - The new LEMON supports the function like interface, the \c
3.92 + digraphReader and \c digraphWriter functions are more convenient than
3.93 + using the classes directly.
3.94 +
3.95 +\section migration-search BFS, DFS and Dijkstra
3.96 +- <b>Using the function interface of BFS, DFS and %Dijkstra both source and
3.97 + target nodes can be given as parameters of the <tt>run()</tt> function
3.98 + (instead of \c bfs(), \c dfs() or \c dijkstra() itself).</b>
3.99 +- \ref named-templ-param "Named class template parameters" of \c Bfs,
3.100 + \c Dfs, \c Dijkstra, \c BfsVisit, \c DfsVisit are renamed to start
3.101 + with "Set" instead of "Def". Namely,
3.102 + - \c DefPredMap -> \c SetPredMap
3.103 + - \c DefDistMap -> \c SetDistMap
3.104 + - \c DefReachedMap -> \c SetReachedMap
3.105 + - \c DefProcessedMap -> \c SetProcessedMap
3.106 + - \c DefHeap -> \c SetHeap
3.107 + - \c DefStandardHeap -> \c SetStandardHeap
3.108 + - \c DefOperationTraits -> \c SetOperationTraits
3.109 + - \c DefProcessedMapToBeDefaultMap -> \c SetStandardProcessedMap
3.110 +
3.111 +\section migration-error Exceptions and Debug tools
3.112 +
3.113 +<b>The class hierarchy of exceptions has largely been simplified. Now,
3.114 +only the i/o related tools may throw exceptions. All other exceptions
3.115 +have been replaced with either the \c LEMON_ASSERT or the \c LEMON_DEBUG
3.116 +macros.</b>
3.117 +
3.118 +<b>On the other hand, the parameter order of constructors of the
3.119 +exceptions has been changed. See \ref IoError and \ref FormatError for
3.120 +more details.</b>
3.121 +
3.122 +\section migration-other Others
3.123 +- <b>The contents of <tt>graph_utils.h</tt> are moved to <tt>core.h</tt>
3.124 + and <tt>maps.h</tt>. <tt>core.h</tt> is included by all graph types,
3.125 + therefore it usually do not have to be included directly.</b>
3.126 +- <b><tt>path_utils.h</tt> is merged to \c path.h.</b>
3.127 +- <b>The semantic of the assignment operations and copy constructors of maps
3.128 + are still under discussion. So, you must copy them by hand (i.e. copy
3.129 + each entry one-by-one)</b>
3.130 +- <b>The parameters of the graph copying tools (i.e. \c GraphCopy,
3.131 + \c DigraphCopy) have to be given in the from-to order.</b>
3.132 +- \c copyDigraph() and \c copyGraph() are renamed to \c digraphCopy()
3.133 + and \c graphCopy(), respectively.
3.134 +- <b>The interface of \ref DynArcLookUp has changed. It is now the same as
3.135 + of \ref ArcLookUp and \ref AllArcLookUp</b>
3.136 +- Some map types should also been renamed. Namely,
3.137 + - \c IntegerMap -> \c RangeMap
3.138 + - \c StdMap -> \c SparseMap
3.139 + - \c FunctorMap -> \c FunctorToMap
3.140 + - \c MapFunctor -> \c MapToFunctor
3.141 + - \c ForkWriteMap -> \c ForkMap
3.142 + - \c StoreBoolMap -> \c LoggerBoolMap
3.143 +- \c dim2::BoundingBox -> \c dim2::Box
3.144 +
3.145 +*/
3.146 +}
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/scripts/lemon-0.x-to-1.x.sh Wed Oct 08 17:05:01 2008 +0100
4.3 @@ -0,0 +1,127 @@
4.4 +#!/bin/bash
4.5 +
4.6 +set -e
4.7 +
4.8 +if [ $# -eq 0 -o x$1 = "x-h" -o x$1 = "x-help" -o x$1 = "x--help" ]; then
4.9 + echo "Usage:"
4.10 + echo " $0 source-file"
4.11 + exit
4.12 +fi
4.13 +
4.14 +TMP=`mktemp`
4.15 +
4.16 +sed -e "s/undirected graph/_gr_aph_label_/g"\
4.17 + -e "s/undirected edge/_ed_ge_label_/g"\
4.18 + -e "s/graph_/_gr_aph_label__/g"\
4.19 + -e "s/_graph/__gr_aph_label_/g"\
4.20 + -e "s/UGraph/_Gr_aph_label_/g"\
4.21 + -e "s/uGraph/_gr_aph_label_/g"\
4.22 + -e "s/ugraph/_gr_aph_label_/g"\
4.23 + -e "s/Graph/_Digr_aph_label_/g"\
4.24 + -e "s/graph/_digr_aph_label_/g"\
4.25 + -e "s/UEdge/_Ed_ge_label_/g"\
4.26 + -e "s/uEdge/_ed_ge_label_/g"\
4.27 + -e "s/uedge/_ed_ge_label_/g"\
4.28 + -e "s/IncEdgeIt/_In_cEd_geIt_label_/g"\
4.29 + -e "s/Edge/_Ar_c_label_/g"\
4.30 + -e "s/edge/_ar_c_label_/g"\
4.31 + -e "s/ANode/_Re_d_label_/g"\
4.32 + -e "s/BNode/_Blu_e_label_/g"\
4.33 + -e "s/A-Node/_Re_d_label_/g"\
4.34 + -e "s/B-Node/_Blu_e_label_/g"\
4.35 + -e "s/anode/_re_d_label_/g"\
4.36 + -e "s/bnode/_blu_e_label_/g"\
4.37 + -e "s/aNode/_re_d_label_/g"\
4.38 + -e "s/bNode/_blu_e_label_/g"\
4.39 + -e "s/_Digr_aph_label_/Digraph/g"\
4.40 + -e "s/_digr_aph_label_/digraph/g"\
4.41 + -e "s/_Gr_aph_label_/Graph/g"\
4.42 + -e "s/_gr_aph_label_/graph/g"\
4.43 + -e "s/_Ar_c_label_/Arc/g"\
4.44 + -e "s/_ar_c_label_/arc/g"\
4.45 + -e "s/_Ed_ge_label_/Edge/g"\
4.46 + -e "s/_ed_ge_label_/edge/g"\
4.47 + -e "s/_In_cEd_geIt_label_/IncEdgeIt/g"\
4.48 + -e "s/_Re_d_label_/Red/g"\
4.49 + -e "s/_Blu_e_label_/Blue/g"\
4.50 + -e "s/_re_d_label_/red/g"\
4.51 + -e "s/_blu_e_label_/blue/g"\
4.52 + -e "s/\(\W\)DefPredMap\(\W\)/\1SetPredMap\2/g"\
4.53 + -e "s/\(\W\)DefPredMap$/\1SetPredMap/g"\
4.54 + -e "s/^DefPredMap\(\W\)/SetPredMap\1/g"\
4.55 + -e "s/^DefPredMap$/SetPredMap/g"\
4.56 + -e "s/\(\W\)DefDistMap\(\W\)/\1SetDistMap\2/g"\
4.57 + -e "s/\(\W\)DefDistMap$/\1SetDistMap/g"\
4.58 + -e "s/^DefDistMap\(\W\)/SetDistMap\1/g"\
4.59 + -e "s/^DefDistMap$/SetDistMap/g"\
4.60 + -e "s/\(\W\)DefReachedMap\(\W\)/\1SetReachedMap\2/g"\
4.61 + -e "s/\(\W\)DefReachedMap$/\1SetReachedMap/g"\
4.62 + -e "s/^DefReachedMap\(\W\)/SetReachedMap\1/g"\
4.63 + -e "s/^DefReachedMap$/SetReachedMap/g"\
4.64 + -e "s/\(\W\)DefProcessedMap\(\W\)/\1SetProcessedMap\2/g"\
4.65 + -e "s/\(\W\)DefProcessedMap$/\1SetProcessedMap/g"\
4.66 + -e "s/^DefProcessedMap\(\W\)/SetProcessedMap\1/g"\
4.67 + -e "s/^DefProcessedMap$/SetProcessedMap/g"\
4.68 + -e "s/\(\W\)DefHeap\(\W\)/\1SetHeap\2/g"\
4.69 + -e "s/\(\W\)DefHeap$/\1SetHeap/g"\
4.70 + -e "s/^DefHeap\(\W\)/SetHeap\1/g"\
4.71 + -e "s/^DefHeap$/SetHeap/g"\
4.72 + -e "s/\(\W\)DefStandardHeap\(\W\)/\1SetStandradHeap\2/g"\
4.73 + -e "s/\(\W\)DefStandardHeap$/\1SetStandradHeap/g"\
4.74 + -e "s/^DefStandardHeap\(\W\)/SetStandradHeap\1/g"\
4.75 + -e "s/^DefStandardHeap$/SetStandradHeap/g"\
4.76 + -e "s/\(\W\)DefOperationTraits\(\W\)/\1SetOperationTraits\2/g"\
4.77 + -e "s/\(\W\)DefOperationTraits$/\1SetOperationTraits/g"\
4.78 + -e "s/^DefOperationTraits\(\W\)/SetOperationTraits\1/g"\
4.79 + -e "s/^DefOperationTraits$/SetOperationTraits/g"\
4.80 + -e "s/\(\W\)DefProcessedMapToBeDefaultMap\(\W\)/\1SetStandardProcessedMap\2/g"\
4.81 + -e "s/\(\W\)DefProcessedMapToBeDefaultMap$/\1SetStandardProcessedMap/g"\
4.82 + -e "s/^DefProcessedMapToBeDefaultMap\(\W\)/SetStandardProcessedMap\1/g"\
4.83 + -e "s/^DefProcessedMapToBeDefaultMap$/SetStandardProcessedMap/g"\
4.84 + -e "s/\(\W\)IntegerMap\(\W\)/\1RangeMap\2/g"\
4.85 + -e "s/\(\W\)IntegerMap$/\1RangeMap/g"\
4.86 + -e "s/^IntegerMap\(\W\)/RangeMap\1/g"\
4.87 + -e "s/^IntegerMap$/RangeMap/g"\
4.88 + -e "s/\(\W\)integerMap\(\W\)/\1rangeMap\2/g"\
4.89 + -e "s/\(\W\)integerMap$/\1rangeMap/g"\
4.90 + -e "s/^integerMap\(\W\)/rangeMap\1/g"\
4.91 + -e "s/^integerMap$/rangeMap/g"\
4.92 + -e "s/\(\W\)copyGraph\(\W\)/\1graphCopy\2/g"\
4.93 + -e "s/\(\W\)copyGraph$/\1graphCopy/g"\
4.94 + -e "s/^copyGraph\(\W\)/graphCopy\1/g"\
4.95 + -e "s/^copyGraph$/graphCopy/g"\
4.96 + -e "s/\(\W\)copyDigraph\(\W\)/\1digraphCopy\2/g"\
4.97 + -e "s/\(\W\)copyDigraph$/\1digraphCopy/g"\
4.98 + -e "s/^copyDigraph\(\W\)/digraphCopy\1/g"\
4.99 + -e "s/^copyDigraph$/digraphCopy/g"\
4.100 + -e "s/\(\W\)\([sS]\)tdMap\(\W\)/\1\2parseMap\3/g"\
4.101 + -e "s/\(\W\)\([sS]\)tdMap$/\1\2parseMap/g"\
4.102 + -e "s/^\([sS]\)tdMap\(\W\)/\1parseMap\2/g"\
4.103 + -e "s/^\([sS]\)tdMap$/\1parseMap/g"\
4.104 + -e "s/\(\W\)\([Ff]\)unctorMap\(\W\)/\1\2unctorToMap\3/g"\
4.105 + -e "s/\(\W\)\([Ff]\)unctorMap$/\1\2unctorToMap/g"\
4.106 + -e "s/^\([Ff]\)unctorMap\(\W\)/\1unctorToMap\2/g"\
4.107 + -e "s/^\([Ff]\)unctorMap$/\1unctorToMap/g"\
4.108 + -e "s/\(\W\)\([Mm]\)apFunctor\(\W\)/\1\2apToFunctor\3/g"\
4.109 + -e "s/\(\W\)\([Mm]\)apFunctor$/\1\2apToFunctor/g"\
4.110 + -e "s/^\([Mm]\)apFunctor\(\W\)/\1apToFunctor\2/g"\
4.111 + -e "s/^\([Mm]\)apFunctor$/\1apToFunctor/g"\
4.112 + -e "s/\(\W\)\([Ff]\)orkWriteMap\(\W\)/\1\2orkMap\3/g"\
4.113 + -e "s/\(\W\)\([Ff]\)orkWriteMap$/\1\2orkMap/g"\
4.114 + -e "s/^\([Ff]\)orkWriteMap\(\W\)/\1orkMap\2/g"\
4.115 + -e "s/^\([Ff]\)orkWriteMap$/\1orkMap/g"\
4.116 + -e "s/\(\W\)StoreBoolMap\(\W\)/\1LoggerBoolMap\2/g"\
4.117 + -e "s/\(\W\)StoreBoolMap$/\1LoggerBoolMap/g"\
4.118 + -e "s/^StoreBoolMap\(\W\)/LoggerBoolMap\1/g"\
4.119 + -e "s/^StoreBoolMap$/LoggerBoolMap/g"\
4.120 + -e "s/\(\W\)storeBoolMap\(\W\)/\1loggerBoolMap\2/g"\
4.121 + -e "s/\(\W\)storeBoolMap$/\1loggerBoolMap/g"\
4.122 + -e "s/^storeBoolMap\(\W\)/loggerBoolMap\1/g"\
4.123 + -e "s/^storeBoolMap$/loggerBoolMap/g"\
4.124 + -e "s/\(\W\)BoundingBox\(\W\)/\1Box\2/g"\
4.125 + -e "s/\(\W\)BoundingBox$/\1Box/g"\
4.126 + -e "s/^BoundingBox\(\W\)/Box\1/g"\
4.127 + -e "s/^BoundingBox$/Box/g"\
4.128 +<$1 > $TMP
4.129 +
4.130 +mv $TMP $1
4.131 \ No newline at end of file