Merge bugfix #474 to branch 1.3 1.3
authorAlpar Juttner <alpar@cs.elte.hu>
Mon, 07 Jul 2014 15:58:07 +0200
branch1.3
changeset 131911de70cf8550
parent 1316 d9e802637310
parent 1318 ce1533650f7d
child 1320 bdabbf66b2ad
Merge bugfix #474 to branch 1.3
     1.1 --- a/lemon/network_simplex.h	Mon Jul 07 11:57:45 2014 +0200
     1.2 +++ b/lemon/network_simplex.h	Mon Jul 07 15:58:07 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:57:45 2014 +0200
     2.2 +++ b/test/min_cost_flow_test.cc	Mon Jul 07 15:58:07 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 >