COIN-OR::LEMON - Graph Library

Changeset 1679:e825655c24a4 in lemon-0.x


Ignore:
Timestamp:
09/12/05 11:15:59 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2198
Message:

Some bugfixes.

Location:
lemon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_utils.h

    r1674 r1679  
    160160  }
    161161
     162  /// \brief Function to count the number of the in-edges to node \c n.
     163  ///
     164  /// This function counts the number of the in-edges to node \c n
     165  /// in the graph. 
     166  template <typename Graph>
     167  inline int countIncEdges(const Graph& _g,  const typename Graph::Node& _n) {
     168    return countNodeDegree<Graph, typename Graph::IncEdgeIt>(_g, _n);
     169  }
     170
    162171
    163172  template <typename Graph>
     
    913922    /// \param edge The edge
    914923    /// \return The source of the edge
    915     Value operator[](const Key& edge) {
     924    Value operator[](const Key& edge) const {
    916925      return graph.source(edge);
    917926    }
     
    954963    /// \param e The edge
    955964    /// \return The target of the edge
    956     Value operator[](const Key& e) {
     965    Value operator[](const Key& e) const {
    957966      return graph.target(e);
    958967    }
  • lemon/kruskal.h

    r1631 r1679  
    230230    {
    231231      for(typename GR::UndirEdgeIt e(g);e!=INVALID;++e)
    232         push_back(value_type(typename GR::Edge(e,true), m[e]));
     232        push_back(value_type(g.direct(e, true), m[e]));
    233233    }
    234234
  • lemon/maps.h

    r1675 r1679  
    710710           typename NC = False>
    711711  class FunctorMap : public MapBase<K, V, NC> {
    712     const F &f;
     712    F f;
    713713  public:
    714714    typedef MapBase<K, V, NC> Parent;
     
    717717
    718718    ///Constructor
    719     FunctorMap(const F &_f) : f(_f) {};
    720     Value operator[](Key k) const {return f(k);}
     719    FunctorMap(const F &_f) : f(_f) {}
     720
     721    Value operator[](Key k) const { return f(k);}
    721722  };
    722723 
     
    735736  FunctorMap<F, typename F::argument_type, typename F::result_type, True>
    736737  functorMap(const F &f) {
    737     return functorMap<typename F::argument_type,
    738       typename F::result_type, F>(f);
     738    return FunctorMap<F, typename F::argument_type,
     739      typename F::result_type, True>(f);
    739740  }
    740741
    741742  template <typename K, typename V> inline
    742743  FunctorMap<V (*)(K), K, V, True> functorMap(V (*f)(K)) {
    743     return functorMap<K, V, V (*)(K)>(f);
     744    return FunctorMap<V (*)(K), K, V, True>(f);
    744745  }
    745746
Note: See TracChangeset for help on using the changeset viewer.