bipatite
authormarci
Fri, 30 Apr 2004 18:43:18 +0000
changeset 50120e4941a354a
parent 500 1a45623b4796
child 502 1b41ebb5fee5
bipatite
src/work/marci/bipartite_graph_wrapper.h
src/work/marci/bipartite_matching_try_2.cc
     1.1 --- a/src/work/marci/bipartite_graph_wrapper.h	Fri Apr 30 17:48:50 2004 +0000
     1.2 +++ b/src/work/marci/bipartite_graph_wrapper.h	Fri Apr 30 18:43:18 2004 +0000
     1.3 @@ -31,7 +31,8 @@
     1.4      SFalseTTrueMap;
     1.5      SFalseTTrueMap* s_false_t_true_map;
     1.6  
     1.7 -    BipartiteGraphWrapper() : GraphWrapper<Graph>() { }
     1.8 +    BipartiteGraphWrapper() : GraphWrapper<Graph>()/*, 
     1.9 +						     S_CLASS(false), T_CLASS(true)*/ { }
    1.10      void setSFalseTTrueMap(SFalseTTrueMap& _s_false_t_true_map) { 
    1.11        s_false_t_true_map=&_s_false_t_true_map;
    1.12      }
    1.13 @@ -39,16 +40,16 @@
    1.14    public:
    1.15      //marci
    1.16      //FIXME vhogy igy kellene, csak az en forditom nem eszi meg
    1.17 -    //static const bool S_CLASS=false;
    1.18 -    //static const bool T_CLASS=true;
    1.19 +    static const bool S_CLASS=false;
    1.20 +    static const bool T_CLASS=true;
    1.21      
    1.22 -    bool S_CLASS;
    1.23 -    bool T_CLASS;
    1.24 +    //bool S_CLASS;
    1.25 +    //bool T_CLASS;
    1.26  
    1.27      BipartiteGraphWrapper(Graph& _graph, SFalseTTrueMap& _s_false_t_true_map) 
    1.28        : GraphWrapper<Graph>(_graph), 
    1.29 -	s_false_t_true_map(&_s_false_t_true_map), 
    1.30 -	S_CLASS(false), T_CLASS(true) { }
    1.31 +	s_false_t_true_map(&_s_false_t_true_map)/*, 
    1.32 +						  S_CLASS(false), T_CLASS(true)*/ { }
    1.33      typedef typename GraphWrapper<Graph>::Node Node;
    1.34      //using GraphWrapper<Graph>::NodeIt;
    1.35      typedef typename GraphWrapper<Graph>::Edge Edge;
    1.36 @@ -209,6 +210,7 @@
    1.37      Node addNode(bool b) {
    1.38        Node n=Parent::graph->addNode();
    1.39        bipartite_map.update();
    1.40 +      //bipartite_map.set(n, -1);
    1.41        s_false_t_true_map.insert(n, b);
    1.42        return n;
    1.43      }
     2.1 --- a/src/work/marci/bipartite_matching_try_2.cc	Fri Apr 30 17:48:50 2004 +0000
     2.2 +++ b/src/work/marci/bipartite_matching_try_2.cc	Fri Apr 30 18:43:18 2004 +0000
     2.3 @@ -76,11 +76,14 @@
     2.4    FOR_EACH_LOC(EdgeIt, e, g) std::cout << e << " ";
     2.5    std::cout << std::endl;
     2.6  
     2.7 +  std::cout << "Nodes:" << std::endl;
     2.8 +  FOR_EACH_LOC(Graph::NodeIt, v, g) std::cout << v << " ";
     2.9 +  std::cout << std::endl;
    2.10    std::cout << "Nodes in T:" << std::endl;
    2.11 -  FOR_EACH_INC_LOC(Graph::ClassNodeIt, v, g, g.T_CLASS) std::cout << v << " ";
    2.12 +  FOR_EACH_INC_LOC(Graph::ClassNodeIt, v, g, Graph::T_CLASS) std::cout << v << " ";
    2.13    std::cout << std::endl;
    2.14    std::cout << "Nodes in S:" << std::endl;
    2.15 -  FOR_EACH_INC_LOC(Graph::ClassNodeIt, v, g, g.S_CLASS) std::cout << v << " ";
    2.16 +  FOR_EACH_INC_LOC(Graph::ClassNodeIt, v, g, Graph::S_CLASS) std::cout << v << " ";
    2.17    std::cout << std::endl;
    2.18  
    2.19    std::cout << "Erasing the first node..." << std::endl;
    2.20 @@ -92,10 +95,10 @@
    2.21    std::cout << std::endl;
    2.22  
    2.23    std::cout << "Nodes in T:" << std::endl;
    2.24 -  FOR_EACH_INC_LOC(Graph::ClassNodeIt, v, g, g.T_CLASS) std::cout << v << " ";
    2.25 +  FOR_EACH_INC_LOC(Graph::ClassNodeIt, v, g, Graph::T_CLASS) std::cout << v << " ";
    2.26    std::cout << std::endl;
    2.27    std::cout << "Nodes in S:" << std::endl;
    2.28 -  FOR_EACH_INC_LOC(Graph::ClassNodeIt, v, g, g.S_CLASS) std::cout << v << " ";
    2.29 +  FOR_EACH_INC_LOC(Graph::ClassNodeIt, v, g, Graph::S_CLASS) std::cout << v << " ";
    2.30    std::cout << std::endl;
    2.31  
    2.32    typedef stGraphWrapper<Graph> stGW;