Merge bugfix #474
authorAlpar Juttner <alpar@cs.elte.hu>
Mon, 07 Jul 2014 15:40:12 +0200
changeset 1318ce1533650f7d
parent 1315 07cd9a2d20e0
parent 1317 b40c2bbb8da5
child 1319 11de70cf8550
child 1322 1552352f9798
Merge bugfix #474
lemon/network_simplex.h
test/min_cost_flow_test.cc
     1.1 --- a/lemon/network_simplex.h	Mon Jul 07 11:23:41 2014 +0200
     1.2 +++ b/lemon/network_simplex.h	Mon Jul 07 15:40:12 2014 +0200
     1.3 @@ -936,7 +936,7 @@
     1.4        for (NodeIt n(_graph); n != INVALID; ++n, ++i) {
     1.5          _node_id[n] = i;
     1.6        }
     1.7 -      if (_arc_mixing) {
     1.8 +      if (_arc_mixing && _node_num > 1) {
     1.9          // Store the arcs in a mixed order
    1.10          const int skip = std::max(_arc_num / _node_num, 3);
    1.11          int i = 0, j = 0;
     2.1 --- a/test/min_cost_flow_test.cc	Mon Jul 07 11:23:41 2014 +0200
     2.2 +++ b/test/min_cost_flow_test.cc	Mon Jul 07 15:40:12 2014 +0200
     2.3 @@ -395,6 +395,12 @@
     2.4    mcf3.upperMap(neg2_u);
     2.5    checkMcf(mcf3, mcf3.run(param), neg2_gr, neg2_l, neg2_u, neg2_c, neg2_s,
     2.6             mcf3.OPTIMAL, true,     -300, test_str + "-18", GEQ);
     2.7 +
     2.8 +  // Tests for empty graph
     2.9 +  Digraph gr0;
    2.10 +  MCF mcf0(gr0);
    2.11 +  mcf0.run(param);
    2.12 +  check(mcf0.totalCost() == 0, "Wrong total cost");  
    2.13  }
    2.14  
    2.15  template < typename MCF, typename Param >