lemon/graph_utils.h
changeset 1955 daca31868d70
parent 1931 6abf67b02ff5
child 1956 a055123339d5
equal deleted inserted replaced
36:84b8b9401e50 37:d65ae80347c1
   256   /// it finds the first edge from \c u to \c v. Otherwise it looks for
   256   /// it finds the first edge from \c u to \c v. Otherwise it looks for
   257   /// the next edge from \c u to \c v after \c prev.
   257   /// the next edge from \c u to \c v after \c prev.
   258   /// \return The found edge or \ref INVALID if there is no such an edge.
   258   /// \return The found edge or \ref INVALID if there is no such an edge.
   259   ///
   259   ///
   260   /// Thus you can iterate through each edge from \c u to \c v as it follows.
   260   /// Thus you can iterate through each edge from \c u to \c v as it follows.
   261   /// \code
   261   ///\code
   262   /// for(Edge e=findEdge(g,u,v);e!=INVALID;e=findEdge(g,u,v,e)) {
   262   /// for(Edge e=findEdge(g,u,v);e!=INVALID;e=findEdge(g,u,v,e)) {
   263   ///   ...
   263   ///   ...
   264   /// }
   264   /// }
   265   /// \endcode
   265   ///\endcode
   266   // /// \todo We may want to use the "GraphBase" 
   266   // /// \todo We may want to use the "GraphBase" 
   267   // /// interface here...
   267   // /// interface here...
   268   template <typename Graph>
   268   template <typename Graph>
   269   inline typename Graph::Edge findEdge(const Graph &g,
   269   inline typename Graph::Edge findEdge(const Graph &g,
   270 				       typename Graph::Node u, 
   270 				       typename Graph::Node u, 
   276   /// \brief Iterator for iterating on edges connected the same nodes.
   276   /// \brief Iterator for iterating on edges connected the same nodes.
   277   ///
   277   ///
   278   /// Iterator for iterating on edges connected the same nodes. It is 
   278   /// Iterator for iterating on edges connected the same nodes. It is 
   279   /// higher level interface for the findEdge() function. You can
   279   /// higher level interface for the findEdge() function. You can
   280   /// use it the following way:
   280   /// use it the following way:
   281   /// \code
   281   ///\code
   282   /// for (ConEdgeIt<Graph> it(g, src, trg); it != INVALID; ++it) {
   282   /// for (ConEdgeIt<Graph> it(g, src, trg); it != INVALID; ++it) {
   283   ///   ...
   283   ///   ...
   284   /// }
   284   /// }
   285   /// \endcode
   285   ///\endcode
   286   ///
   286   ///
   287   /// \author Balazs Dezso 
   287   /// \author Balazs Dezso 
   288   template <typename _Graph>
   288   template <typename _Graph>
   289   class ConEdgeIt : public _Graph::Edge {
   289   class ConEdgeIt : public _Graph::Edge {
   290   public:
   290   public:
   358   /// it finds the first edge from \c u to \c v. Otherwise it looks for
   358   /// it finds the first edge from \c u to \c v. Otherwise it looks for
   359   /// the next edge from \c u to \c v after \c prev.
   359   /// the next edge from \c u to \c v after \c prev.
   360   /// \return The found edge or \ref INVALID if there is no such an edge.
   360   /// \return The found edge or \ref INVALID if there is no such an edge.
   361   ///
   361   ///
   362   /// Thus you can iterate through each edge from \c u to \c v as it follows.
   362   /// Thus you can iterate through each edge from \c u to \c v as it follows.
   363   /// \code
   363   ///\code
   364   /// for(UEdge e = findUEdge(g,u,v); e != INVALID; 
   364   /// for(UEdge e = findUEdge(g,u,v); e != INVALID; 
   365   ///     e = findUEdge(g,u,v,e)) {
   365   ///     e = findUEdge(g,u,v,e)) {
   366   ///   ...
   366   ///   ...
   367   /// }
   367   /// }
   368   /// \endcode
   368   ///\endcode
   369   // /// \todo We may want to use the "GraphBase" 
   369   // /// \todo We may want to use the "GraphBase" 
   370   // /// interface here...
   370   // /// interface here...
   371   template <typename Graph>
   371   template <typename Graph>
   372   inline typename Graph::UEdge 
   372   inline typename Graph::UEdge 
   373   findUEdge(const Graph &g,
   373   findUEdge(const Graph &g,
   380   /// \brief Iterator for iterating on uedges connected the same nodes.
   380   /// \brief Iterator for iterating on uedges connected the same nodes.
   381   ///
   381   ///
   382   /// Iterator for iterating on uedges connected the same nodes. It is 
   382   /// Iterator for iterating on uedges connected the same nodes. It is 
   383   /// higher level interface for the findUEdge() function. You can
   383   /// higher level interface for the findUEdge() function. You can
   384   /// use it the following way:
   384   /// use it the following way:
   385   /// \code
   385   ///\code
   386   /// for (ConUEdgeIt<Graph> it(g, src, trg); it != INVALID; ++it) {
   386   /// for (ConUEdgeIt<Graph> it(g, src, trg); it != INVALID; ++it) {
   387   ///   ...
   387   ///   ...
   388   /// }
   388   /// }
   389   /// \endcode
   389   ///\endcode
   390   ///
   390   ///
   391   /// \author Balazs Dezso 
   391   /// \author Balazs Dezso 
   392   template <typename _Graph>
   392   template <typename _Graph>
   393   class ConUEdgeIt : public _Graph::UEdge {
   393   class ConUEdgeIt : public _Graph::UEdge {
   394   public:
   394   public:
   578   /// \brief Copy a graph to an other graph.
   578   /// \brief Copy a graph to an other graph.
   579   ///
   579   ///
   580   /// Copy a graph to an other graph.
   580   /// Copy a graph to an other graph.
   581   /// The usage of the function:
   581   /// The usage of the function:
   582   /// 
   582   /// 
   583   /// \code
   583   ///\code
   584   /// copyGraph(trg, src).nodeRef(nr).edgeCrossRef(ecr);
   584   /// copyGraph(trg, src).nodeRef(nr).edgeCrossRef(ecr);
   585   /// \endcode
   585   ///\endcode
   586   /// 
   586   /// 
   587   /// After the copy the \c nr map will contain the mapping from the
   587   /// After the copy the \c nr map will contain the mapping from the
   588   /// source graph's nodes to the target graph's nodes and the \c ecr will
   588   /// source graph's nodes to the target graph's nodes and the \c ecr will
   589   /// contain the mapping from the target graph's edges to the source's
   589   /// contain the mapping from the target graph's edges to the source's
   590   /// edges.
   590   /// edges.
   790   /// \brief Copy a graph to an other graph.
   790   /// \brief Copy a graph to an other graph.
   791   ///
   791   ///
   792   /// Copy a graph to an other graph.
   792   /// Copy a graph to an other graph.
   793   /// The usage of the function:
   793   /// The usage of the function:
   794   /// 
   794   /// 
   795   /// \code
   795   ///\code
   796   /// copyGraph(trg, src).nodeRef(nr).edgeCrossRef(ecr);
   796   /// copyGraph(trg, src).nodeRef(nr).edgeCrossRef(ecr);
   797   /// \endcode
   797   ///\endcode
   798   /// 
   798   /// 
   799   /// After the copy the \c nr map will contain the mapping from the
   799   /// After the copy the \c nr map will contain the mapping from the
   800   /// source graph's nodes to the target graph's nodes and the \c ecr will
   800   /// source graph's nodes to the target graph's nodes and the \c ecr will
   801   /// contain the mapping from the target graph's edges to the source's
   801   /// contain the mapping from the target graph's edges to the source's
   802   /// edges.
   802   /// edges.