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