COIN-OR::LEMON - Graph Library

Ticket #157: 069f27927ba9.patch

File 069f27927ba9.patch, 4.4 KB (added by Alpar Juttner, 11 years ago)
  • doc/Makefile.am

    # HG changeset patch
    # User Alpar Juttner <alpar@cs.elte.hu>
    # Date 1223294533 -3600
    # Node ID 069f27927ba9828fe7076eede1db609e154c548e
    # Parent  74eb8b425d824650215e4028d7918db83a1306e9
    0.x -> 1.x migration script and guide (preliminary version) (#157)
    
    diff --git a/doc/Makefile.am b/doc/Makefile.am
    a b  
    66        doc/lgf.dox \
    77        doc/license.dox \
    88        doc/mainpage.dox \
     9        doc/migration   .dox \
    910        doc/named-param.dox \
    1011        doc/namespaces.dox \
    1112        doc/html \
  • new file doc/migration.dox

    diff --git a/doc/migration.dox b/doc/migration.dox
    new file mode 100644
    - +  
     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/*!
     20
     21\page migration Migration from the 0.x Series
     22
     23This guide gives an in depth description on what has changed compared
     24to the 0.x release series.
     25
     26Many of these changes adjusted automatically by the
     27<tt>script/lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual
     28update are typeset <b>boldface</b>.
     29
     30\section migration-graph Graph Related Name Changes
     31
     32- Directed graphs are called \c Digraph and they have <tt>Arc</tt>s
     33  instead of <tt>Edge</tt>s, while the undirected graph is called \c
     34  Graph (instead of \c UGraph) and they have <tt>Edge</tt>s (instead
     35  of <tt>UEdge</tt>s). This changes reflected thoroughly everywhere in
     36  the library. Namely,
     37  - \c Graph -> \c Digraph
     38    - \c ListGraph -> \c ListDigraph, \c SmartGraph -> \c SmartDigraph etc.
     39  - \c UGraph -> \c Graph
     40    - \c ListUGraph -> \c ListGraph, \c SmartUGraph -> \c SmartGraph etc.
     41  - \c Edge -> \c Arc
     42  - \c UEdge -> \c Edge
     43  - \c EdgeMap -> \c ArcMap
     44  - \c UEdgeMap -> \c EdgeMap
     45  - Class names and function names containing the words \e edge or \e arc
     46    should also be updated.
     47- <b>The two endpoints of an (\e undirected) \c Edge can be obtained by the
     48  <tt>u()</tt> and <tt>v()</tt> member function of the graph class
     49  (instead of <tt>source()</tt> and <tt>target()</tt>). This change
     50  must be done by hand.</b>
     51  \n Of course, you can still use <tt>source()</tt> and <tt>target()</tt>
     52  for <tt>Arc</tt>s (directed edges).
     53
     54\section migration-lgf LGF tools
     55
     56\section migration-search BFS, DFS and Dijkstra
     57
     58\section migration-error Exceptions and Debug tools
     59
     60\section migration-other Others
     61*/
  • new file scripts/lemon-0.x-to-1.x.sh

    diff --git a/scripts/lemon-0.x-to-1.x.sh b/scripts/lemon-0.x-to-1.x.sh
    new file mode 100755
    - +  
     1#!/bin/bash
     2
     3set -e
     4
     5if [ $# -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
     9fi
     10
     11TMP=`mktemp`
     12
     13sed -e "s/bipartite undirected graph/bipartite graph/g"\
     14        -e "s/undirected graph/_gr_aph_label_/g"\
     15        -e "s/undirected edge/_ed_ge_label_/g"\
     16        -e "s/graph_/_gr_aph_label__/g"\
     17        -e "s/_graph/__gr_aph_label_/g"\
     18        -e "s/UGraph/_Gr_aph_label_/g"\
     19        -e "s/uGraph/_gr_aph_label_/g"\
     20        -e "s/ugraph/_gr_aph_label_/g"\
     21        -e "s/Graph/_Digr_aph_label_/g"\
     22        -e "s/graph/_digr_aph_label_/g"\
     23        -e "s/UEdge/_Ed_ge_label_/g"\
     24        -e "s/uEdge/_ed_ge_label_/g"\
     25        -e "s/uedge/_ed_ge_label_/g"\
     26        -e "s/IncEdgeIt/_In_cEd_geIt_label_/g"\
     27        -e "s/Edge/_Ar_c_label_/g"\
     28        -e "s/edge/_ar_c_label_/g"\
     29        -e "s/ANode/_Re_d_label_/g"\
     30        -e "s/BNode/_Blu_e_label_/g"\
     31        -e "s/A-Node/_Re_d_label_/g"\
     32        -e "s/B-Node/_Blu_e_label_/g"\
     33        -e "s/anode/_re_d_label_/g"\
     34        -e "s/bnode/_blu_e_label_/g"\
     35        -e "s/aNode/_re_d_label_/g"\
     36        -e "s/bNode/_blu_e_label_/g"\
     37        -e "s/_Digr_aph_label_/Digraph/g"\
     38        -e "s/_digr_aph_label_/digraph/g"\
     39        -e "s/_Gr_aph_label_/Graph/g"\
     40        -e "s/_gr_aph_label_/graph/g"\
     41        -e "s/_Ar_c_label_/Arc/g"\
     42        -e "s/_ar_c_label_/arc/g"\
     43        -e "s/_Ed_ge_label_/Edge/g"\
     44        -e "s/_ed_ge_label_/edge/g"\
     45        -e "s/_In_cEd_geIt_label_/IncEdgeIt/g"\
     46        -e "s/_Re_d_label_/Red/g"\
     47        -e "s/_Blu_e_label_/Blue/g"\
     48        -e "s/_re_d_label_/red/g"\
     49        -e "s/_blu_e_label_/blue/g"\
     50<$1 > $TMP
     51
     52mv $TMP $1
     53 No newline at end of file