COIN-OR::LEMON - Graph Library

Changeset 1081:f1398882a928 in lemon for test


Ignore:
Timestamp:
08/08/11 12:36:16 (9 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
1.1
Phase:
public
Tags:
r1.1.4
Message:

Unify sources

Location:
test
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • test/bfs_test.cc

    r632 r1081  
    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).
     
    8484    b = const_bfs_test.emptyQueue();
    8585    i = const_bfs_test.queueSize();
    86    
     86
    8787    bfs_test.start();
    8888    bfs_test.start(t);
     
    105105      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
    106106      ::Create bfs_test(G);
    107      
     107
    108108    concepts::ReadWriteMap<Node,Arc> pred_map;
    109109    concepts::ReadWriteMap<Node,int> dist_map;
    110110    concepts::ReadWriteMap<Node,bool> reached_map;
    111111    concepts::WriteMap<Node,bool> processed_map;
    112    
     112
    113113    bfs_test
    114114      .predMap(pred_map)
     
    120120    bfs_test.run(s,t);
    121121    bfs_test.run();
    122    
     122
    123123    bfs_test.init();
    124124    bfs_test.addSource(s);
     
    129129    b = bfs_test.emptyQueue();
    130130    i = bfs_test.queueSize();
    131    
     131
    132132    bfs_test.start();
    133133    bfs_test.start(t);
  • test/circulation_test.cc

    r658 r1081  
    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).
     
    8282  CirculationType circ_test(g, lcap, ucap, supply);
    8383  const CirculationType& const_circ_test = circ_test;
    84    
     84
    8585  circ_test
    8686    .lowerMap(lcap)
     
    9898  b = const_circ_test.barrier(n);
    9999  const_circ_test.barrierMap(bar);
    100  
     100
    101101  ignore_unused_variable_warning(fm);
    102102}
  • test/connectivity_test.cc

    r696 r1081  
    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).
     
    3030  typedef ListDigraph Digraph;
    3131  typedef Undirector<Digraph> Graph;
    32  
    33   {
    34     Digraph d;
    35     Digraph::NodeMap<int> order(d);
    36     Graph g(d);
    37    
     32
     33  {
     34    Digraph d;
     35    Digraph::NodeMap<int> order(d);
     36    Graph g(d);
     37
    3838    check(stronglyConnected(d), "The empty digraph is strongly connected");
    3939    check(countStronglyConnectedComponents(d) == 0,
     
    4949    check(countBiEdgeConnectedComponents(g) == 0,
    5050          "The empty graph has 0 bi-edge-connected component");
    51          
     51
    5252    check(dag(d), "The empty digraph is DAG.");
    5353    check(checkedTopologicalSort(d, order), "The empty digraph is DAG.");
     
    8383    check(countBiEdgeConnectedComponents(g) == 1,
    8484          "This graph has 1 bi-edge-connected component");
    85          
     85
    8686    check(dag(d), "This digraph is DAG.");
    8787    check(checkedTopologicalSort(d, order), "This digraph is DAG.");
     
    102102    Digraph::NodeMap<int> order(d);
    103103    Graph g(d);
    104    
     104
    105105    Digraph::Node n1 = d.addNode();
    106106    Digraph::Node n2 = d.addNode();
     
    109109    Digraph::Node n5 = d.addNode();
    110110    Digraph::Node n6 = d.addNode();
    111    
     111
    112112    d.addArc(n1, n3);
    113113    d.addArc(n3, n2);
     
    137137    check(!parallelFree(g), "This graph is not parallel-free.");
    138138    check(!simpleGraph(g), "This graph is not simple.");
    139    
     139
    140140    d.addArc(n3, n3);
    141    
     141
    142142    check(!loopFree(d), "This digraph is not loop-free.");
    143143    check(!loopFree(g), "This graph is not loop-free.");
    144144    check(!simpleGraph(d), "This digraph is not simple.");
    145    
     145
    146146    d.addArc(n3, n2);
    147    
     147
    148148    check(!parallelFree(d), "This digraph is not parallel-free.");
    149149  }
    150  
     150
    151151  {
    152152    Digraph d;
    153153    Digraph::ArcMap<bool> cutarcs(d, false);
    154154    Graph g(d);
    155    
     155
    156156    Digraph::Node n1 = d.addNode();
    157157    Digraph::Node n2 = d.addNode();
     
    173173    d.addArc(n6, n7);
    174174    d.addArc(n7, n6);
    175    
     175
    176176    check(!stronglyConnected(d), "This digraph is not strongly connected");
    177177    check(countStronglyConnectedComponents(d) == 3,
     
    236236    Digraph d;
    237237    Digraph::NodeMap<int> order(d);
    238    
     238
    239239    Digraph::Node belt = d.addNode();
    240240    Digraph::Node trousers = d.addNode();
     
    256256    d.addArc(shirt, necktie);
    257257    d.addArc(necktie, coat);
    258    
     258
    259259    check(dag(d), "This digraph is DAG.");
    260260    topologicalSort(d, order);
     
    268268    ListGraph g;
    269269    ListGraph::NodeMap<bool> map(g);
    270    
     270
    271271    ListGraph::Node n1 = g.addNode();
    272272    ListGraph::Node n2 = g.addNode();
     
    284284    g.addEdge(n4, n7);
    285285    g.addEdge(n5, n7);
    286    
     286
    287287    check(bipartite(g), "This graph is bipartite");
    288288    check(bipartitePartitions(g, map), "This graph is bipartite");
    289    
     289
    290290    check(map[n1] == map[n2] && map[n1] == map[n6] && map[n1] == map[n7],
    291291          "Wrong bipartitePartitions()");
  • test/dfs_test.cc

    r1009 r1081  
    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).
     
    8787    b = const_dfs_test.emptyQueue();
    8888    i = const_dfs_test.queueSize();
    89    
     89
    9090    dfs_test.start();
    9191    dfs_test.start(t);
     
    113113    concepts::ReadWriteMap<Node,bool> reached_map;
    114114    concepts::WriteMap<Node,bool> processed_map;
    115    
     115
    116116    dfs_test
    117117      .predMap(pred_map)
     
    130130    b = dfs_test.emptyQueue();
    131131    i = dfs_test.queueSize();
    132    
     132
    133133    dfs_test.start();
    134134    dfs_test.start(t);
     
    220220  check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6.");
    221221  }
    222  
     222
    223223  {
    224224    NullMap<Node,Arc> myPredMap;
  • test/dijkstra_test.cc

    r632 r1081  
    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).
     
    8686    b = const_dijkstra_test.emptyQueue();
    8787    i = const_dijkstra_test.queueSize();
    88    
     88
    8989    dijkstra_test.start();
    9090    dijkstra_test.start(t);
     
    110110      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
    111111      ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
    112       ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >, 
     112      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >,
    113113                concepts::ReadWriteMap<Node,int> >
    114114      ::Create dijkstra_test(G,length);
     
    120120    concepts::ReadWriteMap<Node,int> heap_cross_ref;
    121121    BinHeap<VType, concepts::ReadWriteMap<Node,int> > heap(heap_cross_ref);
    122    
     122
    123123    dijkstra_test
    124124      .lengthMap(length_map)
     
    137137    b = dijkstra_test.emptyQueue();
    138138    i = dijkstra_test.queueSize();
    139    
     139
    140140    dijkstra_test.start();
    141141    dijkstra_test.start(t);
  • test/edge_set_test.cc

    r559 r1081  
    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).
  • test/euler_test.cc

    r639 r1081  
    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).
     
    8686  typedef ListDigraph Digraph;
    8787  typedef Undirector<Digraph> Graph;
    88  
    89   {
    90     Digraph d;
    91     Graph g(d);
    92    
     88
     89  {
     90    Digraph d;
     91    Graph g(d);
     92
    9393    checkDiEulerIt(d);
    9494    checkDiEulerIt(g);
     
    129129    Digraph::Node n2 = d.addNode();
    130130    Digraph::Node n3 = d.addNode();
    131    
     131
    132132    d.addArc(n1, n2);
    133133    d.addArc(n2, n1);
     
    154154    Digraph::Node n5 = d.addNode();
    155155    Digraph::Node n6 = d.addNode();
    156    
     156
    157157    d.addArc(n1, n2);
    158158    d.addArc(n2, n4);
     
    190190    Digraph::Node n4 = d.addNode();
    191191    Digraph::Node n5 = d.addNode();
    192    
     192
    193193    d.addArc(n1, n2);
    194194    d.addArc(n2, n3);
     
    212212    Digraph::Node n2 = d.addNode();
    213213    Digraph::Node n3 = d.addNode();
    214    
     214
    215215    d.addArc(n1, n2);
    216216    d.addArc(n2, n3);
  • test/gomory_hu_test.cc

    r643 r1081  
     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{
     
    7088
    7189int cutValue(const Graph& graph, const BoolNodeMap& cut,
    72              const IntEdgeMap& capacity) {
     90             const IntEdgeMap& capacity) {
    7391
    7492  int sum = 0;
     
    108126      int sum=0;
    109127      for(GomoryHu<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a)
    110         sum+=capacity[a]; 
     128        sum+=capacity[a];
    111129      check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt");
    112130
     
    119137    }
    120138  }
    121  
     139
    122140  return 0;
    123141}
  • test/graph_copy_test.cc

    r984 r1081  
    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).
     
    7171    nodeCrossRef(ncr).arcCrossRef(ecr).
    7272    node(fn, tn).arc(fa, ta).run();
    73  
     73
    7474  check(countNodes(from) == countNodes(to), "Wrong copy.");
    7575  check(countArcs(from) == countArcs(to), "Wrong copy.");
     
    9999  // Test repeated copy
    100100  digraphCopy(from, to).run();
    101  
     101
    102102  check(countNodes(from) == countNodes(to), "Wrong copy.");
    103103  check(countArcs(from) == countArcs(to), "Wrong copy.");
     
    201201  // Test repeated copy
    202202  graphCopy(from, to).run();
    203  
     203
    204204  check(countNodes(from) == countNodes(to), "Wrong copy.");
    205205  check(countEdges(from) == countEdges(to), "Wrong copy.");
  • test/hao_orlin_test.cc

    r644 r1081  
    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).
     
    8484
    8585template <typename Graph, typename CapMap, typename CutMap>
    86 typename CapMap::Value 
     86typename CapMap::Value
    8787  cutValue(const Graph& graph, const CapMap& cap, const CutMap& cut)
    8888{
     
    111111    ho.run();
    112112    ho.minCutMap(cut);
    113    
     113
    114114    check(ho.minCutValue() == 1, "Wrong cut value");
    115115    check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value");
     
    127127    ho.run();
    128128    ho.minCutMap(cut);
    129    
     129
    130130    check(ho.minCutValue() == 1, "Wrong cut value");
    131131    check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value");
    132132  }
    133  
     133
    134134  typedef Undirector<SmartDigraph> UGraph;
    135135  UGraph ugraph(graph);
    136  
     136
    137137  {
    138138    HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap1);
    139139    ho.run();
    140140    ho.minCutMap(cut);
    141    
     141
    142142    check(ho.minCutValue() == 2, "Wrong cut value");
    143143    check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value");
     
    147147    ho.run();
    148148    ho.minCutMap(cut);
    149    
     149
    150150    check(ho.minCutValue() == 5, "Wrong cut value");
    151151    check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value");
     
    155155    ho.run();
    156156    ho.minCutMap(cut);
    157    
     157
    158158    check(ho.minCutValue() == 5, "Wrong cut value");
    159159    check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value");
  • test/heap_test.cc

    r1064 r1081  
    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).
  • test/lgf_test.cc

    r1067 r1078  
    6464
    6565
    66 int main() 
     66int main()
    6767{
    6868  {
    69     ListDigraph d; 
     69    ListDigraph d;
    7070    ListDigraph::Node s,t;
    7171    ListDigraph::ArcMap<int> label(d);
     
    9494
    9595  {
    96     ListDigraph d; 
     96    ListDigraph d;
    9797    std::istringstream input(test_lgf_nomap);
    9898    digraphReader(d, input).
     
    111111
    112112  {
    113     ListDigraph d; 
     113    ListDigraph d;
    114114    std::istringstream input(test_lgf_bad1);
    115115    bool ok=false;
     
    118118        run();
    119119    }
    120     catch (FormatError& error) 
     120    catch (FormatError& error)
    121121      {
    122122        ok = true;
     
    140140
    141141  {
    142     ListDigraph d; 
     142    ListDigraph d;
    143143    std::istringstream input(test_lgf_bad2);
    144144    bool ok=false;
  • test/maps_test.cc

    r731 r1081  
    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).
     
    7171  checkConcept<ReadWriteMap<A,B>, ReadWriteMap<A,B> >();
    7272  checkConcept<ReadWriteMap<A,C>, ReadWriteMap<A,C> >();
    73   checkConcept<ReferenceMap<A,B,B&,const B&>, ReferenceMap<A,B,B&,const B&> >();
    74   checkConcept<ReferenceMap<A,C,C&,const C&>, ReferenceMap<A,C,C&,const C&> >();
     73  checkConcept<ReferenceMap<A,B,B&,const B&>,
     74               ReferenceMap<A,B,B&,const B&> >();
     75  checkConcept<ReferenceMap<A,C,C&,const C&>,
     76               ReferenceMap<A,C,C&,const C&> >();
    7577
    7678  // NullMap
     
    201203
    202204    checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >();
    203     MapToFunctor<ReadMap<A,B> > map = MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
     205    MapToFunctor<ReadMap<A,B> > map =
     206      MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
    204207
    205208    check(functorToMap(&func)[A()] == 3,
     
    350353      check(v1[i++] == *it, "Something is wrong with LoggerBoolMap");
    351354  }
    352  
     355
    353356  // CrossRefMap
    354357  {
     
    358361    checkConcept<ReadWriteMap<Node, int>,
    359362                 CrossRefMap<Graph, Node, int> >();
    360    
     363
    361364    Graph gr;
    362365    typedef CrossRefMap<Graph, Node, char> CRMap;
    363366    typedef CRMap::ValueIterator ValueIt;
    364367    CRMap map(gr);
    365    
     368
    366369    Node n0 = gr.addNode();
    367370    Node n1 = gr.addNode();
    368371    Node n2 = gr.addNode();
    369    
     372
    370373    map.set(n0, 'A');
    371374    map.set(n1, 'B');
  • test/matching_test.cc

    r641 r1081  
    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  const MaxMatching<Graph>::StatusMap& smap =
     
    171171  mat_test.start();
    172172  mat_test.run();
    173  
     173
    174174  const_mat_test.matchingWeight();
    175175  const_mat_test.matchingSize();
     
    180180  e = mmap[n];
    181181  const_mat_test.mate(n);
    182  
     182
    183183  int k = 0;
    184184  const_mat_test.dualValue();
     
    208208  mat_test.start();
    209209  mat_test.run();
    210  
     210
    211211  const_mat_test.matchingWeight();
    212212  const_mat_test.matching(e);
     
    216216  e = mmap[n];
    217217  const_mat_test.mate(n);
    218  
     218
    219219  int k = 0;
    220220  const_mat_test.dualValue();
  • test/min_cost_arborescence_test.cc

    r672 r1081  
    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).
     
    111111  b = const_mcarb_test.emptyQueue();
    112112  i = const_mcarb_test.queueSize();
    113  
     113
    114114  c = const_mcarb_test.arborescenceCost();
    115115  b = const_mcarb_test.arborescence(e);
     
    121121  b = const_mcarb_test.reached(n);
    122122  b = const_mcarb_test.processed(n);
    123  
     123
    124124  i = const_mcarb_test.dualNum();
    125125  c = const_mcarb_test.dualValue();
    126126  i = const_mcarb_test.dualSize(i);
    127127  c = const_mcarb_test.dualValue(i);
    128  
     128
    129129  ignore_unused_variable_warning(am);
    130130  ignore_unused_variable_warning(pm);
  • test/min_cost_flow_test.cc

    r716 r1081  
    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).
     
    4848  "   11     0    0    0    0  -10    0\n"
    4949  "   12   -20  -27    0  -30  -30  -20\n"
    50   "\n"               
     50  "\n"
    5151  "@arcs\n"
    5252  "       cost  cap low1 low2 low3\n"
     
    9494    void constraints() {
    9595      checkConcept<concepts::Digraph, GR>();
    96      
     96
    9797      const Constraints& me = *this;
    9898
     
    123123    typedef concepts::WriteMap<Arc, Value> FlowMap;
    124124    typedef concepts::WriteMap<Node, Cost> PotMap;
    125  
     125
    126126    GR g;
    127127    VAM lower;
     
    177177           typename CM, typename SM, typename FM, typename PM >
    178178bool checkPotential( const GR& gr, const LM& lower, const UM& upper,
    179                      const CM& cost, const SM& supply, const FM& flow, 
     179                     const CM& cost, const SM& supply, const FM& flow,
    180180                     const PM& pi, SupplyType type )
    181181{
     
    190190          (red_cost < 0 && flow[e] == upper[e]);
    191191  }
    192  
     192
    193193  for (NodeIt n(gr); opt && n != INVALID; ++n) {
    194194    typename SM::Value sum = 0;
     
    203203    }
    204204  }
    205  
     205
    206206  return opt;
    207207}
     
    228228    }
    229229  }
    230  
     230
    231231  for (NodeIt n(gr); n != INVALID; ++n) {
    232232    dual_cost -= red_supply[n] * pi[n];
     
    237237    dual_cost -= (upper[a] - lower[a]) * std::max(-red_cost, 0);
    238238  }
    239  
     239
    240240  return dual_cost == total;
    241241}
     
    309309    .node("target", w)
    310310    .run();
    311  
     311
    312312  // Build test digraphs with negative costs
    313313  Digraph neg_gr;
     
    319319  Node n6 = neg_gr.addNode();
    320320  Node n7 = neg_gr.addNode();
    321  
     321
    322322  Arc a1 = neg_gr.addArc(n1, n2);
    323323  Arc a2 = neg_gr.addArc(n1, n3);
     
    329329  Arc a8 = neg_gr.addArc(n6, n7);
    330330  Arc a9 = neg_gr.addArc(n7, n5);
    331  
     331
    332332  Digraph::ArcMap<int> neg_c(neg_gr), neg_l1(neg_gr, 0), neg_l2(neg_gr, 0);
    333333  ConstMap<Arc, int> neg_u1(std::numeric_limits<int>::max()), neg_u2(5000);
    334334  Digraph::NodeMap<int> neg_s(neg_gr, 0);
    335  
     335
    336336  neg_l2[a7] =  1000;
    337337  neg_l2[a8] = -1000;
    338  
     338
    339339  neg_s[n1] =  100;
    340340  neg_s[n4] = -100;
    341  
     341
    342342  neg_c[a1] =  100;
    343343  neg_c[a2] =   30;
     
    423423    checkMcf(neg_mcf, neg_mcf.run(), neg_gr, neg_l2, neg_u1,
    424424      neg_c, neg_s, neg_mcf.UNBOUNDED, false,    0, "#A18");
    425      
     425
    426426    NetworkSimplex<Digraph> negs_mcf(negs_gr);
    427427    negs_mcf.costMap(negs_c).supplyMap(negs_s);
  • test/preflow_test.cc

    r1027 r1081  
    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).
     
    114114  b = const_preflow_test.minCut(n);
    115115  const_preflow_test.minCutMap(cut);
    116  
     116
    117117  ignore_unused_variable_warning(fm);
    118118}
     
    155155{
    156156  DIGRAPH_TYPEDEFS(SmartDigraph);
    157  
     157
    158158  SmartDigraph g;
    159159  SmartDigraph::ArcMap<int> cap(g),iflow(g);
     
    267267
    268268  initFlowTest();
    269  
     269
    270270  return 0;
    271271}
  • test/suurballe_test.cc

    r670 r1081  
    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;
     
    117117  k = const_suurb_test.pathNum();
    118118  Path<Digraph> p = const_suurb_test.path(k);
    119  
     119
    120120  ignore_unused_variable_warning(fm);
    121121  ignore_unused_variable_warning(pm);
Note: See TracChangeset for help on using the changeset viewer.