# HG changeset patch # User Alpar Juttner # Date 1257398778 -3600 # Node ID 9fbbd802020f985dc6bb617408770635471940f6 # Parent 53bea38f71cb956baff9538d56fc5dffd4caa0ec# Parent 48fe2a46bf915250bfa2736e045c09e31fc3ef44 Merge #184 diff -r 53bea38f71cb -r 9fbbd802020f Makefile.am --- a/Makefile.am Sat Oct 10 08:19:26 2009 +0200 +++ b/Makefile.am Thu Nov 05 06:26:18 2009 +0100 @@ -17,6 +17,7 @@ cmake/FindCPLEX.cmake \ cmake/FindGLPK.cmake \ cmake/FindCOIN.cmake \ + cmake/LEMONConfig.cmake.in \ cmake/version.cmake.in \ cmake/version.cmake \ cmake/nsis/lemon.ico \ diff -r 53bea38f71cb -r 9fbbd802020f lemon/path.h --- a/lemon/path.h Sat Oct 10 08:19:26 2009 +0200 +++ b/lemon/path.h Thu Nov 05 06:26:18 2009 +0100 @@ -1015,18 +1015,20 @@ /// \brief The source of a path /// - /// This function returns the source of the given path. + /// This function returns the source node of the given path. + /// If the path is empty, then it returns \c INVALID. template typename Digraph::Node pathSource(const Digraph& digraph, const Path& path) { - return digraph.source(path.front()); + return path.empty() ? INVALID : digraph.source(path.front()); } /// \brief The target of a path /// - /// This function returns the target of the given path. + /// This function returns the target node of the given path. + /// If the path is empty, then it returns \c INVALID. template typename Digraph::Node pathTarget(const Digraph& digraph, const Path& path) { - return digraph.target(path.back()); + return path.empty() ? INVALID : digraph.target(path.back()); } /// \brief Class which helps to iterate through the nodes of a path