0
2
2
| 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
|
| 2 |
* |
|
| 3 |
* This file is a part of LEMON, a generic C++ optimization library. |
|
| 4 |
* |
|
| 5 |
* Copyright (C) 2003-2008 |
|
| 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
|
| 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
|
| 8 |
* |
|
| 9 |
* Permission to use, modify and distribute this software is granted |
|
| 10 |
* provided that this copyright notice appears in all copies. For |
|
| 11 |
* precise terms see the accompanying LICENSE file. |
|
| 12 |
* |
|
| 13 |
* This software is provided "AS IS" with no warranty of any kind, |
|
| 14 |
* express or implied, and with no claim as to its suitability for any |
|
| 15 |
* purpose. |
|
| 16 |
* |
|
| 17 |
*/ |
|
| 18 |
|
|
| 19 |
namespace lemon {
|
|
| 20 |
/*! |
|
| 21 |
|
|
| 22 |
\page migration Migration from the 0.x Series |
|
| 23 |
|
|
| 24 |
This guide gives an in depth description on what has changed compared |
|
| 25 |
to the 0.x release series. |
|
| 26 |
|
|
| 27 |
Many of these changes adjusted automatically by the |
|
| 28 |
<tt>script/lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual |
|
| 29 |
update are typeset <b>boldface</b>. |
|
| 30 |
|
|
| 31 |
\section migration-graph Graph Related Name Changes |
|
| 32 |
|
|
| 33 |
- \ref concepts::Digraph "Directed graphs" are called \c Digraph and |
|
| 34 |
they have <tt>Arc</tt>s (instead of <tt>Edge</tt>s), while |
|
| 35 |
\ref concepts::Graph "undirected graphs" are called \c Graph |
|
| 36 |
(instead of \c UGraph) and they have <tt>Edge</tt>s (instead of |
|
| 37 |
<tt>UEdge</tt>s). These changes reflected thoroughly everywhere in |
|
| 38 |
the library. Namely, |
|
| 39 |
- \c Graph -> \c Digraph |
|
| 40 |
- \c %ListGraph -> \c ListDigraph, \c %SmartGraph -> \c SmartDigraph etc. |
|
| 41 |
- \c UGraph -> \c Graph |
|
| 42 |
- \c ListUGraph -> \c ListGraph, \c SmartUGraph -> \c SmartGraph etc. |
|
| 43 |
- \c Edge -> \c Arc, \c UEdge -> \c Edge |
|
| 44 |
- \c EdgeMap -> \c ArcMap, \c UEdgeMap -> \c EdgeMap |
|
| 45 |
- \c EdgeIt -> \c ArcIt, \c UEdgeIt -> \c EdgeIt |
|
| 46 |
- Class names and function names containing the words \c graph, |
|
| 47 |
\c ugraph, \e edge or \e arc should also be updated. |
|
| 48 |
- <b>The two endpoints of an (\e undirected) \c Edge can be obtained by the |
|
| 49 |
<tt>u()</tt> and <tt>v()</tt> member function of the graph |
|
| 50 |
(instead of <tt>source()</tt> and <tt>target()</tt>). This change |
|
| 51 |
must be done by hand.</b> |
|
| 52 |
\n Of course, you can still use <tt>source()</tt> and <tt>target()</tt> |
|
| 53 |
for <tt>Arc</tt>s (directed edges). |
|
| 54 |
|
|
| 55 |
\warning |
|
| 56 |
<b>The <tt>script/lemon-0.x-to-1.x.sh</tt> tool replaces all instances of |
|
| 57 |
the words \c graph, \c digraph, \c edge and \c arc, so it replaces them |
|
| 58 |
in strings, comments etc. as well as in all identifiers.</b> |
|
| 59 |
|
|
| 60 |
\section migration-lgf LGF tools |
|
| 61 |
- The \ref lgf-format "LGF file format" has changed, |
|
| 62 |
<tt>\@nodeset</tt> has changed to <tt>\@nodes</tt>, |
|
| 63 |
<tt>\@edgeset</tt> and <tt>\@uedgeset</tt> to <tt>\@arcs</tt> or |
|
| 64 |
<tt>\@edges</tt>, which become completely equivalents. The |
|
| 65 |
<tt>\@nodes</tt>, <tt>\@edges</tt> and <tt>\@uedges</tt> sections are |
|
| 66 |
removed from the format, the content of them should be |
|
| 67 |
the part of <tt>\@attributes</tt> section. The data fields in |
|
| 68 |
the sections must follow a strict format, they must be either character |
|
| 69 |
sequences without whitespaces or quoted strings. |
|
| 70 |
- The <tt>LemonReader</tt> and <tt>LemonWriter</tt> core interfaces |
|
| 71 |
are no longer available. |
|
| 72 |
- The implementation of the general section readers and writers has changed |
|
| 73 |
they are simple functors now. Beside the old |
|
| 74 |
stream based section handling, currently line oriented section |
|
| 75 |
reading and writing are also supported. In the |
|
| 76 |
section readers the lines must be counted manually. The sections |
|
| 77 |
should be read and written with the SectionWriter and SectionReader |
|
| 78 |
classes. |
|
| 79 |
- Instead of the item readers and writers, item converters should be |
|
| 80 |
used. The converters are functors, which map the type to |
|
| 81 |
std::string or std::string to the type. The converters for standard |
|
| 82 |
containers hasn't yet been implemented in the new LEMON. The converters |
|
| 83 |
can return strings in any format, because if it is necessary, the LGF |
|
| 84 |
writer and reader will quote and unquote the given value. |
|
| 85 |
- The DigraphReader and DigraphWriter can used similarly to the |
|
| 86 |
0.x series, however the <tt>read</tt> or <tt>write</tt> prefix of |
|
| 87 |
the member functions are removed. |
|
| 88 |
- The new LEMON supports the function like interface, the \c |
|
| 89 |
digraphReader and \c digraphWriter functions are more convenient than |
|
| 90 |
using the classes directly. |
|
| 91 |
|
|
| 92 |
\section migration-search BFS, DFS and Dijkstra |
|
| 93 |
- <b>Using the function interface of BFS, DFS and %Dijkstra both source and |
|
| 94 |
target nodes can be given as parameters of the <tt>run()</tt> function |
|
| 95 |
(instead of \c bfs(), \c dfs() or \c dijkstra() itself).</b> |
|
| 96 |
- \ref named-templ-param "Named class template parameters" of \c Bfs, |
|
| 97 |
\c Dfs, \c Dijkstra, \c BfsVisit, \c DfsVisit are renamed to start |
|
| 98 |
with "Set" instead of "Def". Namely, |
|
| 99 |
- \c DefPredMap -> \c SetPredMap |
|
| 100 |
- \c DefDistMap -> \c SetDistMap |
|
| 101 |
- \c DefReachedMap -> \c SetReachedMap |
|
| 102 |
- \c DefProcessedMap -> \c SetProcessedMap |
|
| 103 |
- \c DefHeap -> \c SetHeap |
|
| 104 |
- \c DefStandardHeap -> \c SetStandardHeap |
|
| 105 |
- \c DefOperationTraits -> \c SetOperationTraits |
|
| 106 |
- \c DefProcessedMapToBeDefaultMap -> \c SetStandardProcessedMap |
|
| 107 |
|
|
| 108 |
\section migration-error Exceptions and Debug tools |
|
| 109 |
|
|
| 110 |
<b>The class hierarchy of exceptions has largely been simplified. Now, |
|
| 111 |
only the i/o related tools may throw exceptions. All other exceptions |
|
| 112 |
have been replaced with either the \c LEMON_ASSERT or the \c LEMON_DEBUG |
|
| 113 |
macros.</b> |
|
| 114 |
|
|
| 115 |
<b>On the other hand, the parameter order of constructors of the |
|
| 116 |
exceptions has been changed. See \ref IoError and \ref FormatError for |
|
| 117 |
more details.</b> |
|
| 118 |
|
|
| 119 |
\section migration-other Others |
|
| 120 |
- <b>The contents of <tt>graph_utils.h</tt> are moved to <tt>core.h</tt> |
|
| 121 |
and <tt>maps.h</tt>. <tt>core.h</tt> is included by all graph types, |
|
| 122 |
therefore it usually do not have to be included directly.</b> |
|
| 123 |
- <b><tt>path_utils.h</tt> is merged to \c path.h.</b> |
|
| 124 |
- <b>The semantic of the assignment operations and copy constructors of maps |
|
| 125 |
are still under discussion. So, you must copy them by hand (i.e. copy |
|
| 126 |
each entry one-by-one)</b> |
|
| 127 |
- <b>The parameters of the graph copying tools (i.e. \c GraphCopy, |
|
| 128 |
\c DigraphCopy) have to be given in the from-to order.</b> |
|
| 129 |
- \c copyDigraph() and \c copyGraph() are renamed to \c digraphCopy() |
|
| 130 |
and \c graphCopy(), respectively. |
|
| 131 |
- <b>The interface of \ref DynArcLookUp has changed. It is now the same as |
|
| 132 |
of \ref ArcLookUp and \ref AllArcLookUp</b> |
|
| 133 |
- Some map types should also been renamed. Namely, |
|
| 134 |
- \c IntegerMap -> \c RangeMap |
|
| 135 |
- \c StdMap -> \c SparseMap |
|
| 136 |
- \c FunctorMap -> \c FunctorToMap |
|
| 137 |
- \c MapFunctor -> \c MapToFunctor |
|
| 138 |
- \c ForkWriteMap -> \c ForkMap |
|
| 139 |
- \c StoreBoolMap -> \c LoggerBoolMap |
|
| 140 |
- \c dim2::BoundingBox -> \c dim2::Box |
|
| 141 |
|
|
| 142 |
*/ |
|
| 143 |
} |
| 1 |
#!/bin/bash |
|
| 2 |
|
|
| 3 |
set -e |
|
| 4 |
|
|
| 5 |
if [ $# -eq 0 -o x$1 = "x-h" -o x$1 = "x-help" -o x$1 = "x--help" ]; then |
|
| 6 |
echo "Usage:" |
|
| 7 |
echo " $0 source-file" |
|
| 8 |
exit |
|
| 9 |
fi |
|
| 10 |
|
|
| 11 |
TMP=`mktemp` |
|
| 12 |
|
|
| 13 |
sed -e "s/undirected graph/_gr_aph_label_/g"\ |
|
| 14 |
-e "s/undirected edge/_ed_ge_label_/g"\ |
|
| 15 |
-e "s/graph_/_gr_aph_label__/g"\ |
|
| 16 |
-e "s/_graph/__gr_aph_label_/g"\ |
|
| 17 |
-e "s/UGraph/_Gr_aph_label_/g"\ |
|
| 18 |
-e "s/uGraph/_gr_aph_label_/g"\ |
|
| 19 |
-e "s/ugraph/_gr_aph_label_/g"\ |
|
| 20 |
-e "s/Graph/_Digr_aph_label_/g"\ |
|
| 21 |
-e "s/graph/_digr_aph_label_/g"\ |
|
| 22 |
-e "s/UEdge/_Ed_ge_label_/g"\ |
|
| 23 |
-e "s/uEdge/_ed_ge_label_/g"\ |
|
| 24 |
-e "s/uedge/_ed_ge_label_/g"\ |
|
| 25 |
-e "s/IncEdgeIt/_In_cEd_geIt_label_/g"\ |
|
| 26 |
-e "s/Edge/_Ar_c_label_/g"\ |
|
| 27 |
-e "s/edge/_ar_c_label_/g"\ |
|
| 28 |
-e "s/ANode/_Re_d_label_/g"\ |
|
| 29 |
-e "s/BNode/_Blu_e_label_/g"\ |
|
| 30 |
-e "s/A-Node/_Re_d_label_/g"\ |
|
| 31 |
-e "s/B-Node/_Blu_e_label_/g"\ |
|
| 32 |
-e "s/anode/_re_d_label_/g"\ |
|
| 33 |
-e "s/bnode/_blu_e_label_/g"\ |
|
| 34 |
-e "s/aNode/_re_d_label_/g"\ |
|
| 35 |
-e "s/bNode/_blu_e_label_/g"\ |
|
| 36 |
-e "s/_Digr_aph_label_/Digraph/g"\ |
|
| 37 |
-e "s/_digr_aph_label_/digraph/g"\ |
|
| 38 |
-e "s/_Gr_aph_label_/Graph/g"\ |
|
| 39 |
-e "s/_gr_aph_label_/graph/g"\ |
|
| 40 |
-e "s/_Ar_c_label_/Arc/g"\ |
|
| 41 |
-e "s/_ar_c_label_/arc/g"\ |
|
| 42 |
-e "s/_Ed_ge_label_/Edge/g"\ |
|
| 43 |
-e "s/_ed_ge_label_/edge/g"\ |
|
| 44 |
-e "s/_In_cEd_geIt_label_/IncEdgeIt/g"\ |
|
| 45 |
-e "s/_Re_d_label_/Red/g"\ |
|
| 46 |
-e "s/_Blu_e_label_/Blue/g"\ |
|
| 47 |
-e "s/_re_d_label_/red/g"\ |
|
| 48 |
-e "s/_blu_e_label_/blue/g"\ |
|
| 49 |
-e "s/\(\W\)DefPredMap\(\W\)/\1SetPredMap\2/g"\ |
|
| 50 |
-e "s/\(\W\)DefPredMap$/\1SetPredMap/g"\ |
|
| 51 |
-e "s/^DefPredMap\(\W\)/SetPredMap\1/g"\ |
|
| 52 |
-e "s/^DefPredMap$/SetPredMap/g"\ |
|
| 53 |
-e "s/\(\W\)DefDistMap\(\W\)/\1SetDistMap\2/g"\ |
|
| 54 |
-e "s/\(\W\)DefDistMap$/\1SetDistMap/g"\ |
|
| 55 |
-e "s/^DefDistMap\(\W\)/SetDistMap\1/g"\ |
|
| 56 |
-e "s/^DefDistMap$/SetDistMap/g"\ |
|
| 57 |
-e "s/\(\W\)DefReachedMap\(\W\)/\1SetReachedMap\2/g"\ |
|
| 58 |
-e "s/\(\W\)DefReachedMap$/\1SetReachedMap/g"\ |
|
| 59 |
-e "s/^DefReachedMap\(\W\)/SetReachedMap\1/g"\ |
|
| 60 |
-e "s/^DefReachedMap$/SetReachedMap/g"\ |
|
| 61 |
-e "s/\(\W\)DefProcessedMap\(\W\)/\1SetProcessedMap\2/g"\ |
|
| 62 |
-e "s/\(\W\)DefProcessedMap$/\1SetProcessedMap/g"\ |
|
| 63 |
-e "s/^DefProcessedMap\(\W\)/SetProcessedMap\1/g"\ |
|
| 64 |
-e "s/^DefProcessedMap$/SetProcessedMap/g"\ |
|
| 65 |
-e "s/\(\W\)DefHeap\(\W\)/\1SetHeap\2/g"\ |
|
| 66 |
-e "s/\(\W\)DefHeap$/\1SetHeap/g"\ |
|
| 67 |
-e "s/^DefHeap\(\W\)/SetHeap\1/g"\ |
|
| 68 |
-e "s/^DefHeap$/SetHeap/g"\ |
|
| 69 |
-e "s/\(\W\)DefStandardHeap\(\W\)/\1SetStandradHeap\2/g"\ |
|
| 70 |
-e "s/\(\W\)DefStandardHeap$/\1SetStandradHeap/g"\ |
|
| 71 |
-e "s/^DefStandardHeap\(\W\)/SetStandradHeap\1/g"\ |
|
| 72 |
-e "s/^DefStandardHeap$/SetStandradHeap/g"\ |
|
| 73 |
-e "s/\(\W\)DefOperationTraits\(\W\)/\1SetOperationTraits\2/g"\ |
|
| 74 |
-e "s/\(\W\)DefOperationTraits$/\1SetOperationTraits/g"\ |
|
| 75 |
-e "s/^DefOperationTraits\(\W\)/SetOperationTraits\1/g"\ |
|
| 76 |
-e "s/^DefOperationTraits$/SetOperationTraits/g"\ |
|
| 77 |
-e "s/\(\W\)DefProcessedMapToBeDefaultMap\(\W\)/\1SetStandardProcessedMap\2/g"\ |
|
| 78 |
-e "s/\(\W\)DefProcessedMapToBeDefaultMap$/\1SetStandardProcessedMap/g"\ |
|
| 79 |
-e "s/^DefProcessedMapToBeDefaultMap\(\W\)/SetStandardProcessedMap\1/g"\ |
|
| 80 |
-e "s/^DefProcessedMapToBeDefaultMap$/SetStandardProcessedMap/g"\ |
|
| 81 |
-e "s/\(\W\)IntegerMap\(\W\)/\1RangeMap\2/g"\ |
|
| 82 |
-e "s/\(\W\)IntegerMap$/\1RangeMap/g"\ |
|
| 83 |
-e "s/^IntegerMap\(\W\)/RangeMap\1/g"\ |
|
| 84 |
-e "s/^IntegerMap$/RangeMap/g"\ |
|
| 85 |
-e "s/\(\W\)integerMap\(\W\)/\1rangeMap\2/g"\ |
|
| 86 |
-e "s/\(\W\)integerMap$/\1rangeMap/g"\ |
|
| 87 |
-e "s/^integerMap\(\W\)/rangeMap\1/g"\ |
|
| 88 |
-e "s/^integerMap$/rangeMap/g"\ |
|
| 89 |
-e "s/\(\W\)copyGraph\(\W\)/\1graphCopy\2/g"\ |
|
| 90 |
-e "s/\(\W\)copyGraph$/\1graphCopy/g"\ |
|
| 91 |
-e "s/^copyGraph\(\W\)/graphCopy\1/g"\ |
|
| 92 |
-e "s/^copyGraph$/graphCopy/g"\ |
|
| 93 |
-e "s/\(\W\)copyDigraph\(\W\)/\1digraphCopy\2/g"\ |
|
| 94 |
-e "s/\(\W\)copyDigraph$/\1digraphCopy/g"\ |
|
| 95 |
-e "s/^copyDigraph\(\W\)/digraphCopy\1/g"\ |
|
| 96 |
-e "s/^copyDigraph$/digraphCopy/g"\ |
|
| 97 |
-e "s/\(\W\)\([sS]\)tdMap\(\W\)/\1\2parseMap\3/g"\ |
|
| 98 |
-e "s/\(\W\)\([sS]\)tdMap$/\1\2parseMap/g"\ |
|
| 99 |
-e "s/^\([sS]\)tdMap\(\W\)/\1parseMap\2/g"\ |
|
| 100 |
-e "s/^\([sS]\)tdMap$/\1parseMap/g"\ |
|
| 101 |
-e "s/\(\W\)\([Ff]\)unctorMap\(\W\)/\1\2unctorToMap\3/g"\ |
|
| 102 |
-e "s/\(\W\)\([Ff]\)unctorMap$/\1\2unctorToMap/g"\ |
|
| 103 |
-e "s/^\([Ff]\)unctorMap\(\W\)/\1unctorToMap\2/g"\ |
|
| 104 |
-e "s/^\([Ff]\)unctorMap$/\1unctorToMap/g"\ |
|
| 105 |
-e "s/\(\W\)\([Mm]\)apFunctor\(\W\)/\1\2apToFunctor\3/g"\ |
|
| 106 |
-e "s/\(\W\)\([Mm]\)apFunctor$/\1\2apToFunctor/g"\ |
|
| 107 |
-e "s/^\([Mm]\)apFunctor\(\W\)/\1apToFunctor\2/g"\ |
|
| 108 |
-e "s/^\([Mm]\)apFunctor$/\1apToFunctor/g"\ |
|
| 109 |
-e "s/\(\W\)\([Ff]\)orkWriteMap\(\W\)/\1\2orkMap\3/g"\ |
|
| 110 |
-e "s/\(\W\)\([Ff]\)orkWriteMap$/\1\2orkMap/g"\ |
|
| 111 |
-e "s/^\([Ff]\)orkWriteMap\(\W\)/\1orkMap\2/g"\ |
|
| 112 |
-e "s/^\([Ff]\)orkWriteMap$/\1orkMap/g"\ |
|
| 113 |
-e "s/\(\W\)StoreBoolMap\(\W\)/\1LoggerBoolMap\2/g"\ |
|
| 114 |
-e "s/\(\W\)StoreBoolMap$/\1LoggerBoolMap/g"\ |
|
| 115 |
-e "s/^StoreBoolMap\(\W\)/LoggerBoolMap\1/g"\ |
|
| 116 |
-e "s/^StoreBoolMap$/LoggerBoolMap/g"\ |
|
| 117 |
-e "s/\(\W\)storeBoolMap\(\W\)/\1loggerBoolMap\2/g"\ |
|
| 118 |
-e "s/\(\W\)storeBoolMap$/\1loggerBoolMap/g"\ |
|
| 119 |
-e "s/^storeBoolMap\(\W\)/loggerBoolMap\1/g"\ |
|
| 120 |
-e "s/^storeBoolMap$/loggerBoolMap/g"\ |
|
| 121 |
-e "s/\(\W\)BoundingBox\(\W\)/\1Box\2/g"\ |
|
| 122 |
-e "s/\(\W\)BoundingBox$/\1Box/g"\ |
|
| 123 |
-e "s/^BoundingBox\(\W\)/Box\1/g"\ |
|
| 124 |
-e "s/^BoundingBox$/Box/g"\ |
|
| 125 |
<$1 > $TMP |
|
| 126 |
|
|
| 127 |
mv $TMP $1 |
|
| ... | ... |
No newline at end of file |
| ... | ... |
@@ -3,12 +3,13 @@ |
| 3 | 3 |
doc/coding_style.dox \ |
| 4 | 4 |
doc/dirs.dox \ |
| 5 | 5 |
doc/groups.dox \ |
| 6 | 6 |
doc/lgf.dox \ |
| 7 | 7 |
doc/license.dox \ |
| 8 | 8 |
doc/mainpage.dox \ |
| 9 |
doc/migration.dox \ |
|
| 9 | 10 |
doc/named-param.dox \ |
| 10 | 11 |
doc/namespaces.dox \ |
| 11 | 12 |
doc/html \ |
| 12 | 13 |
doc/CMakeLists.txt |
| 13 | 14 |
|
| 14 | 15 |
DOC_EPS_IMAGES18 = \ |
| ... | ... |
@@ -53,8 +53,8 @@ |
| 53 | 53 |
some \ref demoprograms "demo programs"! |
| 54 | 54 |
|
| 55 | 55 |
If you know what you are looking for then try to find it under the |
| 56 | 56 |
<a class="el" href="modules.html">Modules</a> |
| 57 | 57 |
section. |
| 58 | 58 |
|
| 59 |
|
|
| 59 |
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. |
|
| 60 | 60 |
*/ |
0 comments (0 inline)