Changeset 1158:29961fa390a3 in lemon-0.x for src/lemon/concept
- Timestamp:
- 02/20/05 02:02:07 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1559
- Location:
- src/lemon/concept
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/concept/graph_component.h
r1136 r1158 626 626 Edge e = it1; 627 627 e = it2; 628 } 629 630 Edge& edge; 631 Node& node; 632 Graph& graph; 628 629 const_constraits(); 630 } 631 632 void const_constraits() { 633 Node n = graph.baseNode(it); 634 n = graph.runningNode(it); 635 } 636 637 Edge edge; 638 Node node; 639 Graph graph; 640 _GraphIncIterator it; 633 641 }; 634 642 }; -
src/lemon/concept/undir_graph.h
r1030 r1158 37 37 /// Skeleton class which describes an edge with direction in \ref 38 38 /// UndirGraph "undirected graph". 39 template <typename UndirEdge> 40 class UndirGraphEdge : public UndirEdge { 39 template <typename UndirGraph> 40 class UndirGraphEdge : public UndirGraph::UndirEdge { 41 typedef typename UndirGraph::UndirEdge UndirEdge; 42 typedef typename UndirGraph::Node Node; 41 43 public: 42 44 … … 50 52 UndirGraphEdge(Invalid) {} 51 53 52 /// \brief Constructs a directed version of an undirected edge 53 /// 54 /// \param forward If \c true the direction of the contructed edge 55 /// is the same as the inherent direction of the \c undir_edge; if 56 /// \c false --- the opposite. 57 UndirGraphEdge(UndirEdge undir_edge, bool forward) { 54 /// \brief Directed edge from undirected edge and a source node. 55 /// 56 /// Constructs a directed edge from undirected edge and a source node. 57 /// 58 /// \note You have to specify the graph for this constructor. 59 UndirGraphEdge(const UndirGraph &g, 60 UndirEdge undir_edge, Node n) { 58 61 ignore_unused_variable_warning(undir_edge); 59 ignore_unused_variable_warning(forward); 62 ignore_unused_variable_warning(g); 63 ignore_unused_variable_warning(n); 60 64 } 61 65 … … 74 78 struct Constraints { 75 79 void constraints() { 80 const_constraints(); 81 } 82 void const_constraints() const { 76 83 /// \bug This should be is_base_and_derived ... 77 84 UndirEdge ue = e; 78 85 ue = e; 79 Edge forward(ue, true); 80 Edge backward(ue, false); 81 82 ignore_unused_variable_warning(forward); 83 ignore_unused_variable_warning(backward); 86 87 Edge e_with_source(graph,ue,n); 88 ignore_unused_variable_warning(e_with_source); 84 89 } 85 90 Edge e; 91 UndirEdge ue; 92 UndirGraph graph; 93 Node n; 86 94 }; 87 95 }; … … 100 108 checkConcept<BaseIterableGraphComponent, Graph>(); 101 109 checkConcept<GraphItem<>, UndirEdge>(); 102 checkConcept<UndirGraphEdge< UndirEdge>, Edge>();110 checkConcept<UndirGraphEdge<Graph>, Edge>(); 103 111 104 112 graph.first(ue); … … 235 243 /// Type describing an UndirEdge with direction 236 244 #ifndef DOXYGEN 237 typedef UndirGraphEdge<Undir Edge> Edge;245 typedef UndirGraphEdge<UndirGraph> Edge; 238 246 #else 239 247 typedef UndirGraphEdge Edge; … … 431 439 432 440 441 /// Base node of the iterator 442 /// 443 /// Returns the base node (the source in this case) of the iterator 444 Node baseNode(OutEdgeIt e) const { 445 return source(e); 446 } 447 /// Running node of the iterator 448 /// 449 /// Returns the running node (the target in this case) of the 450 /// iterator 451 Node runningNode(OutEdgeIt e) const { 452 return target(e); 453 } 454 455 /// Base node of the iterator 456 /// 457 /// Returns the base node (the target in this case) of the iterator 458 Node baseNode(InEdgeIt e) const { 459 return target(e); 460 } 461 /// Running node of the iterator 462 /// 463 /// Returns the running node (the source in this case) of the 464 /// iterator 465 Node runningNode(InEdgeIt e) const { 466 return source(e); 467 } 468 469 /// Base node of the iterator 470 /// 471 /// Returns the base node of the iterator 472 Node baseNode(IncEdgeIt e) const { 473 return INVALID; 474 } 475 /// Running node of the iterator 476 /// 477 /// Returns the running node of the iterator 478 Node runningNode(IncEdgeIt e) const { 479 return INVALID; 480 } 481 482 433 483 template <typename Graph> 434 484 struct Constraints {
Note: See TracChangeset
for help on using the changeset viewer.