1 | 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
2 | 2 |
* |
3 | 3 |
* This file is a part of LEMON, a generic C++ optimization library. |
4 | 4 |
* |
5 | 5 |
* Copyright (C) 2003-2008 |
6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
8 | 8 |
* |
9 | 9 |
* Permission to use, modify and distribute this software is granted |
10 | 10 |
* provided that this copyright notice appears in all copies. For |
11 | 11 |
* precise terms see the accompanying LICENSE file. |
12 | 12 |
* |
13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
14 | 14 |
* express or implied, and with no claim as to its suitability for any |
15 | 15 |
* purpose. |
16 | 16 |
* |
17 | 17 |
*/ |
18 | 18 |
|
19 | 19 |
namespace lemon { |
20 | 20 |
/*! |
21 | 21 |
|
22 | 22 |
\page migration Migration from the 0.x Series |
23 | 23 |
|
24 | 24 |
This guide gives an in depth description on what has changed compared |
25 | 25 |
to the 0.x release series. |
26 | 26 |
|
27 | 27 |
Many of these changes adjusted automatically by the |
28 | 28 |
<tt>script/lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual |
29 | 29 |
update are typeset <b>boldface</b>. |
30 | 30 |
|
31 | 31 |
\section migration-graph Graph Related Name Changes |
32 | 32 |
|
33 | 33 |
- \ref concepts::Digraph "Directed graphs" are called \c Digraph and |
34 | 34 |
they have <tt>Arc</tt>s (instead of <tt>Edge</tt>s), while |
35 | 35 |
\ref concepts::Graph "undirected graphs" are called \c Graph |
36 | 36 |
(instead of \c UGraph) and they have <tt>Edge</tt>s (instead of |
37 | 37 |
<tt>UEdge</tt>s). These changes reflected thoroughly everywhere in |
38 | 38 |
the library. Namely, |
39 | 39 |
- \c Graph -> \c Digraph |
40 | 40 |
- \c %ListGraph -> \c ListDigraph, \c %SmartGraph -> \c SmartDigraph etc. |
41 | 41 |
- \c UGraph -> \c Graph |
42 | 42 |
- \c ListUGraph -> \c ListGraph, \c SmartUGraph -> \c SmartGraph etc. |
43 | 43 |
- \c Edge -> \c Arc, \c UEdge -> \c Edge |
44 | 44 |
- \c EdgeMap -> \c ArcMap, \c UEdgeMap -> \c EdgeMap |
45 | 45 |
- \c EdgeIt -> \c ArcIt, \c UEdgeIt -> \c EdgeIt |
46 | 46 |
- Class names and function names containing the words \c graph, |
47 | 47 |
\c ugraph, \e edge or \e arc should also be updated. |
48 | 48 |
- <b>The two endpoints of an (\e undirected) \c Edge can be obtained by the |
49 | 49 |
<tt>u()</tt> and <tt>v()</tt> member function of the graph |
50 | 50 |
(instead of <tt>source()</tt> and <tt>target()</tt>). This change |
51 | 51 |
must be done by hand.</b> |
52 | 52 |
\n Of course, you can still use <tt>source()</tt> and <tt>target()</tt> |
53 | 53 |
for <tt>Arc</tt>s (directed edges). |
54 | 54 |
|
55 | 55 |
\warning |
56 | 56 |
<b>The <tt>script/lemon-0.x-to-1.x.sh</tt> tool replaces all instances of |
57 | 57 |
the words \c graph, \c digraph, \c edge and \c arc, so it replaces them |
58 | 58 |
in strings, comments etc. as well as in all identifiers.</b> |
59 | 59 |
|
60 | 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. |
|
61 | 91 |
|
62 | 92 |
\section migration-search BFS, DFS and Dijkstra |
63 | 93 |
- <b>Using the function interface of BFS, DFS and %Dijkstra both source and |
64 | 94 |
target nodes can be given as parameters of the <tt>run()</tt> function |
65 | 95 |
(instead of \c bfs(), \c dfs() or \c dijkstra() itself).</b> |
66 | 96 |
- \ref named-templ-param "Named class template parameters" of \c Bfs, |
67 | 97 |
\c Dfs, \c Dijkstra, \c BfsVisit, \c DfsVisit are renamed to start |
68 | 98 |
with "Set" instead of "Def". Namely, |
69 | 99 |
- \c DefPredMap -> \c SetPredMap |
70 | 100 |
- \c DefDistMap -> \c SetDistMap |
71 | 101 |
- \c DefReachedMap -> \c SetReachedMap |
72 | 102 |
- \c DefProcessedMap -> \c SetProcessedMap |
73 | 103 |
- \c DefHeap -> \c SetHeap |
74 | 104 |
- \c DefStandardHeap -> \c SetStandardHeap |
75 | 105 |
- \c DefOperationTraits -> \c SetOperationTraits |
76 | 106 |
- \c DefProcessedMapToBeDefaultMap -> \c SetStandardProcessedMap |
77 | 107 |
|
78 | 108 |
\section migration-error Exceptions and Debug tools |
79 | 109 |
|
80 | 110 |
<b>The class hierarchy of exceptions has largely been simplified. Now, |
81 | 111 |
only the i/o related tools may throw exceptions. All other exceptions |
82 | 112 |
have been replaced with either the \c LEMON_ASSERT or the \c LEMON_DEBUG |
83 | 113 |
macros.</b> |
84 | 114 |
|
85 | 115 |
<b>On the other hand, the parameter order of constructors of the |
86 | 116 |
exceptions has been changed. See \ref IoError and \ref FormatError for |
87 | 117 |
more details.</b> |
88 | 118 |
|
89 | 119 |
\section migration-other Others |
90 | 120 |
- <b>The contents of <tt>graph_utils.h</tt> are moved to <tt>core.h</tt> |
91 | 121 |
and <tt>maps.h</tt>. <tt>core.h</tt> is included by all graph types, |
92 | 122 |
therefore it usually do not have to be included directly.</b> |
93 | 123 |
- <b><tt>path_utils.h</tt> is merged to \c path.h.</b> |
94 | 124 |
- <b>The semantic of the assignment operations and copy constructors of maps |
95 | 125 |
are still under discussion. So, you must copy them by hand (i.e. copy |
96 | 126 |
each entry one-by-one)</b> |
97 | 127 |
- <b>The parameters of the graph copying tools (i.e. \c GraphCopy, |
98 | 128 |
\c DigraphCopy) have to be given in the from-to order.</b> |
99 | 129 |
- \c copyDigraph() and \c copyGraph() are renamed to \c digraphCopy() |
100 | 130 |
and \c graphCopy(), respectively. |
101 | 131 |
- <b>The interface of \ref DynArcLookUp has changed. It is now the same as |
102 | 132 |
of \ref ArcLookUp and \ref AllArcLookUp</b> |
103 | 133 |
- Some map types should also been renamed. Namely, |
104 | 134 |
- \c IntegerMap -> \c RangeMap |
105 | 135 |
- \c StdMap -> \c SparseMap |
106 | 136 |
- \c FunctorMap -> \c FunctorToMap |
107 | 137 |
- \c MapFunctor -> \c MapToFunctor |
108 | 138 |
- \c ForkWriteMap -> \c ForkMap |
109 | 139 |
- \c StoreBoolMap -> \c LoggerBoolMap |
110 | 140 |
- \c dim2::BoundingBox -> \c dim2::Box |
111 | 141 |
|
112 | 142 |
*/ |
113 | 143 |
} |
0 comments (0 inline)