[Lemon-commits] [lemon_svn] jacint: r759 - hugo/trunk/src/work/jacint

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:41:21 CET 2006


Author: jacint
Date: Sat May  8 10:18:44 2004
New Revision: 759

Modified:
   hugo/trunk/src/work/jacint/max_matching.h

Log:
aprosagok

Modified: hugo/trunk/src/work/jacint/max_matching.h
==============================================================================
--- hugo/trunk/src/work/jacint/max_matching.h	(original)
+++ hugo/trunk/src/work/jacint/max_matching.h	Sat May  8 10:18:44 2004
@@ -71,7 +71,7 @@
      
   public:
     
-    MaxMatching(Graph& _G) : G(_G), mate(_G,INVALID), position(_G,C) {}
+    MaxMatching(const Graph& _G) : G(_G), mate(_G,INVALID), position(_G,C) {}
 
     ///Runs Edmonds' algorithm.
 
@@ -79,7 +79,7 @@
     ///2*nodeNum), and a heuristical Edmonds' algorithm with a
     ///heuristic of postponing shrinks for dense graphs. \pre Before
     ///the subsequent calls \ref resetPos must be called.
-    void run();
+    inline void run();
 
     ///Runs Edmonds' algorithm.
     
@@ -99,7 +99,7 @@
 
     ///Returns the size of the actual matching stored. After \ref
     ///run() it returns the size of a maximum matching in the graph.
-    int size();
+    int size () const;
 
     ///Resets the map storing the Gallai-Edmonds decomposition.
     
@@ -134,7 +134,7 @@
     ///resulting map will be \e symmetric, i.e. if \c map[u]=v then \c
     ///map[v]=u will hold, and now \c uv is an edge of the matching.
     template<typename NMapN>
-    void writeNMapNode(NMapN& map) {
+    void writeNMapNode (NMapN& map) const {
       NodeIt v;
       for( G.first(v); G.valid(v); G.next(v)) {
 	map.set(v,mate[v]);   
@@ -164,7 +164,7 @@
     ///G.bNode(map[u])=v then \c G.bNode(map[v])=u holds, and now this
     ///edge is an edge of the matching.
     template<typename NMapE>
-    void writeNMapEdge(NMapE& map)  {
+    void writeNMapEdge (NMapE& map)  const {
       typename Graph::template NodeMap<bool> todo(G,false); 
       NodeIt v;
       for( G.first(v); G.valid(v); G.next(v)) {
@@ -212,7 +212,7 @@
     ///\c e, \c f with \c map[e]=map[f]=true. The edges \c e with \c
     ///map[e]=true form the matching.
     template<typename EMapB>
-    void writeEMapBool(EMapB& map) {
+    void writeEMapBool (EMapB& map) const {
       typename Graph::template NodeMap<bool> todo(G,false); 
       NodeIt v;
       for( G.first(v); G.valid(v); G.next(v)) {
@@ -241,7 +241,7 @@
     ///\ref resetPos(), it writes the Gallai-Edmonds canonical
     ///decomposition of the graph. \c map must be a node map of \ref pos_enum 's.
     template<typename NMapEnum>
-    void writePos(NMapEnum& map)  {
+    void writePos (NMapEnum& map) const {
       NodeIt v;
       for( G.first(v); G.valid(v); G.next(v)) map.set(v,position[v]);
     }
@@ -456,7 +456,7 @@
   }
    
   template <typename Graph>
-  int MaxMatching<Graph>::size() {
+  int MaxMatching<Graph>::size() const {
     int s=0;
     NodeIt v;
     for(G.first(v); G.valid(v); G.next(v) ) {



More information about the Lemon-commits mailing list