Changeset 1704:467d7927a901 in lemon-0.x for lemon/bits/iterable_graph_extender.h
- Timestamp:
- 10/05/05 15:17:42 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2231
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/iterable_graph_extender.h
r1627 r1704 217 217 class IncEdgeIt : public Parent::UndirEdge { 218 218 const Graph* graph; 219 bool forward;219 bool direction; 220 220 friend class IterableUndirGraphExtender; 221 template <typename G>222 friend class UndirGraphExtender;223 221 public: 224 222 225 223 IncEdgeIt() { } 226 224 227 IncEdgeIt(Invalid i) : UndirEdge(i), forward(false) { } 228 229 IncEdgeIt(const Graph& _graph, const Node &n) 230 : graph(&_graph) 231 { 232 _graph._dirFirstOut(*this, n); 225 IncEdgeIt(Invalid i) : UndirEdge(i), direction(false) { } 226 227 IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) { 228 _graph.firstInc(*this, direction, n); 233 229 } 234 230 235 231 IncEdgeIt(const Graph& _graph, const UndirEdge &ue, const Node &n) 236 : graph(&_graph), UndirEdge(ue) 237 { 238 forward = (_graph.source(ue) == n); 232 : graph(&_graph), UndirEdge(ue) { 233 direction = (_graph.source(ue) == n); 239 234 } 240 235 241 236 IncEdgeIt& operator++() { 242 graph-> _dirNextOut(*this);237 graph->nextInc(*this, direction); 243 238 return *this; 244 239 } … … 252 247 /// Returns the base node of the iterator 253 248 Node baseNode(const IncEdgeIt &e) const { 254 return _dirSource(e);249 return e.direction ? source(e) : target(e); 255 250 } 256 251 /// Running node of the iterator … … 258 253 /// Returns the running node of the iterator 259 254 Node runningNode(const IncEdgeIt &e) const { 260 return _dirTarget(e);255 return e.direction ? target(e) : source(e); 261 256 } 262 257
Note: See TracChangeset
for help on using the changeset viewer.