1.1 --- a/src/work/jacint/max_matching.h Fri May 07 21:16:26 2004 +0000
1.2 +++ b/src/work/jacint/max_matching.h Sat May 08 08:18:44 2004 +0000
1.3 @@ -71,7 +71,7 @@
1.4
1.5 public:
1.6
1.7 - MaxMatching(Graph& _G) : G(_G), mate(_G,INVALID), position(_G,C) {}
1.8 + MaxMatching(const Graph& _G) : G(_G), mate(_G,INVALID), position(_G,C) {}
1.9
1.10 ///Runs Edmonds' algorithm.
1.11
1.12 @@ -79,7 +79,7 @@
1.13 ///2*nodeNum), and a heuristical Edmonds' algorithm with a
1.14 ///heuristic of postponing shrinks for dense graphs. \pre Before
1.15 ///the subsequent calls \ref resetPos must be called.
1.16 - void run();
1.17 + inline void run();
1.18
1.19 ///Runs Edmonds' algorithm.
1.20
1.21 @@ -99,7 +99,7 @@
1.22
1.23 ///Returns the size of the actual matching stored. After \ref
1.24 ///run() it returns the size of a maximum matching in the graph.
1.25 - int size();
1.26 + int size () const;
1.27
1.28 ///Resets the map storing the Gallai-Edmonds decomposition.
1.29
1.30 @@ -134,7 +134,7 @@
1.31 ///resulting map will be \e symmetric, i.e. if \c map[u]=v then \c
1.32 ///map[v]=u will hold, and now \c uv is an edge of the matching.
1.33 template<typename NMapN>
1.34 - void writeNMapNode(NMapN& map) {
1.35 + void writeNMapNode (NMapN& map) const {
1.36 NodeIt v;
1.37 for( G.first(v); G.valid(v); G.next(v)) {
1.38 map.set(v,mate[v]);
1.39 @@ -164,7 +164,7 @@
1.40 ///G.bNode(map[u])=v then \c G.bNode(map[v])=u holds, and now this
1.41 ///edge is an edge of the matching.
1.42 template<typename NMapE>
1.43 - void writeNMapEdge(NMapE& map) {
1.44 + void writeNMapEdge (NMapE& map) const {
1.45 typename Graph::template NodeMap<bool> todo(G,false);
1.46 NodeIt v;
1.47 for( G.first(v); G.valid(v); G.next(v)) {
1.48 @@ -212,7 +212,7 @@
1.49 ///\c e, \c f with \c map[e]=map[f]=true. The edges \c e with \c
1.50 ///map[e]=true form the matching.
1.51 template<typename EMapB>
1.52 - void writeEMapBool(EMapB& map) {
1.53 + void writeEMapBool (EMapB& map) const {
1.54 typename Graph::template NodeMap<bool> todo(G,false);
1.55 NodeIt v;
1.56 for( G.first(v); G.valid(v); G.next(v)) {
1.57 @@ -241,7 +241,7 @@
1.58 ///\ref resetPos(), it writes the Gallai-Edmonds canonical
1.59 ///decomposition of the graph. \c map must be a node map of \ref pos_enum 's.
1.60 template<typename NMapEnum>
1.61 - void writePos(NMapEnum& map) {
1.62 + void writePos (NMapEnum& map) const {
1.63 NodeIt v;
1.64 for( G.first(v); G.valid(v); G.next(v)) map.set(v,position[v]);
1.65 }
1.66 @@ -456,7 +456,7 @@
1.67 }
1.68
1.69 template <typename Graph>
1.70 - int MaxMatching<Graph>::size() {
1.71 + int MaxMatching<Graph>::size() const {
1.72 int s=0;
1.73 NodeIt v;
1.74 for(G.first(v); G.valid(v); G.next(v) ) {