COIN-OR::LEMON - Graph Library

Changeset 1172:c18ed26f016c in lemon


Ignore:
Timestamp:
11/28/12 11:42:38 (11 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
1.1
Parents:
1168:b78a46fe8002 (diff), 1171:7e368d9b67f7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge bugfix #453 to branch 1.1

Files:
22 edited

Legend:

Unmodified
Added
Removed
  • lemon/concepts/graph_components.h

    r1158 r1172  
    109109
    110110          bool b;
     111          ignore_unused_variable_warning(b);
     112
    111113          b = (ia == ib) && (ia != ib);
    112114          b = (ia == INVALID) && (ib != INVALID);
  • lemon/concepts/graph_components.h

    r1171 r1172  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    3939    /// \note This class is a template class so that we can use it to
    4040    /// create graph skeleton classes. The reason for this is that \c Node
    41     /// and \c Arc (or \c Edge) types should \e not derive from the same 
     41    /// and \c Arc (or \c Edge) types should \e not derive from the same
    4242    /// base class. For \c Node you should instantiate it with character
    4343    /// \c 'n', for \c Arc with \c 'a' and for \c Edge with \c 'e'.
     
    9090      ///
    9191      /// This operator defines an ordering of the items.
    92       /// It makes possible to use graph item types as key types in 
     92      /// It makes possible to use graph item types as key types in
    9393      /// associative containers (e.g. \c std::map).
    9494      ///
     
    126126    /// This class describes the base interface of directed graph types.
    127127    /// All digraph %concepts have to conform to this class.
    128     /// It just provides types for nodes and arcs and functions 
     128    /// It just provides types for nodes and arcs and functions
    129129    /// to get the source and the target nodes of arcs.
    130130    class BaseDigraphComponent {
     
    434434    /// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types.
    435435    ///
    436     /// This class describes the concept of \c NodeIt, \c ArcIt and 
     436    /// This class describes the concept of \c NodeIt, \c ArcIt and
    437437    /// \c EdgeIt subtypes of digraph and graph types.
    438438    template <typename GR, typename Item>
     
    474474      /// next item.
    475475      GraphItemIt& operator++() { return *this; }
    476  
     476
    477477      /// \brief Equality operator
    478478      ///
     
    512512    };
    513513
    514     /// \brief Concept class for \c InArcIt, \c OutArcIt and 
     514    /// \brief Concept class for \c InArcIt, \c OutArcIt and
    515515    /// \c IncEdgeIt types.
    516516    ///
    517     /// This class describes the concept of \c InArcIt, \c OutArcIt 
     517    /// This class describes the concept of \c InArcIt, \c OutArcIt
    518518    /// and \c IncEdgeIt subtypes of digraph and graph types.
    519519    ///
    520520    /// \note Since these iterator classes do not inherit from the same
    521521    /// base class, there is an additional template parameter (selector)
    522     /// \c sel. For \c InArcIt you should instantiate it with character 
     522    /// \c sel. For \c InArcIt you should instantiate it with character
    523523    /// \c 'i', for \c OutArcIt with \c 'o' and for \c IncEdgeIt with \c 'e'.
    524524    template <typename GR,
     
    541541      GraphIncIt(const GraphIncIt& it) : Item(it) {}
    542542
    543       /// \brief Constructor that sets the iterator to the first 
     543      /// \brief Constructor that sets the iterator to the first
    544544      /// incoming or outgoing arc.
    545545      ///
    546       /// Constructor that sets the iterator to the first arc 
     546      /// Constructor that sets the iterator to the first arc
    547547      /// incoming to or outgoing from the given node.
    548548      explicit GraphIncIt(const GR&, const Base&) {}
     
    819819      /// \brief Return the first edge incident to the given node.
    820820      ///
    821       /// This function gives back the first edge incident to the given 
     821      /// This function gives back the first edge incident to the given
    822822      /// node. The bool parameter gives back the direction for which the
    823       /// source node of the directed arc representing the edge is the 
     823      /// source node of the directed arc representing the edge is the
    824824      /// given node.
    825825      void firstInc(Edge&, bool&, const Node&) const {}
     
    828828      /// given node.
    829829      ///
    830       /// This function gives back the next edge incident to the given 
     830      /// This function gives back the next edge incident to the given
    831831      /// node. The bool parameter should be used as \c firstInc() use it.
    832832      void nextInc(Edge&, bool&) const {}
     
    10081008    ///
    10091009    /// This class describes the concept of standard graph maps, i.e.
    1010     /// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and 
     1010    /// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and
    10111011    /// graph types, which can be used for associating data to graph items.
    10121012    /// The standard graph maps must conform to the ReferenceMap concept.
     
    10631063          _Map m1(g);
    10641064          _Map m2(g,t);
    1065          
     1065
    10661066          // Copy constructor
    10671067          // _Map m3(m);
     
    10871087    ///
    10881088    /// This class describes the interface of mappable directed graphs.
    1089     /// It extends \ref BaseDigraphComponent with the standard digraph 
     1089    /// It extends \ref BaseDigraphComponent with the standard digraph
    10901090    /// map classes, namely \c NodeMap and \c ArcMap.
    10911091    /// This concept is part of the Digraph concept.
     
    12251225    ///
    12261226    /// This class describes the interface of mappable undirected graphs.
    1227     /// It extends \ref MappableDigraphComponent with the standard graph 
     1227    /// It extends \ref MappableDigraphComponent with the standard graph
    12281228    /// map class for edges (\c EdgeMap).
    12291229    /// This concept is part of the Graph concept.
     
    13111311    ///
    13121312    /// This class describes the interface of extendable directed graphs.
    1313     /// It extends \ref BaseDigraphComponent with functions for adding 
     1313    /// It extends \ref BaseDigraphComponent with functions for adding
    13141314    /// nodes and arcs to the digraph.
    13151315    /// This concept requires \ref AlterableDigraphComponent.
     
    13561356    ///
    13571357    /// This class describes the interface of extendable undirected graphs.
    1358     /// It extends \ref BaseGraphComponent with functions for adding 
     1358    /// It extends \ref BaseGraphComponent with functions for adding
    13591359    /// nodes and edges to the graph.
    13601360    /// This concept requires \ref AlterableGraphComponent.
     
    14011401    ///
    14021402    /// This class describes the interface of erasable directed graphs.
    1403     /// It extends \ref BaseDigraphComponent with functions for removing 
     1403    /// It extends \ref BaseDigraphComponent with functions for removing
    14041404    /// nodes and arcs from the digraph.
    14051405    /// This concept requires \ref AlterableDigraphComponent.
     
    14141414      /// \brief Erase a node from the digraph.
    14151415      ///
    1416       /// This function erases the given node from the digraph and all arcs 
     1416      /// This function erases the given node from the digraph and all arcs
    14171417      /// connected to the node.
    14181418      void erase(const Node&) {}
     
    14411441    ///
    14421442    /// This class describes the interface of erasable undirected graphs.
    1443     /// It extends \ref BaseGraphComponent with functions for removing 
     1443    /// It extends \ref BaseGraphComponent with functions for removing
    14441444    /// nodes and edges from the graph.
    14451445    /// This concept requires \ref AlterableGraphComponent.
  • test/bfs_test.cc

    r1081 r1172  
    6262  Arc e;
    6363  int l, i;
     64  ignore_unused_variable_warning(l,i);
    6465  bool b;
    6566  BType::DistMap d(G);
     
    151152  Digraph g;
    152153  bool b;
     154  ignore_unused_variable_warning(b);
     155
    153156  bfs(g).run(Node());
    154157  b=bfs(g).run(Node(),Node());
  • test/bfs_test.cc

    r1171 r1172  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    8585    b = const_bfs_test.emptyQueue();
    8686    i = const_bfs_test.queueSize();
    87    
     87
    8888    bfs_test.start();
    8989    bfs_test.start(t);
     
    106106      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
    107107      ::Create bfs_test(G);
    108      
     108
    109109    concepts::ReadWriteMap<Node,Arc> pred_map;
    110110    concepts::ReadWriteMap<Node,int> dist_map;
    111111    concepts::ReadWriteMap<Node,bool> reached_map;
    112112    concepts::WriteMap<Node,bool> processed_map;
    113    
     113
    114114    bfs_test
    115115      .predMap(pred_map)
     
    121121    bfs_test.run(s,t);
    122122    bfs_test.run();
    123    
     123
    124124    bfs_test.init();
    125125    bfs_test.addSource(s);
     
    130130    b = bfs_test.emptyQueue();
    131131    i = bfs_test.queueSize();
    132    
     132
    133133    bfs_test.start();
    134134    bfs_test.start(t);
  • test/circulation_test.cc

    r1081 r1172  
    7474  VType v;
    7575  bool b;
     76  ignore_unused_variable_warning(v,b);
    7677
    7778  typedef Circulation<Digraph, CapMap, CapMap, SupplyMap>
  • test/circulation_test.cc

    r1171 r1172  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    8383  CirculationType circ_test(g, lcap, ucap, supply);
    8484  const CirculationType& const_circ_test = circ_test;
    85    
     85
    8686  circ_test
    8787    .lowerMap(lcap)
     
    9999  b = const_circ_test.barrier(n);
    100100  const_circ_test.barrierMap(bar);
    101  
     101
    102102  ignore_unused_variable_warning(fm);
    103103}
  • test/dfs_test.cc

    r1081 r1172  
    6868  int l, i;
    6969  bool b;
     70  ignore_unused_variable_warning(l,i,b);
     71
    7072  DType::DistMap d(G);
    7173  DType::PredMap p(G);
     
    152154  Digraph g;
    153155  bool b;
     156  ignore_unused_variable_warning(b);
     157
    154158  dfs(g).run(Node());
    155159  b=dfs(g).run(Node(),Node());
  • test/dfs_test.cc

    r1171 r1172  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    8989    b = const_dfs_test.emptyQueue();
    9090    i = const_dfs_test.queueSize();
    91    
     91
    9292    dfs_test.start();
    9393    dfs_test.start(t);
     
    115115    concepts::ReadWriteMap<Node,bool> reached_map;
    116116    concepts::WriteMap<Node,bool> processed_map;
    117    
     117
    118118    dfs_test
    119119      .predMap(pred_map)
     
    132132    b = dfs_test.emptyQueue();
    133133    i = dfs_test.queueSize();
    134    
     134
    135135    dfs_test.start();
    136136    dfs_test.start(t);
     
    224224  check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6.");
    225225  }
    226  
     226
    227227  {
    228228    NullMap<Node,Arc> myPredMap;
  • test/dijkstra_test.cc

    r1081 r1172  
    6666  int i;
    6767  bool b;
     68  ignore_unused_variable_warning(l,i,b);
     69
    6870  DType::DistMap d(G);
    6971  DType::PredMap p(G);
     
    163165  Digraph g;
    164166  bool b;
     167  ignore_unused_variable_warning(b);
     168
    165169  dijkstra(g,LengthMap()).run(Node());
    166170  b=dijkstra(g,LengthMap()).run(Node(),Node());
  • test/dijkstra_test.cc

    r1171 r1172  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    8888    b = const_dijkstra_test.emptyQueue();
    8989    i = const_dijkstra_test.queueSize();
    90    
     90
    9191    dijkstra_test.start();
    9292    dijkstra_test.start(t);
     
    112112      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
    113113      ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
    114       ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >, 
     114      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >,
    115115                concepts::ReadWriteMap<Node,int> >
    116116      ::Create dijkstra_test(G,length);
     
    122122    concepts::ReadWriteMap<Node,int> heap_cross_ref;
    123123    BinHeap<VType, concepts::ReadWriteMap<Node,int> > heap(heap_cross_ref);
    124    
     124
    125125    dijkstra_test
    126126      .lengthMap(length_map)
     
    139139    b = dijkstra_test.emptyQueue();
    140140    i = dijkstra_test.queueSize();
    141    
     141
    142142    dijkstra_test.start();
    143143    dijkstra_test.start(t);
  • test/gomory_hu_test.cc

    r1081 r1172  
    6969  Value v;
    7070  int d;
     71  ignore_unused_variable_warning(v,d);
    7172
    7273  GomoryHu<Graph, CapMap> gh_test(g, cap);
  • test/gomory_hu_test.cc

    r1171 r1172  
     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-2011
     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
    119#include <iostream>
    220
     
    3452  "source 0\n"
    3553  "target 3\n";
    36  
     54
    3755void checkGomoryHuCompile()
    3856{
     
    7189
    7290int cutValue(const Graph& graph, const BoolNodeMap& cut,
    73              const IntEdgeMap& capacity) {
     91             const IntEdgeMap& capacity) {
    7492
    7593  int sum = 0;
     
    109127      int sum=0;
    110128      for(GomoryHu<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a)
    111         sum+=capacity[a]; 
     129        sum+=capacity[a];
    112130      check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt");
    113131
     
    120138    }
    121139  }
    122  
     140
    123141  return 0;
    124142}
  • test/hao_orlin_test.cc

    r1081 r1172  
    6767  CutMap cut;
    6868  Value v;
     69  ignore_unused_variable_warning(v);
    6970
    7071  HaoOrlin<Digraph, CapMap> ho_test(g, cap);
  • test/hao_orlin_test.cc

    r1171 r1172  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    8585
    8686template <typename Graph, typename CapMap, typename CutMap>
    87 typename CapMap::Value 
     87typename CapMap::Value
    8888  cutValue(const Graph& graph, const CapMap& cap, const CutMap& cut)
    8989{
     
    112112    ho.run();
    113113    ho.minCutMap(cut);
    114    
     114
    115115    check(ho.minCutValue() == 1, "Wrong cut value");
    116116    check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value");
     
    128128    ho.run();
    129129    ho.minCutMap(cut);
    130    
     130
    131131    check(ho.minCutValue() == 1, "Wrong cut value");
    132132    check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value");
    133133  }
    134  
     134
    135135  typedef Undirector<SmartDigraph> UGraph;
    136136  UGraph ugraph(graph);
    137  
     137
    138138  {
    139139    HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap1);
    140140    ho.run();
    141141    ho.minCutMap(cut);
    142    
     142
    143143    check(ho.minCutValue() == 2, "Wrong cut value");
    144144    check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value");
     
    148148    ho.run();
    149149    ho.minCutMap(cut);
    150    
     150
    151151    check(ho.minCutValue() == 5, "Wrong cut value");
    152152    check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value");
     
    156156    ho.run();
    157157    ho.minCutMap(cut);
    158    
     158
    159159    check(ho.minCutValue() == 5, "Wrong cut value");
    160160    check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value");
  • test/matching_test.cc

    r1081 r1172  
    146146  MaxMatching<Graph>::Status stat =
    147147    const_mat_test.status(n);
     148  ignore_unused_variable_warning(stat);
    148149  const MaxMatching<Graph>::StatusMap& smap =
    149150    const_mat_test.statusMap();
  • test/matching_test.cc

    r1171 r1172  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    135135  mat_test.startDense();
    136136  mat_test.run();
    137  
     137
    138138  const_mat_test.matchingSize();
    139139  const_mat_test.matching(e);
     
    144144  const_mat_test.mate(n);
    145145
    146   MaxMatching<Graph>::Status stat = 
     146  MaxMatching<Graph>::Status stat =
    147147    const_mat_test.status(n);
    148148  ignore_unused_variable_warning(stat);
     
    172172  mat_test.start();
    173173  mat_test.run();
    174  
     174
    175175  const_mat_test.matchingWeight();
    176176  const_mat_test.matchingSize();
     
    181181  e = mmap[n];
    182182  const_mat_test.mate(n);
    183  
     183
    184184  int k = 0;
    185185  const_mat_test.dualValue();
     
    209209  mat_test.start();
    210210  mat_test.run();
    211  
     211
    212212  const_mat_test.matchingWeight();
    213213  const_mat_test.matching(e);
     
    217217  e = mmap[n];
    218218  const_mat_test.mate(n);
    219  
     219
    220220  int k = 0;
    221221  const_mat_test.dualValue();
  • test/min_cost_arborescence_test.cc

    r1081 r1172  
    9292  VType c;
    9393  bool b;
     94  ignore_unused_variable_warning(c,b);
    9495  int i;
    9596  CostMap cost;
  • test/min_cost_arborescence_test.cc

    r1171 r1172  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    112112  b = const_mcarb_test.emptyQueue();
    113113  i = const_mcarb_test.queueSize();
    114  
     114
    115115  c = const_mcarb_test.arborescenceCost();
    116116  b = const_mcarb_test.arborescence(e);
     
    122122  b = const_mcarb_test.reached(n);
    123123  b = const_mcarb_test.processed(n);
    124  
     124
    125125  i = const_mcarb_test.dualNum();
    126126  c = const_mcarb_test.dualValue();
    127127  i = const_mcarb_test.dualSize(i);
    128128  c = const_mcarb_test.dualValue(i);
    129  
     129
    130130  ignore_unused_variable_warning(am);
    131131  ignore_unused_variable_warning(pm);
  • test/preflow_test.cc

    r1081 r1172  
    8787  VType v;
    8888  bool b;
     89  ignore_unused_variable_warning(v,b);
    8990
    9091  typedef Preflow<Digraph, CapMap>
  • test/preflow_test.cc

    r1171 r1172  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    115115  b = const_preflow_test.minCut(n);
    116116  const_preflow_test.minCutMap(cut);
    117  
     117
    118118  ignore_unused_variable_warning(fm);
    119119}
     
    156156{
    157157  DIGRAPH_TYPEDEFS(SmartDigraph);
    158  
     158
    159159  SmartDigraph g;
    160160  SmartDigraph::ArcMap<int> cap(g),iflow(g);
     
    268268
    269269  initFlowTest();
    270  
     270
    271271  return 0;
    272272}
  • test/suurballe_test.cc

    r1081 r1172  
    108108  int f;
    109109  VType c;
     110  ignore_unused_variable_warning(f,c);
     111
    110112  c = const_suurb_test.totalLength();
    111113  f = const_suurb_test.flow(e);
  • test/suurballe_test.cc

    r1171 r1172  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    8181  typedef Digraph::Arc Arc;
    8282  typedef concepts::ReadMap<Arc, VType> LengthMap;
    83  
     83
    8484  typedef Suurballe<Digraph, LengthMap> SuurballeType;
    8585
     
    105105  k = suurb_test.findFlow(n, k);
    106106  suurb_test.findPaths();
    107  
     107
    108108  int f;
    109109  VType c;
     
    119119  k = const_suurb_test.pathNum();
    120120  Path<Digraph> p = const_suurb_test.path(k);
    121  
     121
    122122  ignore_unused_variable_warning(fm);
    123123  ignore_unused_variable_warning(pm);
Note: See TracChangeset for help on using the changeset viewer.