diff -r c1e936e6a46b -r 27aa03cd3121 lemon/dag_shortest_path.h --- a/lemon/dag_shortest_path.h Fri Jan 05 10:59:18 2007 +0000 +++ b/lemon/dag_shortest_path.h Mon Jan 08 10:39:59 2007 +0000 @@ -722,26 +722,15 @@ ///@{ - /// \brief Copies the shortest path to \c t into \c p - /// - /// This function copies the shortest path to \c t into \c p. - /// If it \c t is a source itself or unreachable, then it does not - /// alter \c p. - /// - /// \return Returns \c true if a path to \c t was actually copied to \c p, - /// \c false otherwise. - /// \sa DirPath - template - bool getPath(Path &p, Node t) { - if(reached(t)) { - p.clear(); - typename Path::Builder b(p); - for(b.setStartNode(t);predEdge(t)!=INVALID;t=predNode(t)) - b.pushFront(predEdge(t)); - b.commit(); - return true; - } - return false; + typedef PredMapPath Path; + + ///Gives back the shortest path. + + ///Gives back the shortest path. + ///\pre The \c t should be reachable from the source. + Path path(Node t) + { + return Path(*graph, *_pred, t); } /// \brief The distance of a node from the root.