# HG changeset patch # User deba # Date 1126516559 0 # Node ID e825655c24a4bf05d265514743a5ae5da49ee1ec # Parent b7b7125a5fe81b18019e0be602b497c78ab03cc0 Some bugfixes. diff -r b7b7125a5fe8 -r e825655c24a4 lemon/graph_utils.h --- a/lemon/graph_utils.h Mon Sep 12 05:35:36 2005 +0000 +++ b/lemon/graph_utils.h Mon Sep 12 09:15:59 2005 +0000 @@ -159,6 +159,15 @@ return countNodeDegree(_g, _n); } + /// \brief Function to count the number of the in-edges to node \c n. + /// + /// This function counts the number of the in-edges to node \c n + /// in the graph. + template + inline int countIncEdges(const Graph& _g, const typename Graph::Node& _n) { + return countNodeDegree(_g, _n); + } + template inline @@ -912,7 +921,7 @@ /// The subscript operator. /// \param edge The edge /// \return The source of the edge - Value operator[](const Key& edge) { + Value operator[](const Key& edge) const { return graph.source(edge); } @@ -953,7 +962,7 @@ /// The subscript operator. /// \param e The edge /// \return The target of the edge - Value operator[](const Key& e) { + Value operator[](const Key& e) const { return graph.target(e); } diff -r b7b7125a5fe8 -r e825655c24a4 lemon/kruskal.h --- a/lemon/kruskal.h Mon Sep 12 05:35:36 2005 +0000 +++ b/lemon/kruskal.h Mon Sep 12 09:15:59 2005 +0000 @@ -229,7 +229,7 @@ fillWithEdges(const _GR& g, const Map& m,dummy<0> = 0) { for(typename GR::UndirEdgeIt e(g);e!=INVALID;++e) - push_back(value_type(typename GR::Edge(e,true), m[e])); + push_back(value_type(g.direct(e, true), m[e])); } template diff -r b7b7125a5fe8 -r e825655c24a4 lemon/maps.h --- a/lemon/maps.h Mon Sep 12 05:35:36 2005 +0000 +++ b/lemon/maps.h Mon Sep 12 09:15:59 2005 +0000 @@ -709,15 +709,16 @@ typename V = typename F::result_type, typename NC = False> class FunctorMap : public MapBase { - const F &f; + F f; public: typedef MapBase Parent; typedef typename Parent::Key Key; typedef typename Parent::Value Value; ///Constructor - FunctorMap(const F &_f) : f(_f) {}; - Value operator[](Key k) const {return f(k);} + FunctorMap(const F &_f) : f(_f) {} + + Value operator[](Key k) const { return f(k);} }; ///Returns a \ref FunctorMap class @@ -734,13 +735,13 @@ template inline FunctorMap functorMap(const F &f) { - return functorMap(f); + return FunctorMap(f); } template inline FunctorMap functorMap(V (*f)(K)) { - return functorMap(f); + return FunctorMap(f); }