[309] | 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 | |
---|
[310] | 19 | namespace lemon { |
---|
[309] | 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 |
---|
[310] | 25 | to the 0.x release series. |
---|
[309] | 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 | |
---|
[310] | 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 |
---|
[309] | 38 | the library. Namely, |
---|
| 39 | - \c Graph -> \c Digraph |
---|
[310] | 40 | - \c %ListGraph -> \c ListDigraph, \c %SmartGraph -> \c SmartDigraph etc. |
---|
[309] | 41 | - \c UGraph -> \c Graph |
---|
| 42 | - \c ListUGraph -> \c ListGraph, \c SmartUGraph -> \c SmartGraph etc. |
---|
[310] | 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. |
---|
[309] | 48 | - <b>The two endpoints of an (\e undirected) \c Edge can be obtained by the |
---|
[310] | 49 | <tt>u()</tt> and <tt>v()</tt> member function of the graph |
---|
[309] | 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 | |
---|
[310] | 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 | |
---|
[309] | 60 | \section migration-lgf LGF tools |
---|
| 61 | |
---|
| 62 | \section migration-search BFS, DFS and Dijkstra |
---|
[310] | 63 | - <b>Using the function interface of BFS, DFS and %Dijkstra both source and |
---|
| 64 | target nodes can be given as parameters of the <tt>run()</tt> function |
---|
| 65 | (instead of \c bfs(), \c dfs() or \c dijkstra() itself).</b> |
---|
| 66 | - \ref named-templ-param "Named class template parameters" of \c Bfs, |
---|
| 67 | \c Dfs, \c Dijkstra, \c BfsVisit, \c DfsVisit are renamed to start |
---|
| 68 | with "Set" instead of "Def". Namely, |
---|
| 69 | - \c DefPredMap -> \c SetPredMap |
---|
| 70 | - \c DefDistMap -> \c SetDistMap |
---|
| 71 | - \c DefReachedMap -> \c SetReachedMap |
---|
| 72 | - \c DefProcessedMap -> \c SetProcessedMap |
---|
| 73 | - \c DefHeap -> \c SetHeap |
---|
| 74 | - \c DefStandardHeap -> \c SetStandardHeap |
---|
| 75 | - \c DefOperationTraits -> \c SetOperationTraits |
---|
| 76 | - \c DefProcessedMapToBeDefaultMap -> \c SetStandardProcessedMap |
---|
[309] | 77 | |
---|
| 78 | \section migration-error Exceptions and Debug tools |
---|
| 79 | |
---|
[311] | 80 | <b>The class hierarchy of exceptions has largely been simplified. Now, |
---|
| 81 | only the i/o related tools may throw exceptions. All other exceptions |
---|
| 82 | have been replaced with either the \c LEMON_ASSERT or the \c LEMON_DEBUG |
---|
| 83 | macros.</b> |
---|
| 84 | |
---|
| 85 | <b>On the other hand, the parameter order of constructors of the |
---|
| 86 | exceptions has been changed. See \ref IoError and \ref FormatError for |
---|
| 87 | more details.</b> |
---|
| 88 | |
---|
[309] | 89 | \section migration-other Others |
---|
[310] | 90 | - <b>The contents of <tt>graph_utils.h</tt> are moved to <tt>core.h</tt> |
---|
| 91 | and <tt>maps.h</tt>. <tt>core.h</tt> is included by all graph types, |
---|
| 92 | therefore it usually do not have to be included directly.</b> |
---|
| 93 | - <b><tt>path_utils.h</tt> is merged to \c path.h.</b> |
---|
[311] | 94 | - <b>The semantic of the assignment operations and copy constructors of maps |
---|
| 95 | are still under discussion. So, you must copy them by hand (i.e. copy |
---|
| 96 | each entry one-by-one)</b> |
---|
[310] | 97 | - <b>The parameters of the graph copying tools (i.e. \c GraphCopy, |
---|
| 98 | \c DigraphCopy) have to be given in the from-to order.</b> |
---|
| 99 | - \c copyDigraph() and \c copyGraph() are renamed to \c digraphCopy() |
---|
| 100 | and \c graphCopy(), respectively. |
---|
[311] | 101 | - <b>The interface of \ref DynArcLookUp has changed. It is now the same as |
---|
| 102 | of \ref ArcLookUp and \ref AllArcLookUp</b> |
---|
[310] | 103 | - Some map types should also been renamed. Namely, |
---|
| 104 | - \c IntegerMap -> \c RangeMap |
---|
| 105 | - \c StdMap -> \c SparseMap |
---|
| 106 | - \c FunctorMap -> \c FunctorToMap |
---|
| 107 | - \c MapFunctor -> \c MapToFunctor |
---|
| 108 | - \c ForkWriteMap -> \c ForkMap |
---|
| 109 | - \c StoreBoolMap -> \c LoggerBoolMap |
---|
| 110 | - \c dim2::BoundingBox -> \c dim2::Box |
---|
| 111 | |
---|
[309] | 112 | */ |
---|
[310] | 113 | } |
---|