Merge #184
authorAlpar Juttner <alpar@cs.elte.hu>
Thu, 05 Nov 2009 06:26:18 +0100
changeset 8049fbbd802020f
parent 803 53bea38f71cb
parent 800 48fe2a46bf91
child 817 432c54cec63c
Merge #184
     1.1 --- a/Makefile.am	Sat Oct 10 08:19:26 2009 +0200
     1.2 +++ b/Makefile.am	Thu Nov 05 06:26:18 2009 +0100
     1.3 @@ -17,6 +17,7 @@
     1.4  	cmake/FindCPLEX.cmake \
     1.5  	cmake/FindGLPK.cmake \
     1.6  	cmake/FindCOIN.cmake \
     1.7 +	cmake/LEMONConfig.cmake.in \
     1.8  	cmake/version.cmake.in \
     1.9  	cmake/version.cmake \
    1.10  	cmake/nsis/lemon.ico \
     2.1 --- a/lemon/path.h	Sat Oct 10 08:19:26 2009 +0200
     2.2 +++ b/lemon/path.h	Thu Nov 05 06:26:18 2009 +0100
     2.3 @@ -1015,18 +1015,20 @@
     2.4  
     2.5    /// \brief The source of a path
     2.6    ///
     2.7 -  /// This function returns the source of the given path.
     2.8 +  /// This function returns the source node of the given path.
     2.9 +  /// If the path is empty, then it returns \c INVALID.
    2.10    template <typename Digraph, typename Path>
    2.11    typename Digraph::Node pathSource(const Digraph& digraph, const Path& path) {
    2.12 -    return digraph.source(path.front());
    2.13 +    return path.empty() ? INVALID : digraph.source(path.front());
    2.14    }
    2.15  
    2.16    /// \brief The target of a path
    2.17    ///
    2.18 -  /// This function returns the target of the given path.
    2.19 +  /// This function returns the target node of the given path.
    2.20 +  /// If the path is empty, then it returns \c INVALID.
    2.21    template <typename Digraph, typename Path>
    2.22    typename Digraph::Node pathTarget(const Digraph& digraph, const Path& path) {
    2.23 -    return digraph.target(path.back());
    2.24 +    return path.empty() ? INVALID : digraph.target(path.back());
    2.25    }
    2.26  
    2.27    /// \brief Class which helps to iterate through the nodes of a path