1.1 --- a/lemon/nagamochi_ibaraki.h Fri Aug 09 14:07:27 2013 +0200
1.2 +++ b/lemon/nagamochi_ibaraki.h Fri Aug 09 11:28:17 2013 +0200
1.3 @@ -2,7 +2,7 @@
1.4 *
1.5 * This file is a part of LEMON, a generic C++ optimization library.
1.6 *
1.7 - * Copyright (C) 2003-2010
1.8 + * Copyright (C) 2003-2013
1.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
1.11 *
1.12 @@ -303,8 +303,8 @@
1.13 protected:
1.14 //This is here to avoid a gcc-3.3 compilation error.
1.15 //It should never be called.
1.16 - NagamochiIbaraki() {}
1.17 -
1.18 + NagamochiIbaraki() {}
1.19 +
1.20 public:
1.21
1.22 typedef NagamochiIbaraki Create;
1.23 @@ -414,18 +414,18 @@
1.24 for (typename Graph::NodeIt n(_graph); n != INVALID; ++n) {
1.25 for (typename Graph::OutArcIt a(_graph, n); a != INVALID; ++a) {
1.26 typename Graph::Node m = _graph.target(a);
1.27 -
1.28 +
1.29 if (!(n < m)) continue;
1.30
1.31 (*_nodes)[n].sum += (*_capacity)[a];
1.32 (*_nodes)[m].sum += (*_capacity)[a];
1.33 -
1.34 +
1.35 int c = (*_nodes)[m].curr_arc;
1.36 if (c != -1 && _arcs[c ^ 1].target == n) {
1.37 _edges[c >> 1].capacity += (*_capacity)[a];
1.38 } else {
1.39 _edges[index].capacity = (*_capacity)[a];
1.40 -
1.41 +
1.42 _arcs[index << 1].prev = -1;
1.43 if ((*_nodes)[n].first_arc != -1) {
1.44 _arcs[(*_nodes)[n].first_arc].prev = (index << 1);
1.45 @@ -435,7 +435,7 @@
1.46 _arcs[index << 1].target = m;
1.47
1.48 (*_nodes)[m].curr_arc = (index << 1);
1.49 -
1.50 +
1.51 _arcs[(index << 1) | 1].prev = -1;
1.52 if ((*_nodes)[m].first_arc != -1) {
1.53 _arcs[(*_nodes)[m].first_arc].prev = ((index << 1) | 1);
1.54 @@ -443,7 +443,7 @@
1.55 _arcs[(index << 1) | 1].next = (*_nodes)[m].first_arc;
1.56 (*_nodes)[m].first_arc = ((index << 1) | 1);
1.57 _arcs[(index << 1) | 1].target = n;
1.58 -
1.59 +
1.60 ++index;
1.61 }
1.62 }
1.63 @@ -452,7 +452,7 @@
1.64 typename Graph::Node cut_node = INVALID;
1.65 _min_cut = std::numeric_limits<Value>::max();
1.66
1.67 - for (typename Graph::Node n = _first_node;
1.68 + for (typename Graph::Node n = _first_node;
1.69 n != INVALID; n = (*_nodes)[n].next) {
1.70 if ((*_nodes)[n].sum < _min_cut) {
1.71 cut_node = n;
1.72 @@ -477,7 +477,7 @@
1.73 if (_first_node == INVALID) return true;
1.74
1.75 _heap->clear();
1.76 - for (typename Graph::Node n = _first_node;
1.77 + for (typename Graph::Node n = _first_node;
1.78 n != INVALID; n = (*_nodes)[n].next) {
1.79 (*_heap_cross_ref)[n] = Heap::PRE_HEAP;
1.80 }
1.81 @@ -497,7 +497,7 @@
1.82 _heap->pop();
1.83 for (int a = (*_nodes)[n].first_arc; a != -1; a = _arcs[a].next) {
1.84 switch (_heap->state(_arcs[a].target)) {
1.85 - case Heap::PRE_HEAP:
1.86 + case Heap::PRE_HEAP:
1.87 {
1.88 Value nv = _edges[a >> 1].capacity;
1.89 _heap->push(_arcs[a].target, nv);
1.90 @@ -563,7 +563,7 @@
1.91 if (!(_edges[a >> 1].cut < pmc)) {
1.92 if (!merged) {
1.93 for (int b = (*_nodes)[n].first_arc; b != -1; b = _arcs[b].next) {
1.94 - (*_nodes)[_arcs[b].target].curr_arc = b;
1.95 + (*_nodes)[_arcs[b].target].curr_arc = b;
1.96 }
1.97 merged = true;
1.98 }
1.99 @@ -573,7 +573,7 @@
1.100 nb = _arcs[b].next;
1.101 if ((b ^ a) == 1) continue;
1.102 typename Graph::Node o = _arcs[b].target;
1.103 - int c = (*_nodes)[o].curr_arc;
1.104 + int c = (*_nodes)[o].curr_arc;
1.105 if (c != -1 && _arcs[c ^ 1].target == n) {
1.106 _edges[c >> 1].capacity += _edges[b >> 1].capacity;
1.107 (*_nodes)[n].sum += _edges[b >> 1].capacity;
1.108 @@ -606,7 +606,7 @@
1.109 _arcs[_arcs[a].prev].next = _arcs[a].next;
1.110 } else {
1.111 (*_nodes)[n].first_arc = _arcs[a].next;
1.112 - }
1.113 + }
1.114 if (_arcs[a].next != -1) {
1.115 _arcs[_arcs[a].next].prev = _arcs[a].prev;
1.116 }
1.117 @@ -614,7 +614,7 @@
1.118 (*_nodes)[n].sum -= _edges[a >> 1].capacity;
1.119 (*_next_rep)[(*_nodes)[n].last_rep] = m;
1.120 (*_nodes)[n].last_rep = (*_nodes)[m].last_rep;
1.121 -
1.122 +
1.123 if ((*_nodes)[m].prev != INVALID) {
1.124 (*_nodes)[(*_nodes)[m].prev].next = (*_nodes)[m].next;
1.125 } else{