268 |
268 |
269 }; |
269 }; |
270 |
270 |
271 |
271 |
272 template <typename _Base> |
272 template <typename _Base> |
273 class IterableUBipartiteGraphExtender : public _Base { |
273 class IterableBpUGraphExtender : public _Base { |
274 public: |
274 public: |
275 typedef _Base Parent; |
275 typedef _Base Parent; |
276 typedef IterableUBipartiteGraphExtender Graph; |
276 typedef IterableBpUGraphExtender Graph; |
277 |
277 |
278 typedef typename Parent::Node Node; |
278 typedef typename Parent::Node Node; |
279 typedef typename Parent::UpperNode UpperNode; |
279 typedef typename Parent::ANode ANode; |
280 typedef typename Parent::LowerNode LowerNode; |
280 typedef typename Parent::BNode BNode; |
281 typedef typename Parent::Edge Edge; |
281 typedef typename Parent::Edge Edge; |
282 typedef typename Parent::UEdge UEdge; |
282 typedef typename Parent::UEdge UEdge; |
283 |
283 |
284 class NodeIt : public Node { |
284 class NodeIt : public Node { |
285 const Graph* graph; |
285 const Graph* graph; |
301 return *this; |
301 return *this; |
302 } |
302 } |
303 |
303 |
304 }; |
304 }; |
305 |
305 |
306 class UpperNodeIt : public Node { |
306 class ANodeIt : public Node { |
307 friend class IterableUBipartiteGraphExtender; |
307 friend class IterableBpUGraphExtender; |
308 const Graph* graph; |
308 const Graph* graph; |
309 public: |
309 public: |
310 |
310 |
311 UpperNodeIt() { } |
311 ANodeIt() { } |
312 |
312 |
313 UpperNodeIt(Invalid i) : Node(INVALID) { } |
313 ANodeIt(Invalid i) : Node(INVALID) { } |
314 |
314 |
315 explicit UpperNodeIt(const Graph& _graph) : graph(&_graph) { |
315 explicit ANodeIt(const Graph& _graph) : graph(&_graph) { |
316 graph->firstUpper(static_cast<Node&>(*this)); |
316 graph->firstANode(static_cast<Node&>(*this)); |
317 } |
317 } |
318 |
318 |
319 UpperNodeIt(const Graph& _graph, const Node& node) |
319 ANodeIt(const Graph& _graph, const Node& node) |
320 : Node(node), graph(&_graph) {} |
320 : Node(node), graph(&_graph) {} |
321 |
321 |
322 UpperNodeIt& operator++() { |
322 ANodeIt& operator++() { |
323 graph->nextUpper(*this); |
323 graph->nextANode(*this); |
324 return *this; |
324 return *this; |
325 } |
325 } |
326 }; |
326 }; |
327 |
327 |
328 class LowerNodeIt : public Node { |
328 class BNodeIt : public Node { |
329 friend class IterableUBipartiteGraphExtender; |
329 friend class IterableBpUGraphExtender; |
330 const Graph* graph; |
330 const Graph* graph; |
331 public: |
331 public: |
332 |
332 |
333 LowerNodeIt() { } |
333 BNodeIt() { } |
334 |
334 |
335 LowerNodeIt(Invalid i) : Node(INVALID) { } |
335 BNodeIt(Invalid i) : Node(INVALID) { } |
336 |
336 |
337 explicit LowerNodeIt(const Graph& _graph) : graph(&_graph) { |
337 explicit BNodeIt(const Graph& _graph) : graph(&_graph) { |
338 graph->firstLower(static_cast<Node&>(*this)); |
338 graph->firstBNode(static_cast<Node&>(*this)); |
339 } |
339 } |
340 |
340 |
341 LowerNodeIt(const Graph& _graph, const Node& node) |
341 BNodeIt(const Graph& _graph, const Node& node) |
342 : Node(node), graph(&_graph) {} |
342 : Node(node), graph(&_graph) {} |
343 |
343 |
344 LowerNodeIt& operator++() { |
344 BNodeIt& operator++() { |
345 graph->nextLower(*this); |
345 graph->nextBNode(*this); |
346 return *this; |
346 return *this; |
347 } |
347 } |
348 }; |
348 }; |
349 |
349 |
350 class EdgeIt : public Edge { |
350 class EdgeIt : public Edge { |
351 friend class IterableUBipartiteGraphExtender; |
351 friend class IterableBpUGraphExtender; |
352 const Graph* graph; |
352 const Graph* graph; |
353 public: |
353 public: |
354 |
354 |
355 EdgeIt() { } |
355 EdgeIt() { } |
356 |
356 |