Changeset 1627:3fd1ba6e9872 in lemon0.x for lemon/bits/undir_graph_extender.h
 Timestamp:
 08/11/05 17:55:17 (14 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2135
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/bits/undir_graph_extender.h
r1435 r1627 43 43 bool forward; 44 44 45 Edge(const UndirEdge &ue, bool _forward) : 46 UndirEdge(ue), forward(_forward) {} 47 45 48 public: 46 49 Edge() {} 47 48 /// \brief Directed edge from undirected edge and a direction.49 ///50 /// This constructor is not a part of the concept interface of51 /// undirected graph, so please avoid using it if possible!52 Edge(const UndirEdge &ue, bool _forward) :53 UndirEdge(ue), forward(_forward) {}54 55 /// \brief Directed edge from undirected edge and a source node.56 ///57 /// Constructs a directed edge from undirected edge and a source node.58 ///59 /// \note You have to specify the graph for this constructor.60 Edge(const Graph &g, const UndirEdge &ue, const Node &n) :61 UndirEdge(ue) { forward = (g.source(ue) == n); }62 50 63 51 /// Invalid edge constructor … … 80 68 /// 81 69 /// Returns the Edge of opposite direction. 82 Edge opposite (const Edge &e) const {70 Edge oppositeEdge(const Edge &e) const { 83 71 return Edge(e,!e.forward); 84 72 } … … 114 102 return _dirTarget(e); 115 103 } 116 117 /// Returns whether the given directed edge is same orientation as the118 /// corresponding undirected edge.119 ///120 /// \todo reference to the corresponding point of the undirected graph121 /// concept. "What does the direction of an undirected edge mean?"122 bool forward(const Edge &e) const { return e.forward; }123 104 124 105 Node oppositeNode(const Node &n, const UndirEdge &e) const { … … 131 112 } 132 113 133 /// Directed edge from an undirected edge and a source node.114 /// \brief Directed edge from an undirected edge and a source node. 134 115 /// 135 116 /// Returns a (directed) Edge corresponding to the specified UndirEdge 136 117 /// and source Node. 137 118 /// 138 ///\todo Do we need this? 139 /// 140 ///\todo Better name... 141 Edge edgeWithSource(const UndirEdge &ue, const Node &s) const { 142 return Edge(*this, ue, s); 143 } 119 Edge direct(const UndirEdge &ue, const Node &s) const { 120 return Edge(ue, s == source(ue)); 121 } 122 123 /// \brief Directed edge from an undirected edge. 124 /// 125 /// Returns a directed edge corresponding to the specified UndirEdge. 126 /// If the given bool is true the given undirected edge and the 127 /// returned edge have the same source node. 128 Edge direct(const UndirEdge &ue, bool d) const { 129 return Edge(ue, d); 130 } 131 132 /// Returns whether the given directed edge is same orientation as the 133 /// corresponding undirected edge. 134 /// 135 /// \todo reference to the corresponding point of the undirected graph 136 /// concept. "What does the direction of an undirected edge mean?" 137 bool direction(const Edge &e) const { return e.forward; } 138 144 139 145 140 using Parent::first;
Note: See TracChangeset
for help on using the changeset viewer.