Changeset 967:6563019430ba in lemon0.x for src/lemon/graph_utils.h
 Timestamp:
 11/08/04 16:22:39 (16 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1354
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/lemon/graph_utils.h
r964 r967 90 90 } 91 91 return num; 92 } 93 94 /// Finds an edge between two nodes of a graph. 95 96 /// Finds an edge from node \c u to node \c v in graph \c g. 97 /// 98 /// If \c prev is \ref INVALID (this is the default value), then 99 /// it finds the first edge from \c u to \c v. Otherwise it looks for 100 /// the next edge from \c u to \c v after \c prev. 101 /// \return The found edge or \ref INVALID if there is no such an edge. 102 /// 103 /// Thus you can iterate through each edge from \c u to \c v as it follows. 104 /// \code 105 /// for(Edge e=findEdge(g,u,v);e!=INVALID;e=findEdge(g,u,v,e)) { 106 /// ... 107 /// } 108 /// \endcode 109 /// \todo We may want to use the \ref concept::GraphBase "GraphBase" 110 /// interface here... 111 /// \bug Untested ... 112 template <typename Graph> 113 typename Graph::Edge findEdge(const Graph &g, 114 typename Graph::Node u, typename Graph::Node v, 115 typename Graph::Edge prev = INVALID) 116 { 117 typename Graph::OutEdgeIt e(g,prev); 118 if(prev==INVALID) g.first(e,u); 119 else ++e; 120 while(e!=INVALID && g.tail(e)!=v) ++e; 121 return e; 92 122 } 93 123
Note: See TracChangeset
for help on using the changeset viewer.