1.1 --- a/lemon/circulation.h Tue Apr 14 10:34:12 2009 +0200
1.2 +++ b/lemon/circulation.h Tue Apr 14 10:35:38 2009 +0200
1.3 @@ -453,13 +453,13 @@
1.4 createStructures();
1.5
1.6 for(NodeIt n(_g);n!=INVALID;++n) {
1.7 - _excess->set(n, (*_delta)[n]);
1.8 + (*_excess)[n] = (*_delta)[n];
1.9 }
1.10
1.11 for (ArcIt e(_g);e!=INVALID;++e) {
1.12 _flow->set(e, (*_lo)[e]);
1.13 - _excess->set(_g.target(e), (*_excess)[_g.target(e)] + (*_flow)[e]);
1.14 - _excess->set(_g.source(e), (*_excess)[_g.source(e)] - (*_flow)[e]);
1.15 + (*_excess)[_g.target(e)] += (*_flow)[e];
1.16 + (*_excess)[_g.source(e)] -= (*_flow)[e];
1.17 }
1.18
1.19 // global relabeling tested, but in general case it provides
1.20 @@ -482,23 +482,23 @@
1.21 createStructures();
1.22
1.23 for(NodeIt n(_g);n!=INVALID;++n) {
1.24 - _excess->set(n, (*_delta)[n]);
1.25 + (*_excess)[n] = (*_delta)[n];
1.26 }
1.27
1.28 for (ArcIt e(_g);e!=INVALID;++e) {
1.29 if (!_tol.positive((*_excess)[_g.target(e)] + (*_up)[e])) {
1.30 _flow->set(e, (*_up)[e]);
1.31 - _excess->set(_g.target(e), (*_excess)[_g.target(e)] + (*_up)[e]);
1.32 - _excess->set(_g.source(e), (*_excess)[_g.source(e)] - (*_up)[e]);
1.33 + (*_excess)[_g.target(e)] += (*_up)[e];
1.34 + (*_excess)[_g.source(e)] -= (*_up)[e];
1.35 } else if (_tol.positive((*_excess)[_g.target(e)] + (*_lo)[e])) {
1.36 _flow->set(e, (*_lo)[e]);
1.37 - _excess->set(_g.target(e), (*_excess)[_g.target(e)] + (*_lo)[e]);
1.38 - _excess->set(_g.source(e), (*_excess)[_g.source(e)] - (*_lo)[e]);
1.39 + (*_excess)[_g.target(e)] += (*_lo)[e];
1.40 + (*_excess)[_g.source(e)] -= (*_lo)[e];
1.41 } else {
1.42 Value fc = -(*_excess)[_g.target(e)];
1.43 _flow->set(e, fc);
1.44 - _excess->set(_g.target(e), 0);
1.45 - _excess->set(_g.source(e), (*_excess)[_g.source(e)] - fc);
1.46 + (*_excess)[_g.target(e)] = 0;
1.47 + (*_excess)[_g.source(e)] -= fc;
1.48 }
1.49 }
1.50
1.51 @@ -537,16 +537,16 @@
1.52 if((*_level)[v]<actlevel) {
1.53 if(!_tol.less(fc, exc)) {
1.54 _flow->set(e, (*_flow)[e] + exc);
1.55 - _excess->set(v, (*_excess)[v] + exc);
1.56 + (*_excess)[v] += exc;
1.57 if(!_level->active(v) && _tol.positive((*_excess)[v]))
1.58 _level->activate(v);
1.59 - _excess->set(act,0);
1.60 + (*_excess)[act] = 0;
1.61 _level->deactivate(act);
1.62 goto next_l;
1.63 }
1.64 else {
1.65 _flow->set(e, (*_up)[e]);
1.66 - _excess->set(v, (*_excess)[v] + fc);
1.67 + (*_excess)[v] += fc;
1.68 if(!_level->active(v) && _tol.positive((*_excess)[v]))
1.69 _level->activate(v);
1.70 exc-=fc;
1.71 @@ -561,16 +561,16 @@
1.72 if((*_level)[v]<actlevel) {
1.73 if(!_tol.less(fc, exc)) {
1.74 _flow->set(e, (*_flow)[e] - exc);
1.75 - _excess->set(v, (*_excess)[v] + exc);
1.76 + (*_excess)[v] += exc;
1.77 if(!_level->active(v) && _tol.positive((*_excess)[v]))
1.78 _level->activate(v);
1.79 - _excess->set(act,0);
1.80 + (*_excess)[act] = 0;
1.81 _level->deactivate(act);
1.82 goto next_l;
1.83 }
1.84 else {
1.85 _flow->set(e, (*_lo)[e]);
1.86 - _excess->set(v, (*_excess)[v] + fc);
1.87 + (*_excess)[v] += fc;
1.88 if(!_level->active(v) && _tol.positive((*_excess)[v]))
1.89 _level->activate(v);
1.90 exc-=fc;
1.91 @@ -579,7 +579,7 @@
1.92 else if((*_level)[v]<mlevel) mlevel=(*_level)[v];
1.93 }
1.94
1.95 - _excess->set(act, exc);
1.96 + (*_excess)[act] = exc;
1.97 if(!_tol.positive(exc)) _level->deactivate(act);
1.98 else if(mlevel==_node_num) {
1.99 _level->liftHighestActiveToTop();
2.1 --- a/lemon/core.h Tue Apr 14 10:34:12 2009 +0200
2.2 +++ b/lemon/core.h Tue Apr 14 10:35:38 2009 +0200
2.3 @@ -1315,27 +1315,27 @@
2.4
2.5 virtual void clear() {
2.6 for(NodeIt n(_g);n!=INVALID;++n) {
2.7 - _head.set(n, INVALID);
2.8 + _head[n] = INVALID;
2.9 }
2.10 }
2.11
2.12 void insert(Arc arc) {
2.13 Node s = _g.source(arc);
2.14 Node t = _g.target(arc);
2.15 - _left.set(arc, INVALID);
2.16 - _right.set(arc, INVALID);
2.17 + _left[arc] = INVALID;
2.18 + _right[arc] = INVALID;
2.19
2.20 Arc e = _head[s];
2.21 if (e == INVALID) {
2.22 - _head.set(s, arc);
2.23 - _parent.set(arc, INVALID);
2.24 + _head[s] = arc;
2.25 + _parent[arc] = INVALID;
2.26 return;
2.27 }
2.28 while (true) {
2.29 if (t < _g.target(e)) {
2.30 if (_left[e] == INVALID) {
2.31 - _left.set(e, arc);
2.32 - _parent.set(arc, e);
2.33 + _left[e] = arc;
2.34 + _parent[arc] = e;
2.35 splay(arc);
2.36 return;
2.37 } else {
2.38 @@ -1343,8 +1343,8 @@
2.39 }
2.40 } else {
2.41 if (_right[e] == INVALID) {
2.42 - _right.set(e, arc);
2.43 - _parent.set(arc, e);
2.44 + _right[e] = arc;
2.45 + _parent[arc] = e;
2.46 splay(arc);
2.47 return;
2.48 } else {
2.49 @@ -1357,27 +1357,27 @@
2.50 void remove(Arc arc) {
2.51 if (_left[arc] == INVALID) {
2.52 if (_right[arc] != INVALID) {
2.53 - _parent.set(_right[arc], _parent[arc]);
2.54 + _parent[_right[arc]] = _parent[arc];
2.55 }
2.56 if (_parent[arc] != INVALID) {
2.57 if (_left[_parent[arc]] == arc) {
2.58 - _left.set(_parent[arc], _right[arc]);
2.59 + _left[_parent[arc]] = _right[arc];
2.60 } else {
2.61 - _right.set(_parent[arc], _right[arc]);
2.62 + _right[_parent[arc]] = _right[arc];
2.63 }
2.64 } else {
2.65 - _head.set(_g.source(arc), _right[arc]);
2.66 + _head[_g.source(arc)] = _right[arc];
2.67 }
2.68 } else if (_right[arc] == INVALID) {
2.69 - _parent.set(_left[arc], _parent[arc]);
2.70 + _parent[_left[arc]] = _parent[arc];
2.71 if (_parent[arc] != INVALID) {
2.72 if (_left[_parent[arc]] == arc) {
2.73 - _left.set(_parent[arc], _left[arc]);
2.74 + _left[_parent[arc]] = _left[arc];
2.75 } else {
2.76 - _right.set(_parent[arc], _left[arc]);
2.77 + _right[_parent[arc]] = _left[arc];
2.78 }
2.79 } else {
2.80 - _head.set(_g.source(arc), _left[arc]);
2.81 + _head[_g.source(arc)] = _left[arc];
2.82 }
2.83 } else {
2.84 Arc e = _left[arc];
2.85 @@ -1387,38 +1387,38 @@
2.86 e = _right[e];
2.87 }
2.88 Arc s = _parent[e];
2.89 - _right.set(_parent[e], _left[e]);
2.90 + _right[_parent[e]] = _left[e];
2.91 if (_left[e] != INVALID) {
2.92 - _parent.set(_left[e], _parent[e]);
2.93 + _parent[_left[e]] = _parent[e];
2.94 }
2.95
2.96 - _left.set(e, _left[arc]);
2.97 - _parent.set(_left[arc], e);
2.98 - _right.set(e, _right[arc]);
2.99 - _parent.set(_right[arc], e);
2.100 + _left[e] = _left[arc];
2.101 + _parent[_left[arc]] = e;
2.102 + _right[e] = _right[arc];
2.103 + _parent[_right[arc]] = e;
2.104
2.105 - _parent.set(e, _parent[arc]);
2.106 + _parent[e] = _parent[arc];
2.107 if (_parent[arc] != INVALID) {
2.108 if (_left[_parent[arc]] == arc) {
2.109 - _left.set(_parent[arc], e);
2.110 + _left[_parent[arc]] = e;
2.111 } else {
2.112 - _right.set(_parent[arc], e);
2.113 + _right[_parent[arc]] = e;
2.114 }
2.115 }
2.116 splay(s);
2.117 } else {
2.118 - _right.set(e, _right[arc]);
2.119 - _parent.set(_right[arc], e);
2.120 - _parent.set(e, _parent[arc]);
2.121 + _right[e] = _right[arc];
2.122 + _parent[_right[arc]] = e;
2.123 + _parent[e] = _parent[arc];
2.124
2.125 if (_parent[arc] != INVALID) {
2.126 if (_left[_parent[arc]] == arc) {
2.127 - _left.set(_parent[arc], e);
2.128 + _left[_parent[arc]] = e;
2.129 } else {
2.130 - _right.set(_parent[arc], e);
2.131 + _right[_parent[arc]] = e;
2.132 }
2.133 } else {
2.134 - _head.set(_g.source(arc), e);
2.135 + _head[_g.source(arc)] = e;
2.136 }
2.137 }
2.138 }
2.139 @@ -1430,17 +1430,17 @@
2.140 Arc me=v[m];
2.141 if (a < m) {
2.142 Arc left = refreshRec(v,a,m-1);
2.143 - _left.set(me, left);
2.144 - _parent.set(left, me);
2.145 + _left[me] = left;
2.146 + _parent[left] = me;
2.147 } else {
2.148 - _left.set(me, INVALID);
2.149 + _left[me] = INVALID;
2.150 }
2.151 if (m < b) {
2.152 Arc right = refreshRec(v,m+1,b);
2.153 - _right.set(me, right);
2.154 - _parent.set(right, me);
2.155 + _right[me] = right;
2.156 + _parent[right] = me;
2.157 } else {
2.158 - _right.set(me, INVALID);
2.159 + _right[me] = INVALID;
2.160 }
2.161 return me;
2.162 }
2.163 @@ -1452,46 +1452,46 @@
2.164 if (!v.empty()) {
2.165 std::sort(v.begin(),v.end(),ArcLess(_g));
2.166 Arc head = refreshRec(v,0,v.size()-1);
2.167 - _head.set(n, head);
2.168 - _parent.set(head, INVALID);
2.169 + _head[n] = head;
2.170 + _parent[head] = INVALID;
2.171 }
2.172 - else _head.set(n, INVALID);
2.173 + else _head[n] = INVALID;
2.174 }
2.175 }
2.176
2.177 void zig(Arc v) {
2.178 Arc w = _parent[v];
2.179 - _parent.set(v, _parent[w]);
2.180 - _parent.set(w, v);
2.181 - _left.set(w, _right[v]);
2.182 - _right.set(v, w);
2.183 + _parent[v] = _parent[w];
2.184 + _parent[w] = v;
2.185 + _left[w] = _right[v];
2.186 + _right[v] = w;
2.187 if (_parent[v] != INVALID) {
2.188 if (_right[_parent[v]] == w) {
2.189 - _right.set(_parent[v], v);
2.190 + _right[_parent[v]] = v;
2.191 } else {
2.192 - _left.set(_parent[v], v);
2.193 + _left[_parent[v]] = v;
2.194 }
2.195 }
2.196 if (_left[w] != INVALID){
2.197 - _parent.set(_left[w], w);
2.198 + _parent[_left[w]] = w;
2.199 }
2.200 }
2.201
2.202 void zag(Arc v) {
2.203 Arc w = _parent[v];
2.204 - _parent.set(v, _parent[w]);
2.205 - _parent.set(w, v);
2.206 - _right.set(w, _left[v]);
2.207 - _left.set(v, w);
2.208 + _parent[v] = _parent[w];
2.209 + _parent[w] = v;
2.210 + _right[w] = _left[v];
2.211 + _left[v] = w;
2.212 if (_parent[v] != INVALID){
2.213 if (_left[_parent[v]] == w) {
2.214 - _left.set(_parent[v], v);
2.215 + _left[_parent[v]] = v;
2.216 } else {
2.217 - _right.set(_parent[v], v);
2.218 + _right[_parent[v]] = v;
2.219 }
2.220 }
2.221 if (_right[w] != INVALID){
2.222 - _parent.set(_right[w], w);
2.223 + _parent[_right[w]] = w;
2.224 }
2.225 }
2.226
3.1 --- a/lemon/elevator.h Tue Apr 14 10:34:12 2009 +0200
3.2 +++ b/lemon/elevator.h Tue Apr 14 10:35:38 2009 +0200
3.3 @@ -76,7 +76,7 @@
3.4
3.5 void copy(Item i, Vit p)
3.6 {
3.7 - _where.set(*p=i,p);
3.8 + _where[*p=i] = p;
3.9 }
3.10 void copy(Vit s, Vit p)
3.11 {
3.12 @@ -84,15 +84,15 @@
3.13 {
3.14 Item i=*s;
3.15 *p=i;
3.16 - _where.set(i,p);
3.17 + _where[i] = p;
3.18 }
3.19 }
3.20 void swap(Vit i, Vit j)
3.21 {
3.22 Item ti=*i;
3.23 Vit ct = _where[ti];
3.24 - _where.set(ti,_where[*i=*j]);
3.25 - _where.set(*j,ct);
3.26 + _where[ti] = _where[*i=*j];
3.27 + _where[*j] = ct;
3.28 *j=ti;
3.29 }
3.30
3.31 @@ -226,7 +226,7 @@
3.32 void liftHighestActive()
3.33 {
3.34 Item it = *_last_active[_highest_active];
3.35 - _level.set(it,_level[it]+1);
3.36 + ++_level[it];
3.37 swap(_last_active[_highest_active]--,_last_active[_highest_active+1]);
3.38 --_first[++_highest_active];
3.39 }
3.40 @@ -249,7 +249,7 @@
3.41 --_last_active[l];
3.42 }
3.43 copy(li,_first[new_level]);
3.44 - _level.set(li,new_level);
3.45 + _level[li] = new_level;
3.46 _highest_active=new_level;
3.47 }
3.48
3.49 @@ -269,7 +269,7 @@
3.50 }
3.51 copy(li,_first[_max_level]);
3.52 --_last_active[_max_level];
3.53 - _level.set(li,_max_level);
3.54 + _level[li] = _max_level;
3.55
3.56 while(_highest_active>=0 &&
3.57 _last_active[_highest_active]<_first[_highest_active])
3.58 @@ -299,7 +299,7 @@
3.59 Item liftActiveOn(int level)
3.60 {
3.61 Item it =*_last_active[level];
3.62 - _level.set(it,_level[it]+1);
3.63 + ++_level[it];
3.64 swap(_last_active[level]--, --_first[level+1]);
3.65 if (level+1>_highest_active) ++_highest_active;
3.66 }
3.67 @@ -319,7 +319,7 @@
3.68 copy(--_first[l+1], _last_active[l]--);
3.69 }
3.70 copy(ai,_first[new_level]);
3.71 - _level.set(ai,new_level);
3.72 + _level[ai] = new_level;
3.73 if (new_level>_highest_active) _highest_active=new_level;
3.74 }
3.75
3.76 @@ -339,7 +339,7 @@
3.77 }
3.78 copy(ai,_first[_max_level]);
3.79 --_last_active[_max_level];
3.80 - _level.set(ai,_max_level);
3.81 + _level[ai] = _max_level;
3.82
3.83 if (_highest_active==level) {
3.84 while(_highest_active>=0 &&
3.85 @@ -370,7 +370,7 @@
3.86 copy(--_first[l+1],_last_active[l]--);
3.87 }
3.88 copy(i,_first[new_level]);
3.89 - _level.set(i,new_level);
3.90 + _level[i] = new_level;
3.91 if(new_level>_highest_active) _highest_active=new_level;
3.92 }
3.93
3.94 @@ -382,7 +382,7 @@
3.95 ///only if you really know what it is for.
3.96 ///\pre The item is on the top level.
3.97 void dirtyTopButOne(Item i) {
3.98 - _level.set(i,_max_level - 1);
3.99 + _level[i] = _max_level - 1;
3.100 }
3.101
3.102 ///Lift all items on and above the given level to the top level.
3.103 @@ -394,7 +394,7 @@
3.104 const Vit f=_first[l];
3.105 const Vit tl=_first[_max_level];
3.106 for(Vit i=f;i!=tl;++i)
3.107 - _level.set(*i,_max_level);
3.108 + _level[*i] = _max_level;
3.109 for(int i=l;i<=_max_level;i++)
3.110 {
3.111 _first[i]=f;
3.112 @@ -433,8 +433,8 @@
3.113 for(typename ItemSetTraits<GR,Item>::ItemIt i(_g);i!=INVALID;++i)
3.114 {
3.115 *n=i;
3.116 - _where.set(i,n);
3.117 - _level.set(i,_max_level);
3.118 + _where[i] = n;
3.119 + _level[i] = _max_level;
3.120 ++n;
3.121 }
3.122 }
3.123 @@ -443,7 +443,7 @@
3.124 void initAddItem(Item i)
3.125 {
3.126 swap(_where[i],_init_num);
3.127 - _level.set(i,_init_lev);
3.128 + _level[i] = _init_lev;
3.129 ++_init_num;
3.130 }
3.131
3.132 @@ -551,7 +551,7 @@
3.133 ///Activate item \c i.
3.134 ///\pre Item \c i shouldn't be active before.
3.135 void activate(Item i) {
3.136 - _active.set(i, true);
3.137 + _active[i] = true;
3.138
3.139 int level = _level[i];
3.140 if (level > _highest_active) {
3.141 @@ -560,16 +560,16 @@
3.142
3.143 if (_prev[i] == INVALID || _active[_prev[i]]) return;
3.144 //unlace
3.145 - _next.set(_prev[i], _next[i]);
3.146 + _next[_prev[i]] = _next[i];
3.147 if (_next[i] != INVALID) {
3.148 - _prev.set(_next[i], _prev[i]);
3.149 + _prev[_next[i]] = _prev[i];
3.150 } else {
3.151 _last[level] = _prev[i];
3.152 }
3.153 //lace
3.154 - _next.set(i, _first[level]);
3.155 - _prev.set(_first[level], i);
3.156 - _prev.set(i, INVALID);
3.157 + _next[i] = _first[level];
3.158 + _prev[_first[level]] = i;
3.159 + _prev[i] = INVALID;
3.160 _first[level] = i;
3.161
3.162 }
3.163 @@ -579,23 +579,23 @@
3.164 ///Deactivate item \c i.
3.165 ///\pre Item \c i must be active before.
3.166 void deactivate(Item i) {
3.167 - _active.set(i, false);
3.168 + _active[i] = false;
3.169 int level = _level[i];
3.170
3.171 if (_next[i] == INVALID || !_active[_next[i]])
3.172 goto find_highest_level;
3.173
3.174 //unlace
3.175 - _prev.set(_next[i], _prev[i]);
3.176 + _prev[_next[i]] = _prev[i];
3.177 if (_prev[i] != INVALID) {
3.178 - _next.set(_prev[i], _next[i]);
3.179 + _next[_prev[i]] = _next[i];
3.180 } else {
3.181 _first[_level[i]] = _next[i];
3.182 }
3.183 //lace
3.184 - _prev.set(i, _last[level]);
3.185 - _next.set(_last[level], i);
3.186 - _next.set(i, INVALID);
3.187 + _prev[i] = _last[level];
3.188 + _next[_last[level]] = i;
3.189 + _next[i] = INVALID;
3.190 _last[level] = i;
3.191
3.192 find_highest_level:
3.193 @@ -685,21 +685,21 @@
3.194 void liftHighestActive() {
3.195 Item i = _first[_highest_active];
3.196 if (_next[i] != INVALID) {
3.197 - _prev.set(_next[i], INVALID);
3.198 + _prev[_next[i]] = INVALID;
3.199 _first[_highest_active] = _next[i];
3.200 } else {
3.201 _first[_highest_active] = INVALID;
3.202 _last[_highest_active] = INVALID;
3.203 }
3.204 - _level.set(i, ++_highest_active);
3.205 + _level[i] = ++_highest_active;
3.206 if (_first[_highest_active] == INVALID) {
3.207 _first[_highest_active] = i;
3.208 _last[_highest_active] = i;
3.209 - _prev.set(i, INVALID);
3.210 - _next.set(i, INVALID);
3.211 + _prev[i] = INVALID;
3.212 + _next[i] = INVALID;
3.213 } else {
3.214 - _prev.set(_first[_highest_active], i);
3.215 - _next.set(i, _first[_highest_active]);
3.216 + _prev[_first[_highest_active]] = i;
3.217 + _next[i] = _first[_highest_active];
3.218 _first[_highest_active] = i;
3.219 }
3.220 }
3.221 @@ -714,20 +714,20 @@
3.222 void liftHighestActive(int new_level) {
3.223 Item i = _first[_highest_active];
3.224 if (_next[i] != INVALID) {
3.225 - _prev.set(_next[i], INVALID);
3.226 + _prev[_next[i]] = INVALID;
3.227 _first[_highest_active] = _next[i];
3.228 } else {
3.229 _first[_highest_active] = INVALID;
3.230 _last[_highest_active] = INVALID;
3.231 }
3.232 - _level.set(i, _highest_active = new_level);
3.233 + _level[i] = _highest_active = new_level;
3.234 if (_first[_highest_active] == INVALID) {
3.235 _first[_highest_active] = _last[_highest_active] = i;
3.236 - _prev.set(i, INVALID);
3.237 - _next.set(i, INVALID);
3.238 + _prev[i] = INVALID;
3.239 + _next[i] = INVALID;
3.240 } else {
3.241 - _prev.set(_first[_highest_active], i);
3.242 - _next.set(i, _first[_highest_active]);
3.243 + _prev[_first[_highest_active]] = i;
3.244 + _next[i] = _first[_highest_active];
3.245 _first[_highest_active] = i;
3.246 }
3.247 }
3.248 @@ -738,9 +738,9 @@
3.249 ///deactivate it.
3.250 void liftHighestActiveToTop() {
3.251 Item i = _first[_highest_active];
3.252 - _level.set(i, _max_level);
3.253 + _level[i] = _max_level;
3.254 if (_next[i] != INVALID) {
3.255 - _prev.set(_next[i], INVALID);
3.256 + _prev[_next[i]] = INVALID;
3.257 _first[_highest_active] = _next[i];
3.258 } else {
3.259 _first[_highest_active] = INVALID;
3.260 @@ -774,20 +774,20 @@
3.261 {
3.262 Item i = _first[l];
3.263 if (_next[i] != INVALID) {
3.264 - _prev.set(_next[i], INVALID);
3.265 + _prev[_next[i]] = INVALID;
3.266 _first[l] = _next[i];
3.267 } else {
3.268 _first[l] = INVALID;
3.269 _last[l] = INVALID;
3.270 }
3.271 - _level.set(i, ++l);
3.272 + _level[i] = ++l;
3.273 if (_first[l] == INVALID) {
3.274 _first[l] = _last[l] = i;
3.275 - _prev.set(i, INVALID);
3.276 - _next.set(i, INVALID);
3.277 + _prev[i] = INVALID;
3.278 + _next[i] = INVALID;
3.279 } else {
3.280 - _prev.set(_first[l], i);
3.281 - _next.set(i, _first[l]);
3.282 + _prev[_first[l]] = i;
3.283 + _next[i] = _first[l];
3.284 _first[l] = i;
3.285 }
3.286 if (_highest_active < l) {
3.287 @@ -803,20 +803,20 @@
3.288 {
3.289 Item i = _first[l];
3.290 if (_next[i] != INVALID) {
3.291 - _prev.set(_next[i], INVALID);
3.292 + _prev[_next[i]] = INVALID;
3.293 _first[l] = _next[i];
3.294 } else {
3.295 _first[l] = INVALID;
3.296 _last[l] = INVALID;
3.297 }
3.298 - _level.set(i, l = new_level);
3.299 + _level[i] = l = new_level;
3.300 if (_first[l] == INVALID) {
3.301 _first[l] = _last[l] = i;
3.302 - _prev.set(i, INVALID);
3.303 - _next.set(i, INVALID);
3.304 + _prev[i] = INVALID;
3.305 + _next[i] = INVALID;
3.306 } else {
3.307 - _prev.set(_first[l], i);
3.308 - _next.set(i, _first[l]);
3.309 + _prev[_first[l]] = i;
3.310 + _next[i] = _first[l];
3.311 _first[l] = i;
3.312 }
3.313 if (_highest_active < l) {
3.314 @@ -832,13 +832,13 @@
3.315 {
3.316 Item i = _first[l];
3.317 if (_next[i] != INVALID) {
3.318 - _prev.set(_next[i], INVALID);
3.319 + _prev[_next[i]] = INVALID;
3.320 _first[l] = _next[i];
3.321 } else {
3.322 _first[l] = INVALID;
3.323 _last[l] = INVALID;
3.324 }
3.325 - _level.set(i, _max_level);
3.326 + _level[i] = _max_level;
3.327 if (l == _highest_active) {
3.328 while (_highest_active >= 0 && activeFree(_highest_active))
3.329 --_highest_active;
3.330 @@ -856,23 +856,23 @@
3.331 ///
3.332 void lift(Item i, int new_level) {
3.333 if (_next[i] != INVALID) {
3.334 - _prev.set(_next[i], _prev[i]);
3.335 + _prev[_next[i]] = _prev[i];
3.336 } else {
3.337 _last[new_level] = _prev[i];
3.338 }
3.339 if (_prev[i] != INVALID) {
3.340 - _next.set(_prev[i], _next[i]);
3.341 + _next[_prev[i]] = _next[i];
3.342 } else {
3.343 _first[new_level] = _next[i];
3.344 }
3.345 - _level.set(i, new_level);
3.346 + _level[i] = new_level;
3.347 if (_first[new_level] == INVALID) {
3.348 _first[new_level] = _last[new_level] = i;
3.349 - _prev.set(i, INVALID);
3.350 - _next.set(i, INVALID);
3.351 + _prev[i] = INVALID;
3.352 + _next[i] = INVALID;
3.353 } else {
3.354 - _prev.set(_first[new_level], i);
3.355 - _next.set(i, _first[new_level]);
3.356 + _prev[_first[new_level]] = i;
3.357 + _next[i] = _first[new_level];
3.358 _first[new_level] = i;
3.359 }
3.360 if (_highest_active < new_level) {
3.361 @@ -888,7 +888,7 @@
3.362 ///only if you really know what it is for.
3.363 ///\pre The item is on the top level.
3.364 void dirtyTopButOne(Item i) {
3.365 - _level.set(i, _max_level - 1);
3.366 + _level[i] = _max_level - 1;
3.367 }
3.368
3.369 ///Lift all items on and above the given level to the top level.
3.370 @@ -899,7 +899,7 @@
3.371 for (int i = l + 1; _first[i] != INVALID; ++i) {
3.372 Item n = _first[i];
3.373 while (n != INVALID) {
3.374 - _level.set(n, _max_level);
3.375 + _level[n] = _max_level;
3.376 n = _next[n];
3.377 }
3.378 _first[i] = INVALID;
3.379 @@ -937,23 +937,23 @@
3.380 _init_level = 0;
3.381 for(typename ItemSetTraits<GR,Item>::ItemIt i(_graph);
3.382 i != INVALID; ++i) {
3.383 - _level.set(i, _max_level);
3.384 - _active.set(i, false);
3.385 + _level[i] = _max_level;
3.386 + _active[i] = false;
3.387 }
3.388 }
3.389
3.390 ///Add an item to the current level.
3.391 void initAddItem(Item i) {
3.392 - _level.set(i, _init_level);
3.393 + _level[i] = _init_level;
3.394 if (_last[_init_level] == INVALID) {
3.395 _first[_init_level] = i;
3.396 _last[_init_level] = i;
3.397 - _prev.set(i, INVALID);
3.398 - _next.set(i, INVALID);
3.399 + _prev[i] = INVALID;
3.400 + _next[i] = INVALID;
3.401 } else {
3.402 - _prev.set(i, _last[_init_level]);
3.403 - _next.set(i, INVALID);
3.404 - _next.set(_last[_init_level], i);
3.405 + _prev[i] = _last[_init_level];
3.406 + _next[i] = INVALID;
3.407 + _next[_last[_init_level]] = i;
3.408 _last[_init_level] = i;
3.409 }
3.410 }
4.1 --- a/lemon/gomory_hu.h Tue Apr 14 10:34:12 2009 +0200
4.2 +++ b/lemon/gomory_hu.h Tue Apr 14 10:35:38 2009 +0200
4.3 @@ -143,11 +143,11 @@
4.4
4.5 _root = NodeIt(_graph);
4.6 for (NodeIt n(_graph); n != INVALID; ++n) {
4.7 - _pred->set(n, _root);
4.8 - _order->set(n, -1);
4.9 + (*_pred)[n] = _root;
4.10 + (*_order)[n] = -1;
4.11 }
4.12 - _pred->set(_root, INVALID);
4.13 - _weight->set(_root, std::numeric_limits<Value>::max());
4.14 + (*_pred)[_root] = INVALID;
4.15 + (*_weight)[_root] = std::numeric_limits<Value>::max();
4.16 }
4.17
4.18
4.19 @@ -164,22 +164,22 @@
4.20
4.21 fa.runMinCut();
4.22
4.23 - _weight->set(n, fa.flowValue());
4.24 + (*_weight)[n] = fa.flowValue();
4.25
4.26 for (NodeIt nn(_graph); nn != INVALID; ++nn) {
4.27 if (nn != n && fa.minCut(nn) && (*_pred)[nn] == pn) {
4.28 - _pred->set(nn, n);
4.29 + (*_pred)[nn] = n;
4.30 }
4.31 }
4.32 if ((*_pred)[pn] != INVALID && fa.minCut((*_pred)[pn])) {
4.33 - _pred->set(n, (*_pred)[pn]);
4.34 - _pred->set(pn, n);
4.35 - _weight->set(n, (*_weight)[pn]);
4.36 - _weight->set(pn, fa.flowValue());
4.37 + (*_pred)[n] = (*_pred)[pn];
4.38 + (*_pred)[pn] = n;
4.39 + (*_weight)[n] = (*_weight)[pn];
4.40 + (*_weight)[pn] = fa.flowValue();
4.41 }
4.42 }
4.43
4.44 - _order->set(_root, 0);
4.45 + (*_order)[_root] = 0;
4.46 int index = 1;
4.47
4.48 for (NodeIt n(_graph); n != INVALID; ++n) {
4.49 @@ -190,7 +190,7 @@
4.50 nn = (*_pred)[nn];
4.51 }
4.52 while (!st.empty()) {
4.53 - _order->set(st.back(), index++);
4.54 + (*_order)[st.back()] = index++;
4.55 st.pop_back();
4.56 }
4.57 }
4.58 @@ -309,9 +309,9 @@
4.59 }
4.60
4.61 typename Graph::template NodeMap<bool> reached(_graph, false);
4.62 - reached.set(_root, true);
4.63 + reached[_root] = true;
4.64 cutMap.set(_root, !s_root);
4.65 - reached.set(rn, true);
4.66 + reached[rn] = true;
4.67 cutMap.set(rn, s_root);
4.68
4.69 std::vector<Node> st;
5.1 --- a/lemon/hao_orlin.h Tue Apr 14 10:34:12 2009 +0200
5.2 +++ b/lemon/hao_orlin.h Tue Apr 14 10:35:38 2009 +0200
5.3 @@ -161,56 +161,56 @@
5.4 private:
5.5
5.6 void activate(const Node& i) {
5.7 - _active->set(i, true);
5.8 + (*_active)[i] = true;
5.9
5.10 int bucket = (*_bucket)[i];
5.11
5.12 if ((*_prev)[i] == INVALID || (*_active)[(*_prev)[i]]) return;
5.13 //unlace
5.14 - _next->set((*_prev)[i], (*_next)[i]);
5.15 + (*_next)[(*_prev)[i]] = (*_next)[i];
5.16 if ((*_next)[i] != INVALID) {
5.17 - _prev->set((*_next)[i], (*_prev)[i]);
5.18 + (*_prev)[(*_next)[i]] = (*_prev)[i];
5.19 } else {
5.20 _last[bucket] = (*_prev)[i];
5.21 }
5.22 //lace
5.23 - _next->set(i, _first[bucket]);
5.24 - _prev->set(_first[bucket], i);
5.25 - _prev->set(i, INVALID);
5.26 + (*_next)[i] = _first[bucket];
5.27 + (*_prev)[_first[bucket]] = i;
5.28 + (*_prev)[i] = INVALID;
5.29 _first[bucket] = i;
5.30 }
5.31
5.32 void deactivate(const Node& i) {
5.33 - _active->set(i, false);
5.34 + (*_active)[i] = false;
5.35 int bucket = (*_bucket)[i];
5.36
5.37 if ((*_next)[i] == INVALID || !(*_active)[(*_next)[i]]) return;
5.38
5.39 //unlace
5.40 - _prev->set((*_next)[i], (*_prev)[i]);
5.41 + (*_prev)[(*_next)[i]] = (*_prev)[i];
5.42 if ((*_prev)[i] != INVALID) {
5.43 - _next->set((*_prev)[i], (*_next)[i]);
5.44 + (*_next)[(*_prev)[i]] = (*_next)[i];
5.45 } else {
5.46 _first[bucket] = (*_next)[i];
5.47 }
5.48 //lace
5.49 - _prev->set(i, _last[bucket]);
5.50 - _next->set(_last[bucket], i);
5.51 - _next->set(i, INVALID);
5.52 + (*_prev)[i] = _last[bucket];
5.53 + (*_next)[_last[bucket]] = i;
5.54 + (*_next)[i] = INVALID;
5.55 _last[bucket] = i;
5.56 }
5.57
5.58 void addItem(const Node& i, int bucket) {
5.59 (*_bucket)[i] = bucket;
5.60 if (_last[bucket] != INVALID) {
5.61 - _prev->set(i, _last[bucket]);
5.62 - _next->set(_last[bucket], i);
5.63 - _next->set(i, INVALID);
5.64 + (*_prev)[i] = _last[bucket];
5.65 + (*_next)[_last[bucket]] = i;
5.66 + (*_next)[i] = INVALID;
5.67 _last[bucket] = i;
5.68 } else {
5.69 - _prev->set(i, INVALID);
5.70 + (*_prev)[i] = INVALID;
5.71 _first[bucket] = i;
5.72 - _next->set(i, INVALID);
5.73 + (*_next)[i] = INVALID;
5.74 _last[bucket] = i;
5.75 }
5.76 }
5.77 @@ -218,11 +218,11 @@
5.78 void findMinCutOut() {
5.79
5.80 for (NodeIt n(_graph); n != INVALID; ++n) {
5.81 - _excess->set(n, 0);
5.82 + (*_excess)[n] = 0;
5.83 }
5.84
5.85 for (ArcIt a(_graph); a != INVALID; ++a) {
5.86 - _flow->set(a, 0);
5.87 + (*_flow)[a] = 0;
5.88 }
5.89
5.90 int bucket_num = 0;
5.91 @@ -232,7 +232,7 @@
5.92 {
5.93 typename Digraph::template NodeMap<bool> reached(_graph, false);
5.94
5.95 - reached.set(_source, true);
5.96 + reached[_source] = true;
5.97 bool first_set = true;
5.98
5.99 for (NodeIt t(_graph); t != INVALID; ++t) {
5.100 @@ -240,7 +240,7 @@
5.101 _sets.push_front(std::list<int>());
5.102
5.103 queue[qlast++] = t;
5.104 - reached.set(t, true);
5.105 + reached[t] = true;
5.106
5.107 while (qfirst != qlast) {
5.108 if (qsep == qfirst) {
5.109 @@ -257,7 +257,7 @@
5.110 for (InArcIt a(_graph, n); a != INVALID; ++a) {
5.111 Node u = _graph.source(a);
5.112 if (!reached[u] && _tolerance.positive((*_capacity)[a])) {
5.113 - reached.set(u, true);
5.114 + reached[u] = true;
5.115 queue[qlast++] = u;
5.116 }
5.117 }
5.118 @@ -266,18 +266,18 @@
5.119 }
5.120
5.121 ++bucket_num;
5.122 - _bucket->set(_source, 0);
5.123 + (*_bucket)[_source] = 0;
5.124 _dormant[0] = true;
5.125 }
5.126 - _source_set->set(_source, true);
5.127 + (*_source_set)[_source] = true;
5.128
5.129 Node target = _last[_sets.back().back()];
5.130 {
5.131 for (OutArcIt a(_graph, _source); a != INVALID; ++a) {
5.132 if (_tolerance.positive((*_capacity)[a])) {
5.133 Node u = _graph.target(a);
5.134 - _flow->set(a, (*_capacity)[a]);
5.135 - _excess->set(u, (*_excess)[u] + (*_capacity)[a]);
5.136 + (*_flow)[a] = (*_capacity)[a];
5.137 + (*_excess)[u] += (*_capacity)[a];
5.138 if (!(*_active)[u] && u != _source) {
5.139 activate(u);
5.140 }
5.141 @@ -318,14 +318,14 @@
5.142 activate(v);
5.143 }
5.144 if (!_tolerance.less(rem, excess)) {
5.145 - _flow->set(a, (*_flow)[a] + excess);
5.146 - _excess->set(v, (*_excess)[v] + excess);
5.147 + (*_flow)[a] += excess;
5.148 + (*_excess)[v] += excess;
5.149 excess = 0;
5.150 goto no_more_push;
5.151 } else {
5.152 excess -= rem;
5.153 - _excess->set(v, (*_excess)[v] + rem);
5.154 - _flow->set(a, (*_capacity)[a]);
5.155 + (*_excess)[v] += rem;
5.156 + (*_flow)[a] = (*_capacity)[a];
5.157 }
5.158 } else if (next_bucket > (*_bucket)[v]) {
5.159 next_bucket = (*_bucket)[v];
5.160 @@ -342,14 +342,14 @@
5.161 activate(v);
5.162 }
5.163 if (!_tolerance.less(rem, excess)) {
5.164 - _flow->set(a, (*_flow)[a] - excess);
5.165 - _excess->set(v, (*_excess)[v] + excess);
5.166 + (*_flow)[a] -= excess;
5.167 + (*_excess)[v] += excess;
5.168 excess = 0;
5.169 goto no_more_push;
5.170 } else {
5.171 excess -= rem;
5.172 - _excess->set(v, (*_excess)[v] + rem);
5.173 - _flow->set(a, 0);
5.174 + (*_excess)[v] += rem;
5.175 + (*_flow)[a] = 0;
5.176 }
5.177 } else if (next_bucket > (*_bucket)[v]) {
5.178 next_bucket = (*_bucket)[v];
5.179 @@ -358,7 +358,7 @@
5.180
5.181 no_more_push:
5.182
5.183 - _excess->set(n, excess);
5.184 + (*_excess)[n] = excess;
5.185
5.186 if (excess != 0) {
5.187 if ((*_next)[n] == INVALID) {
5.188 @@ -376,16 +376,16 @@
5.189 }
5.190 } else if (next_bucket == _node_num) {
5.191 _first[(*_bucket)[n]] = (*_next)[n];
5.192 - _prev->set((*_next)[n], INVALID);
5.193 + (*_prev)[(*_next)[n]] = INVALID;
5.194
5.195 std::list<std::list<int> >::iterator new_set =
5.196 _sets.insert(--_sets.end(), std::list<int>());
5.197
5.198 new_set->push_front(bucket_num);
5.199 - _bucket->set(n, bucket_num);
5.200 + (*_bucket)[n] = bucket_num;
5.201 _first[bucket_num] = _last[bucket_num] = n;
5.202 - _next->set(n, INVALID);
5.203 - _prev->set(n, INVALID);
5.204 + (*_next)[n] = INVALID;
5.205 + (*_prev)[n] = INVALID;
5.206 _dormant[bucket_num] = true;
5.207 ++bucket_num;
5.208
5.209 @@ -395,7 +395,7 @@
5.210 }
5.211 } else {
5.212 _first[*_highest] = (*_next)[n];
5.213 - _prev->set((*_next)[n], INVALID);
5.214 + (*_prev)[(*_next)[n]] = INVALID;
5.215
5.216 while (next_bucket != *_highest) {
5.217 --_highest;
5.218 @@ -409,10 +409,10 @@
5.219 }
5.220 --_highest;
5.221
5.222 - _bucket->set(n, *_highest);
5.223 - _next->set(n, _first[*_highest]);
5.224 + (*_bucket)[n] = *_highest;
5.225 + (*_next)[n] = _first[*_highest];
5.226 if (_first[*_highest] != INVALID) {
5.227 - _prev->set(_first[*_highest], n);
5.228 + (*_prev)[_first[*_highest]] = n;
5.229 } else {
5.230 _last[*_highest] = n;
5.231 }
5.232 @@ -434,13 +434,13 @@
5.233 if ((*_excess)[target] < _min_cut) {
5.234 _min_cut = (*_excess)[target];
5.235 for (NodeIt i(_graph); i != INVALID; ++i) {
5.236 - _min_cut_map->set(i, true);
5.237 + (*_min_cut_map)[i] = true;
5.238 }
5.239 for (std::list<int>::iterator it = _sets.back().begin();
5.240 it != _sets.back().end(); ++it) {
5.241 Node n = _first[*it];
5.242 while (n != INVALID) {
5.243 - _min_cut_map->set(n, false);
5.244 + (*_min_cut_map)[n] = false;
5.245 n = (*_next)[n];
5.246 }
5.247 }
5.248 @@ -453,13 +453,13 @@
5.249 _last[(*_bucket)[target]] = (*_prev)[target];
5.250 new_target = (*_prev)[target];
5.251 } else {
5.252 - _prev->set((*_next)[target], (*_prev)[target]);
5.253 + (*_prev)[(*_next)[target]] = (*_prev)[target];
5.254 new_target = (*_next)[target];
5.255 }
5.256 if ((*_prev)[target] == INVALID) {
5.257 _first[(*_bucket)[target]] = (*_next)[target];
5.258 } else {
5.259 - _next->set((*_prev)[target], (*_next)[target]);
5.260 + (*_next)[(*_prev)[target]] = (*_next)[target];
5.261 }
5.262 } else {
5.263 _sets.back().pop_back();
5.264 @@ -475,9 +475,9 @@
5.265 new_target = _last[_sets.back().back()];
5.266 }
5.267
5.268 - _bucket->set(target, 0);
5.269 + (*_bucket)[target] = 0;
5.270
5.271 - _source_set->set(target, true);
5.272 + (*_source_set)[target] = true;
5.273 for (OutArcIt a(_graph, target); a != INVALID; ++a) {
5.274 Value rem = (*_capacity)[a] - (*_flow)[a];
5.275 if (!_tolerance.positive(rem)) continue;
5.276 @@ -485,8 +485,8 @@
5.277 if (!(*_active)[v] && !(*_source_set)[v]) {
5.278 activate(v);
5.279 }
5.280 - _excess->set(v, (*_excess)[v] + rem);
5.281 - _flow->set(a, (*_capacity)[a]);
5.282 + (*_excess)[v] += rem;
5.283 + (*_flow)[a] = (*_capacity)[a];
5.284 }
5.285
5.286 for (InArcIt a(_graph, target); a != INVALID; ++a) {
5.287 @@ -496,8 +496,8 @@
5.288 if (!(*_active)[v] && !(*_source_set)[v]) {
5.289 activate(v);
5.290 }
5.291 - _excess->set(v, (*_excess)[v] + rem);
5.292 - _flow->set(a, 0);
5.293 + (*_excess)[v] += rem;
5.294 + (*_flow)[a] = 0;
5.295 }
5.296
5.297 target = new_target;
5.298 @@ -517,11 +517,11 @@
5.299 void findMinCutIn() {
5.300
5.301 for (NodeIt n(_graph); n != INVALID; ++n) {
5.302 - _excess->set(n, 0);
5.303 + (*_excess)[n] = 0;
5.304 }
5.305
5.306 for (ArcIt a(_graph); a != INVALID; ++a) {
5.307 - _flow->set(a, 0);
5.308 + (*_flow)[a] = 0;
5.309 }
5.310
5.311 int bucket_num = 0;
5.312 @@ -531,7 +531,7 @@
5.313 {
5.314 typename Digraph::template NodeMap<bool> reached(_graph, false);
5.315
5.316 - reached.set(_source, true);
5.317 + reached[_source] = true;
5.318
5.319 bool first_set = true;
5.320
5.321 @@ -540,7 +540,7 @@
5.322 _sets.push_front(std::list<int>());
5.323
5.324 queue[qlast++] = t;
5.325 - reached.set(t, true);
5.326 + reached[t] = true;
5.327
5.328 while (qfirst != qlast) {
5.329 if (qsep == qfirst) {
5.330 @@ -557,7 +557,7 @@
5.331 for (OutArcIt a(_graph, n); a != INVALID; ++a) {
5.332 Node u = _graph.target(a);
5.333 if (!reached[u] && _tolerance.positive((*_capacity)[a])) {
5.334 - reached.set(u, true);
5.335 + reached[u] = true;
5.336 queue[qlast++] = u;
5.337 }
5.338 }
5.339 @@ -566,18 +566,18 @@
5.340 }
5.341
5.342 ++bucket_num;
5.343 - _bucket->set(_source, 0);
5.344 + (*_bucket)[_source] = 0;
5.345 _dormant[0] = true;
5.346 }
5.347 - _source_set->set(_source, true);
5.348 + (*_source_set)[_source] = true;
5.349
5.350 Node target = _last[_sets.back().back()];
5.351 {
5.352 for (InArcIt a(_graph, _source); a != INVALID; ++a) {
5.353 if (_tolerance.positive((*_capacity)[a])) {
5.354 Node u = _graph.source(a);
5.355 - _flow->set(a, (*_capacity)[a]);
5.356 - _excess->set(u, (*_excess)[u] + (*_capacity)[a]);
5.357 + (*_flow)[a] = (*_capacity)[a];
5.358 + (*_excess)[u] += (*_capacity)[a];
5.359 if (!(*_active)[u] && u != _source) {
5.360 activate(u);
5.361 }
5.362 @@ -618,14 +618,14 @@
5.363 activate(v);
5.364 }
5.365 if (!_tolerance.less(rem, excess)) {
5.366 - _flow->set(a, (*_flow)[a] + excess);
5.367 - _excess->set(v, (*_excess)[v] + excess);
5.368 + (*_flow)[a] += excess;
5.369 + (*_excess)[v] += excess;
5.370 excess = 0;
5.371 goto no_more_push;
5.372 } else {
5.373 excess -= rem;
5.374 - _excess->set(v, (*_excess)[v] + rem);
5.375 - _flow->set(a, (*_capacity)[a]);
5.376 + (*_excess)[v] += rem;
5.377 + (*_flow)[a] = (*_capacity)[a];
5.378 }
5.379 } else if (next_bucket > (*_bucket)[v]) {
5.380 next_bucket = (*_bucket)[v];
5.381 @@ -642,14 +642,14 @@
5.382 activate(v);
5.383 }
5.384 if (!_tolerance.less(rem, excess)) {
5.385 - _flow->set(a, (*_flow)[a] - excess);
5.386 - _excess->set(v, (*_excess)[v] + excess);
5.387 + (*_flow)[a] -= excess;
5.388 + (*_excess)[v] += excess;
5.389 excess = 0;
5.390 goto no_more_push;
5.391 } else {
5.392 excess -= rem;
5.393 - _excess->set(v, (*_excess)[v] + rem);
5.394 - _flow->set(a, 0);
5.395 + (*_excess)[v] += rem;
5.396 + (*_flow)[a] = 0;
5.397 }
5.398 } else if (next_bucket > (*_bucket)[v]) {
5.399 next_bucket = (*_bucket)[v];
5.400 @@ -658,7 +658,7 @@
5.401
5.402 no_more_push:
5.403
5.404 - _excess->set(n, excess);
5.405 + (*_excess)[n] = excess;
5.406
5.407 if (excess != 0) {
5.408 if ((*_next)[n] == INVALID) {
5.409 @@ -676,16 +676,16 @@
5.410 }
5.411 } else if (next_bucket == _node_num) {
5.412 _first[(*_bucket)[n]] = (*_next)[n];
5.413 - _prev->set((*_next)[n], INVALID);
5.414 + (*_prev)[(*_next)[n]] = INVALID;
5.415
5.416 std::list<std::list<int> >::iterator new_set =
5.417 _sets.insert(--_sets.end(), std::list<int>());
5.418
5.419 new_set->push_front(bucket_num);
5.420 - _bucket->set(n, bucket_num);
5.421 + (*_bucket)[n] = bucket_num;
5.422 _first[bucket_num] = _last[bucket_num] = n;
5.423 - _next->set(n, INVALID);
5.424 - _prev->set(n, INVALID);
5.425 + (*_next)[n] = INVALID;
5.426 + (*_prev)[n] = INVALID;
5.427 _dormant[bucket_num] = true;
5.428 ++bucket_num;
5.429
5.430 @@ -695,7 +695,7 @@
5.431 }
5.432 } else {
5.433 _first[*_highest] = (*_next)[n];
5.434 - _prev->set((*_next)[n], INVALID);
5.435 + (*_prev)[(*_next)[n]] = INVALID;
5.436
5.437 while (next_bucket != *_highest) {
5.438 --_highest;
5.439 @@ -708,10 +708,10 @@
5.440 }
5.441 --_highest;
5.442
5.443 - _bucket->set(n, *_highest);
5.444 - _next->set(n, _first[*_highest]);
5.445 + (*_bucket)[n] = *_highest;
5.446 + (*_next)[n] = _first[*_highest];
5.447 if (_first[*_highest] != INVALID) {
5.448 - _prev->set(_first[*_highest], n);
5.449 + (*_prev)[_first[*_highest]] = n;
5.450 } else {
5.451 _last[*_highest] = n;
5.452 }
5.453 @@ -733,13 +733,13 @@
5.454 if ((*_excess)[target] < _min_cut) {
5.455 _min_cut = (*_excess)[target];
5.456 for (NodeIt i(_graph); i != INVALID; ++i) {
5.457 - _min_cut_map->set(i, false);
5.458 + (*_min_cut_map)[i] = false;
5.459 }
5.460 for (std::list<int>::iterator it = _sets.back().begin();
5.461 it != _sets.back().end(); ++it) {
5.462 Node n = _first[*it];
5.463 while (n != INVALID) {
5.464 - _min_cut_map->set(n, true);
5.465 + (*_min_cut_map)[n] = true;
5.466 n = (*_next)[n];
5.467 }
5.468 }
5.469 @@ -752,13 +752,13 @@
5.470 _last[(*_bucket)[target]] = (*_prev)[target];
5.471 new_target = (*_prev)[target];
5.472 } else {
5.473 - _prev->set((*_next)[target], (*_prev)[target]);
5.474 + (*_prev)[(*_next)[target]] = (*_prev)[target];
5.475 new_target = (*_next)[target];
5.476 }
5.477 if ((*_prev)[target] == INVALID) {
5.478 _first[(*_bucket)[target]] = (*_next)[target];
5.479 } else {
5.480 - _next->set((*_prev)[target], (*_next)[target]);
5.481 + (*_next)[(*_prev)[target]] = (*_next)[target];
5.482 }
5.483 } else {
5.484 _sets.back().pop_back();
5.485 @@ -774,9 +774,9 @@
5.486 new_target = _last[_sets.back().back()];
5.487 }
5.488
5.489 - _bucket->set(target, 0);
5.490 + (*_bucket)[target] = 0;
5.491
5.492 - _source_set->set(target, true);
5.493 + (*_source_set)[target] = true;
5.494 for (InArcIt a(_graph, target); a != INVALID; ++a) {
5.495 Value rem = (*_capacity)[a] - (*_flow)[a];
5.496 if (!_tolerance.positive(rem)) continue;
5.497 @@ -784,8 +784,8 @@
5.498 if (!(*_active)[v] && !(*_source_set)[v]) {
5.499 activate(v);
5.500 }
5.501 - _excess->set(v, (*_excess)[v] + rem);
5.502 - _flow->set(a, (*_capacity)[a]);
5.503 + (*_excess)[v] += rem;
5.504 + (*_flow)[a] = (*_capacity)[a];
5.505 }
5.506
5.507 for (OutArcIt a(_graph, target); a != INVALID; ++a) {
5.508 @@ -795,8 +795,8 @@
5.509 if (!(*_active)[v] && !(*_source_set)[v]) {
5.510 activate(v);
5.511 }
5.512 - _excess->set(v, (*_excess)[v] + rem);
5.513 - _flow->set(a, 0);
5.514 + (*_excess)[v] += rem;
5.515 + (*_flow)[a] = 0;
5.516 }
5.517
5.518 target = new_target;
6.1 --- a/lemon/max_matching.h Tue Apr 14 10:34:12 2009 +0200
6.2 +++ b/lemon/max_matching.h Tue Apr 14 10:35:38 2009 +0200
6.3 @@ -282,20 +282,20 @@
6.4 Node base = (*_blossom_rep)[_blossom_set->find(node)];
6.5
6.6 while (base != nca) {
6.7 - _ear->set(node, arc);
6.8 + (*_ear)[node] = arc;
6.9
6.10 Node n = node;
6.11 while (n != base) {
6.12 n = _graph.target((*_matching)[n]);
6.13 Arc a = (*_ear)[n];
6.14 n = _graph.target(a);
6.15 - _ear->set(n, _graph.oppositeArc(a));
6.16 + (*_ear)[n] = _graph.oppositeArc(a);
6.17 }
6.18 node = _graph.target((*_matching)[base]);
6.19 _tree_set->erase(base);
6.20 _tree_set->erase(node);
6.21 _blossom_set->insert(node, _blossom_set->find(base));
6.22 - _status->set(node, EVEN);
6.23 + (*_status)[node] = EVEN;
6.24 _node_queue[_last++] = node;
6.25 arc = _graph.oppositeArc((*_ear)[node]);
6.26 node = _graph.target((*_ear)[node]);
6.27 @@ -304,7 +304,7 @@
6.28 }
6.29 }
6.30
6.31 - _blossom_rep->set(_blossom_set->find(nca), nca);
6.32 + (*_blossom_rep)[_blossom_set->find(nca)] = nca;
6.33
6.34 {
6.35
6.36 @@ -313,20 +313,20 @@
6.37 Node base = (*_blossom_rep)[_blossom_set->find(node)];
6.38
6.39 while (base != nca) {
6.40 - _ear->set(node, arc);
6.41 + (*_ear)[node] = arc;
6.42
6.43 Node n = node;
6.44 while (n != base) {
6.45 n = _graph.target((*_matching)[n]);
6.46 Arc a = (*_ear)[n];
6.47 n = _graph.target(a);
6.48 - _ear->set(n, _graph.oppositeArc(a));
6.49 + (*_ear)[n] = _graph.oppositeArc(a);
6.50 }
6.51 node = _graph.target((*_matching)[base]);
6.52 _tree_set->erase(base);
6.53 _tree_set->erase(node);
6.54 _blossom_set->insert(node, _blossom_set->find(base));
6.55 - _status->set(node, EVEN);
6.56 + (*_status)[node] = EVEN;
6.57 _node_queue[_last++] = node;
6.58 arc = _graph.oppositeArc((*_ear)[node]);
6.59 node = _graph.target((*_ear)[node]);
6.60 @@ -335,7 +335,7 @@
6.61 }
6.62 }
6.63
6.64 - _blossom_rep->set(_blossom_set->find(nca), nca);
6.65 + (*_blossom_rep)[_blossom_set->find(nca)] = nca;
6.66 }
6.67
6.68
6.69 @@ -344,11 +344,11 @@
6.70 Node base = _graph.source(a);
6.71 Node odd = _graph.target(a);
6.72
6.73 - _ear->set(odd, _graph.oppositeArc(a));
6.74 + (*_ear)[odd] = _graph.oppositeArc(a);
6.75 Node even = _graph.target((*_matching)[odd]);
6.76 - _blossom_rep->set(_blossom_set->insert(even), even);
6.77 - _status->set(odd, ODD);
6.78 - _status->set(even, EVEN);
6.79 + (*_blossom_rep)[_blossom_set->insert(even)] = even;
6.80 + (*_status)[odd] = ODD;
6.81 + (*_status)[even] = EVEN;
6.82 int tree = _tree_set->find((*_blossom_rep)[_blossom_set->find(base)]);
6.83 _tree_set->insert(odd, tree);
6.84 _tree_set->insert(even, tree);
6.85 @@ -362,30 +362,30 @@
6.86
6.87 int tree = _tree_set->find((*_blossom_rep)[_blossom_set->find(even)]);
6.88
6.89 - _matching->set(odd, _graph.oppositeArc(a));
6.90 - _status->set(odd, MATCHED);
6.91 + (*_matching)[odd] = _graph.oppositeArc(a);
6.92 + (*_status)[odd] = MATCHED;
6.93
6.94 Arc arc = (*_matching)[even];
6.95 - _matching->set(even, a);
6.96 + (*_matching)[even] = a;
6.97
6.98 while (arc != INVALID) {
6.99 odd = _graph.target(arc);
6.100 arc = (*_ear)[odd];
6.101 even = _graph.target(arc);
6.102 - _matching->set(odd, arc);
6.103 + (*_matching)[odd] = arc;
6.104 arc = (*_matching)[even];
6.105 - _matching->set(even, _graph.oppositeArc((*_matching)[odd]));
6.106 + (*_matching)[even] = _graph.oppositeArc((*_matching)[odd]);
6.107 }
6.108
6.109 for (typename TreeSet::ItemIt it(*_tree_set, tree);
6.110 it != INVALID; ++it) {
6.111 if ((*_status)[it] == ODD) {
6.112 - _status->set(it, MATCHED);
6.113 + (*_status)[it] = MATCHED;
6.114 } else {
6.115 int blossom = _blossom_set->find(it);
6.116 for (typename BlossomSet::ItemIt jt(*_blossom_set, blossom);
6.117 jt != INVALID; ++jt) {
6.118 - _status->set(jt, MATCHED);
6.119 + (*_status)[jt] = MATCHED;
6.120 }
6.121 _blossom_set->eraseClass(blossom);
6.122 }
6.123 @@ -427,8 +427,8 @@
6.124 void init() {
6.125 createStructures();
6.126 for(NodeIt n(_graph); n != INVALID; ++n) {
6.127 - _matching->set(n, INVALID);
6.128 - _status->set(n, UNMATCHED);
6.129 + (*_matching)[n] = INVALID;
6.130 + (*_status)[n] = UNMATCHED;
6.131 }
6.132 }
6.133
6.134 @@ -438,18 +438,18 @@
6.135 void greedyInit() {
6.136 createStructures();
6.137 for (NodeIt n(_graph); n != INVALID; ++n) {
6.138 - _matching->set(n, INVALID);
6.139 - _status->set(n, UNMATCHED);
6.140 + (*_matching)[n] = INVALID;
6.141 + (*_status)[n] = UNMATCHED;
6.142 }
6.143 for (NodeIt n(_graph); n != INVALID; ++n) {
6.144 if ((*_matching)[n] == INVALID) {
6.145 for (OutArcIt a(_graph, n); a != INVALID ; ++a) {
6.146 Node v = _graph.target(a);
6.147 if ((*_matching)[v] == INVALID && v != n) {
6.148 - _matching->set(n, a);
6.149 - _status->set(n, MATCHED);
6.150 - _matching->set(v, _graph.oppositeArc(a));
6.151 - _status->set(v, MATCHED);
6.152 + (*_matching)[n] = a;
6.153 + (*_status)[n] = MATCHED;
6.154 + (*_matching)[v] = _graph.oppositeArc(a);
6.155 + (*_status)[v] = MATCHED;
6.156 break;
6.157 }
6.158 }
6.159 @@ -469,21 +469,21 @@
6.160 createStructures();
6.161
6.162 for (NodeIt n(_graph); n != INVALID; ++n) {
6.163 - _matching->set(n, INVALID);
6.164 - _status->set(n, UNMATCHED);
6.165 + (*_matching)[n] = INVALID;
6.166 + (*_status)[n] = UNMATCHED;
6.167 }
6.168 for(EdgeIt e(_graph); e!=INVALID; ++e) {
6.169 if (matching[e]) {
6.170
6.171 Node u = _graph.u(e);
6.172 if ((*_matching)[u] != INVALID) return false;
6.173 - _matching->set(u, _graph.direct(e, true));
6.174 - _status->set(u, MATCHED);
6.175 + (*_matching)[u] = _graph.direct(e, true);
6.176 + (*_status)[u] = MATCHED;
6.177
6.178 Node v = _graph.v(e);
6.179 if ((*_matching)[v] != INVALID) return false;
6.180 - _matching->set(v, _graph.direct(e, false));
6.181 - _status->set(v, MATCHED);
6.182 + (*_matching)[v] = _graph.direct(e, false);
6.183 + (*_status)[v] = MATCHED;
6.184 }
6.185 }
6.186 return true;
6.187 @@ -497,7 +497,7 @@
6.188 if ((*_status)[n] == UNMATCHED) {
6.189 (*_blossom_rep)[_blossom_set->insert(n)] = n;
6.190 _tree_set->insert(n);
6.191 - _status->set(n, EVEN);
6.192 + (*_status)[n] = EVEN;
6.193 processSparse(n);
6.194 }
6.195 }
6.196 @@ -512,7 +512,7 @@
6.197 if ((*_status)[n] == UNMATCHED) {
6.198 (*_blossom_rep)[_blossom_set->insert(n)] = n;
6.199 _tree_set->insert(n);
6.200 - _status->set(n, EVEN);
6.201 + (*_status)[n] = EVEN;
6.202 processDense(n);
6.203 }
6.204 }
6.205 @@ -1548,9 +1548,9 @@
6.206 int bi = (*_node_index)[base];
6.207 Value pot = (*_node_data)[bi].pot;
6.208
6.209 - _matching->set(base, matching);
6.210 + (*_matching)[base] = matching;
6.211 _blossom_node_list.push_back(base);
6.212 - _node_potential->set(base, pot);
6.213 + (*_node_potential)[base] = pot;
6.214 } else {
6.215
6.216 Value pot = (*_blossom_data)[blossom].pot;
6.217 @@ -1644,17 +1644,17 @@
6.218 createStructures();
6.219
6.220 for (ArcIt e(_graph); e != INVALID; ++e) {
6.221 - _node_heap_index->set(e, BinHeap<Value, IntArcMap>::PRE_HEAP);
6.222 + (*_node_heap_index)[e] = BinHeap<Value, IntArcMap>::PRE_HEAP;
6.223 }
6.224 for (NodeIt n(_graph); n != INVALID; ++n) {
6.225 - _delta1_index->set(n, _delta1->PRE_HEAP);
6.226 + (*_delta1_index)[n] = _delta1->PRE_HEAP;
6.227 }
6.228 for (EdgeIt e(_graph); e != INVALID; ++e) {
6.229 - _delta3_index->set(e, _delta3->PRE_HEAP);
6.230 + (*_delta3_index)[e] = _delta3->PRE_HEAP;
6.231 }
6.232 for (int i = 0; i < _blossom_num; ++i) {
6.233 - _delta2_index->set(i, _delta2->PRE_HEAP);
6.234 - _delta4_index->set(i, _delta4->PRE_HEAP);
6.235 + (*_delta2_index)[i] = _delta2->PRE_HEAP;
6.236 + (*_delta4_index)[i] = _delta4->PRE_HEAP;
6.237 }
6.238
6.239 int index = 0;
6.240 @@ -1666,7 +1666,7 @@
6.241 max = (dualScale * _weight[e]) / 2;
6.242 }
6.243 }
6.244 - _node_index->set(n, index);
6.245 + (*_node_index)[n] = index;
6.246 (*_node_data)[index].pot = max;
6.247 _delta1->push(n, max);
6.248 int blossom =
6.249 @@ -2741,9 +2741,9 @@
6.250 int bi = (*_node_index)[base];
6.251 Value pot = (*_node_data)[bi].pot;
6.252
6.253 - _matching->set(base, matching);
6.254 + (*_matching)[base] = matching;
6.255 _blossom_node_list.push_back(base);
6.256 - _node_potential->set(base, pot);
6.257 + (*_node_potential)[base] = pot;
6.258 } else {
6.259
6.260 Value pot = (*_blossom_data)[blossom].pot;
6.261 @@ -2831,14 +2831,14 @@
6.262 createStructures();
6.263
6.264 for (ArcIt e(_graph); e != INVALID; ++e) {
6.265 - _node_heap_index->set(e, BinHeap<Value, IntArcMap>::PRE_HEAP);
6.266 + (*_node_heap_index)[e] = BinHeap<Value, IntArcMap>::PRE_HEAP;
6.267 }
6.268 for (EdgeIt e(_graph); e != INVALID; ++e) {
6.269 - _delta3_index->set(e, _delta3->PRE_HEAP);
6.270 + (*_delta3_index)[e] = _delta3->PRE_HEAP;
6.271 }
6.272 for (int i = 0; i < _blossom_num; ++i) {
6.273 - _delta2_index->set(i, _delta2->PRE_HEAP);
6.274 - _delta4_index->set(i, _delta4->PRE_HEAP);
6.275 + (*_delta2_index)[i] = _delta2->PRE_HEAP;
6.276 + (*_delta4_index)[i] = _delta4->PRE_HEAP;
6.277 }
6.278
6.279 int index = 0;
6.280 @@ -2850,7 +2850,7 @@
6.281 max = (dualScale * _weight[e]) / 2;
6.282 }
6.283 }
6.284 - _node_index->set(n, index);
6.285 + (*_node_index)[n] = index;
6.286 (*_node_data)[index].pot = max;
6.287 int blossom =
6.288 _blossom_set->insert(n, std::numeric_limits<Value>::max());
7.1 --- a/lemon/min_cost_arborescence.h Tue Apr 14 10:34:12 2009 +0200
7.2 +++ b/lemon/min_cost_arborescence.h Tue Apr 14 10:35:38 2009 +0200
7.3 @@ -293,7 +293,7 @@
7.4 minimum = (*_cost_arcs)[nodes[i]];
7.5 }
7.6 }
7.7 - _arc_order->set(minimum.arc, _dual_variables.size());
7.8 + (*_arc_order)[minimum.arc] = _dual_variables.size();
7.9 DualVariable var(_dual_node_list.size() - 1,
7.10 _dual_node_list.size(), minimum.value);
7.11 _dual_variables.push_back(var);
7.12 @@ -335,7 +335,7 @@
7.13 minimum = (*_cost_arcs)[nodes[i]];
7.14 }
7.15 }
7.16 - _arc_order->set(minimum.arc, _dual_variables.size());
7.17 + (*_arc_order)[minimum.arc] = _dual_variables.size();
7.18 DualVariable var(node_bottom, _dual_node_list.size(), minimum.value);
7.19 _dual_variables.push_back(var);
7.20 StackLevel level;
7.21 @@ -364,7 +364,7 @@
7.22 while (!_heap->empty()) {
7.23 Node source = _heap->top();
7.24 _heap->pop();
7.25 - _node_order->set(source, -1);
7.26 + (*_node_order)[source] = -1;
7.27 for (OutArcIt it(*_digraph, source); it != INVALID; ++it) {
7.28 if ((*_arc_order)[it] < 0) continue;
7.29 Node target = _digraph->target(it);
7.30 @@ -650,13 +650,13 @@
7.31 _heap->clear();
7.32 for (NodeIt it(*_digraph); it != INVALID; ++it) {
7.33 (*_cost_arcs)[it].arc = INVALID;
7.34 - _node_order->set(it, -3);
7.35 - _heap_cross_ref->set(it, Heap::PRE_HEAP);
7.36 + (*_node_order)[it] = -3;
7.37 + (*_heap_cross_ref)[it] = Heap::PRE_HEAP;
7.38 _pred->set(it, INVALID);
7.39 }
7.40 for (ArcIt it(*_digraph); it != INVALID; ++it) {
7.41 _arborescence->set(it, false);
7.42 - _arc_order->set(it, -1);
7.43 + (*_arc_order)[it] = -1;
7.44 }
7.45 _dual_node_list.clear();
7.46 _dual_variables.clear();
8.1 --- a/lemon/preflow.h Tue Apr 14 10:34:12 2009 +0200
8.2 +++ b/lemon/preflow.h Tue Apr 14 10:35:38 2009 +0200
8.3 @@ -404,7 +404,7 @@
8.4
8.5 _phase = true;
8.6 for (NodeIt n(_graph); n != INVALID; ++n) {
8.7 - _excess->set(n, 0);
8.8 + (*_excess)[n] = 0;
8.9 }
8.10
8.11 for (ArcIt e(_graph); e != INVALID; ++e) {
8.12 @@ -417,10 +417,10 @@
8.13 _level->initAddItem(_target);
8.14
8.15 std::vector<Node> queue;
8.16 - reached.set(_source, true);
8.17 + reached[_source] = true;
8.18
8.19 queue.push_back(_target);
8.20 - reached.set(_target, true);
8.21 + reached[_target] = true;
8.22 while (!queue.empty()) {
8.23 _level->initNewLevel();
8.24 std::vector<Node> nqueue;
8.25 @@ -429,7 +429,7 @@
8.26 for (InArcIt e(_graph, n); e != INVALID; ++e) {
8.27 Node u = _graph.source(e);
8.28 if (!reached[u] && _tolerance.positive((*_capacity)[e])) {
8.29 - reached.set(u, true);
8.30 + reached[u] = true;
8.31 _level->initAddItem(u);
8.32 nqueue.push_back(u);
8.33 }
8.34 @@ -444,7 +444,7 @@
8.35 Node u = _graph.target(e);
8.36 if ((*_level)[u] == _level->maxLevel()) continue;
8.37 _flow->set(e, (*_capacity)[e]);
8.38 - _excess->set(u, (*_excess)[u] + (*_capacity)[e]);
8.39 + (*_excess)[u] += (*_capacity)[e];
8.40 if (u != _target && !_level->active(u)) {
8.41 _level->activate(u);
8.42 }
8.43 @@ -478,7 +478,7 @@
8.44 excess -= (*_flow)[e];
8.45 }
8.46 if (excess < 0 && n != _source) return false;
8.47 - _excess->set(n, excess);
8.48 + (*_excess)[n] = excess;
8.49 }
8.50
8.51 typename Digraph::template NodeMap<bool> reached(_graph, false);
8.52 @@ -487,10 +487,10 @@
8.53 _level->initAddItem(_target);
8.54
8.55 std::vector<Node> queue;
8.56 - reached.set(_source, true);
8.57 + reached[_source] = true;
8.58
8.59 queue.push_back(_target);
8.60 - reached.set(_target, true);
8.61 + reached[_target] = true;
8.62 while (!queue.empty()) {
8.63 _level->initNewLevel();
8.64 std::vector<Node> nqueue;
8.65 @@ -500,7 +500,7 @@
8.66 Node u = _graph.source(e);
8.67 if (!reached[u] &&
8.68 _tolerance.positive((*_capacity)[e] - (*_flow)[e])) {
8.69 - reached.set(u, true);
8.70 + reached[u] = true;
8.71 _level->initAddItem(u);
8.72 nqueue.push_back(u);
8.73 }
8.74 @@ -508,7 +508,7 @@
8.75 for (OutArcIt e(_graph, n); e != INVALID; ++e) {
8.76 Node v = _graph.target(e);
8.77 if (!reached[v] && _tolerance.positive((*_flow)[e])) {
8.78 - reached.set(v, true);
8.79 + reached[v] = true;
8.80 _level->initAddItem(v);
8.81 nqueue.push_back(v);
8.82 }
8.83 @@ -524,7 +524,7 @@
8.84 Node u = _graph.target(e);
8.85 if ((*_level)[u] == _level->maxLevel()) continue;
8.86 _flow->set(e, (*_capacity)[e]);
8.87 - _excess->set(u, (*_excess)[u] + rem);
8.88 + (*_excess)[u] += rem;
8.89 if (u != _target && !_level->active(u)) {
8.90 _level->activate(u);
8.91 }
8.92 @@ -536,7 +536,7 @@
8.93 Node v = _graph.source(e);
8.94 if ((*_level)[v] == _level->maxLevel()) continue;
8.95 _flow->set(e, 0);
8.96 - _excess->set(v, (*_excess)[v] + rem);
8.97 + (*_excess)[v] += rem;
8.98 if (v != _target && !_level->active(v)) {
8.99 _level->activate(v);
8.100 }
8.101 @@ -577,12 +577,12 @@
8.102 }
8.103 if (!_tolerance.less(rem, excess)) {
8.104 _flow->set(e, (*_flow)[e] + excess);
8.105 - _excess->set(v, (*_excess)[v] + excess);
8.106 + (*_excess)[v] += excess;
8.107 excess = 0;
8.108 goto no_more_push_1;
8.109 } else {
8.110 excess -= rem;
8.111 - _excess->set(v, (*_excess)[v] + rem);
8.112 + (*_excess)[v] += rem;
8.113 _flow->set(e, (*_capacity)[e]);
8.114 }
8.115 } else if (new_level > (*_level)[v]) {
8.116 @@ -600,12 +600,12 @@
8.117 }
8.118 if (!_tolerance.less(rem, excess)) {
8.119 _flow->set(e, (*_flow)[e] - excess);
8.120 - _excess->set(v, (*_excess)[v] + excess);
8.121 + (*_excess)[v] += excess;
8.122 excess = 0;
8.123 goto no_more_push_1;
8.124 } else {
8.125 excess -= rem;
8.126 - _excess->set(v, (*_excess)[v] + rem);
8.127 + (*_excess)[v] += rem;
8.128 _flow->set(e, 0);
8.129 }
8.130 } else if (new_level > (*_level)[v]) {
8.131 @@ -615,7 +615,7 @@
8.132
8.133 no_more_push_1:
8.134
8.135 - _excess->set(n, excess);
8.136 + (*_excess)[n] = excess;
8.137
8.138 if (excess != 0) {
8.139 if (new_level + 1 < _level->maxLevel()) {
8.140 @@ -650,12 +650,12 @@
8.141 }
8.142 if (!_tolerance.less(rem, excess)) {
8.143 _flow->set(e, (*_flow)[e] + excess);
8.144 - _excess->set(v, (*_excess)[v] + excess);
8.145 + (*_excess)[v] += excess;
8.146 excess = 0;
8.147 goto no_more_push_2;
8.148 } else {
8.149 excess -= rem;
8.150 - _excess->set(v, (*_excess)[v] + rem);
8.151 + (*_excess)[v] += rem;
8.152 _flow->set(e, (*_capacity)[e]);
8.153 }
8.154 } else if (new_level > (*_level)[v]) {
8.155 @@ -673,12 +673,12 @@
8.156 }
8.157 if (!_tolerance.less(rem, excess)) {
8.158 _flow->set(e, (*_flow)[e] - excess);
8.159 - _excess->set(v, (*_excess)[v] + excess);
8.160 + (*_excess)[v] += excess;
8.161 excess = 0;
8.162 goto no_more_push_2;
8.163 } else {
8.164 excess -= rem;
8.165 - _excess->set(v, (*_excess)[v] + rem);
8.166 + (*_excess)[v] += rem;
8.167 _flow->set(e, 0);
8.168 }
8.169 } else if (new_level > (*_level)[v]) {
8.170 @@ -688,7 +688,7 @@
8.171
8.172 no_more_push_2:
8.173
8.174 - _excess->set(n, excess);
8.175 + (*_excess)[n] = excess;
8.176
8.177 if (excess != 0) {
8.178 if (new_level + 1 < _level->maxLevel()) {
8.179 @@ -731,7 +731,7 @@
8.180
8.181 typename Digraph::template NodeMap<bool> reached(_graph);
8.182 for (NodeIt n(_graph); n != INVALID; ++n) {
8.183 - reached.set(n, (*_level)[n] < _level->maxLevel());
8.184 + reached[n] = (*_level)[n] < _level->maxLevel();
8.185 }
8.186
8.187 _level->initStart();
8.188 @@ -739,7 +739,7 @@
8.189
8.190 std::vector<Node> queue;
8.191 queue.push_back(_source);
8.192 - reached.set(_source, true);
8.193 + reached[_source] = true;
8.194
8.195 while (!queue.empty()) {
8.196 _level->initNewLevel();
8.197 @@ -749,7 +749,7 @@
8.198 for (OutArcIt e(_graph, n); e != INVALID; ++e) {
8.199 Node v = _graph.target(e);
8.200 if (!reached[v] && _tolerance.positive((*_flow)[e])) {
8.201 - reached.set(v, true);
8.202 + reached[v] = true;
8.203 _level->initAddItem(v);
8.204 nqueue.push_back(v);
8.205 }
8.206 @@ -758,7 +758,7 @@
8.207 Node u = _graph.source(e);
8.208 if (!reached[u] &&
8.209 _tolerance.positive((*_capacity)[e] - (*_flow)[e])) {
8.210 - reached.set(u, true);
8.211 + reached[u] = true;
8.212 _level->initAddItem(u);
8.213 nqueue.push_back(u);
8.214 }
8.215 @@ -792,12 +792,12 @@
8.216 }
8.217 if (!_tolerance.less(rem, excess)) {
8.218 _flow->set(e, (*_flow)[e] + excess);
8.219 - _excess->set(v, (*_excess)[v] + excess);
8.220 + (*_excess)[v] += excess;
8.221 excess = 0;
8.222 goto no_more_push;
8.223 } else {
8.224 excess -= rem;
8.225 - _excess->set(v, (*_excess)[v] + rem);
8.226 + (*_excess)[v] += rem;
8.227 _flow->set(e, (*_capacity)[e]);
8.228 }
8.229 } else if (new_level > (*_level)[v]) {
8.230 @@ -815,12 +815,12 @@
8.231 }
8.232 if (!_tolerance.less(rem, excess)) {
8.233 _flow->set(e, (*_flow)[e] - excess);
8.234 - _excess->set(v, (*_excess)[v] + excess);
8.235 + (*_excess)[v] += excess;
8.236 excess = 0;
8.237 goto no_more_push;
8.238 } else {
8.239 excess -= rem;
8.240 - _excess->set(v, (*_excess)[v] + rem);
8.241 + (*_excess)[v] += rem;
8.242 _flow->set(e, 0);
8.243 }
8.244 } else if (new_level > (*_level)[v]) {
8.245 @@ -830,7 +830,7 @@
8.246
8.247 no_more_push:
8.248
8.249 - _excess->set(n, excess);
8.250 + (*_excess)[n] = excess;
8.251
8.252 if (excess != 0) {
8.253 if (new_level + 1 < _level->maxLevel()) {
9.1 --- a/test/kruskal_test.cc Tue Apr 14 10:34:12 2009 +0200
9.2 +++ b/test/kruskal_test.cc Tue Apr 14 10:35:38 2009 +0200
9.3 @@ -99,16 +99,16 @@
9.4 check(kruskal(G, edge_cost_map, tree_map)==10,
9.5 "Total cost should be 10");
9.6
9.7 - edge_cost_map.set(e1, -10);
9.8 - edge_cost_map.set(e2, -9);
9.9 - edge_cost_map.set(e3, -8);
9.10 - edge_cost_map.set(e4, -7);
9.11 - edge_cost_map.set(e5, -6);
9.12 - edge_cost_map.set(e6, -5);
9.13 - edge_cost_map.set(e7, -4);
9.14 - edge_cost_map.set(e8, -3);
9.15 - edge_cost_map.set(e9, -2);
9.16 - edge_cost_map.set(e10, -1);
9.17 + edge_cost_map[e1] = -10;
9.18 + edge_cost_map[e2] = -9;
9.19 + edge_cost_map[e3] = -8;
9.20 + edge_cost_map[e4] = -7;
9.21 + edge_cost_map[e5] = -6;
9.22 + edge_cost_map[e6] = -5;
9.23 + edge_cost_map[e7] = -4;
9.24 + edge_cost_map[e8] = -3;
9.25 + edge_cost_map[e9] = -2;
9.26 + edge_cost_map[e10] = -1;
9.27
9.28 vector<Edge> tree_edge_vec(5);
9.29