Changeset 986:e997802b855c in lemon-0.x for src/work/marci/leda
- Timestamp:
- 11/13/04 13:53:28 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1376
- Location:
- src/work/marci/leda
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/leda/bipartite_matching_comparison.cc
r921 r986 130 130 131 131 FOR_EACH_LOC(BGW::EdgeIt, e, bgw) 132 hg.addEdge(b_s_nodes[bgw. tail(e)], b_t_nodes[bgw.head(e)]);132 hg.addEdge(b_s_nodes[bgw.source(e)], b_t_nodes[bgw.target(e)]); 133 133 134 134 ConstMap<SageGraph::Edge, int> cm(1); -
src/work/marci/leda/leda_graph_wrapper.h
r921 r986 214 214 // } 215 215 216 ///Gives back the headnode of an edge.217 Node head(Edge e) const {216 ///Gives back the target node of an edge. 217 Node target(Edge e) const { 218 218 return Node(l_graph->target(e.l_e)); 219 219 } 220 ///Gives back the tailnode of an edge.221 Node tail(Edge e) const {220 ///Gives back the source node of an edge. 221 Node source(Edge e) const { 222 222 return Node(l_graph->source(e.l_e)); 223 223 } 224 224 225 Node aNode(InEdgeIt e) const { return head(e); }226 Node aNode(OutEdgeIt e) const { return tail(e); }225 Node aNode(InEdgeIt e) const { return target(e); } 226 Node aNode(OutEdgeIt e) const { return source(e); } 227 227 // Node aNode(SymEdgeIt) const {} 228 228 229 Node bNode(InEdgeIt e) const { return tail(e); }230 Node bNode(OutEdgeIt e) const { return head(e); }229 Node bNode(InEdgeIt e) const { return source(e); } 230 Node bNode(OutEdgeIt e) const { return target(e); } 231 231 // Node bNode(SymEdgeIt) const {} 232 232 … … 245 245 246 246 Node addNode() const { return Node(l_graph->new_node()); } 247 Edge addEdge(Node tail, Node head) const {248 return Edge(l_graph->new_edge( tail.l_n, head.l_n));247 Edge addEdge(Node source, Node target) const { 248 return Edge(l_graph->new_edge(source.l_n, target.l_n)); 249 249 } 250 250 -
src/work/marci/leda/max_bipartite_matching_demo.cc
r921 r986 104 104 // cout << "out edges: "; 105 105 // for(OutEdgeIt e=G.first<OutEdgeIt>(n); G.valid(e); G.next(e)) 106 // cout << G.id(G. tail(e)) << "->" << G.id(G.head(e)) << " ";106 // cout << G.id(G.source(e)) << "->" << G.id(G.target(e)) << " "; 107 107 // cout << "in edges: "; 108 108 // for(InEdgeIt e=G.first<InEdgeIt>(n); G.valid(e); G.next(e)) 109 // cout << G.id(G. tail(e)) << "->" << G.id(G.head(e)) << " ";109 // cout << G.id(G.source(e)) << "->" << G.id(G.target(e)) << " "; 110 110 // cout << endl; 111 111 // } … … 124 124 while (max_flow_test.augmentOnShortestPath()) { 125 125 // for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e)) 126 // std::cout << G.id(G. tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";126 // std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " "; 127 127 // std::cout<<std::endl; 128 128 ++i; … … 132 132 // for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e)) 133 133 // if (flow.get(e)) 134 // std::cout << G.id(G. tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";134 // std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " "; 135 135 // std::cout<<std::endl; 136 136 // std::cout << "edges which are not in this maximum matching: "<< std::endl; 137 137 // for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e)) 138 138 // if (!flow.get(e)) 139 // std::cout << G.id(G. tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";139 // std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " "; 140 140 // std::cout<<std::endl; 141 141 … … 157 157 // while (max_flow_test.augmentOnBlockingFlow2()) { 158 158 // // for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e)) 159 // // std::cout << G.id(G. tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";159 // // std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " "; 160 160 // // std::cout<<std::endl; 161 161 // ++i; … … 165 165 // // for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e)) 166 166 // // if (flow.get(e)) 167 // // std::cout << G.id(G. tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";167 // // std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " "; 168 168 // // std::cout<<std::endl; 169 169 // // std::cout << "edges which are not in this maximum matching: "<< std::endl; 170 170 // // for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e)) 171 171 // // if (!flow.get(e)) 172 // // std::cout << G.id(G. tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";172 // // std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " "; 173 173 // // std::cout<<std::endl; 174 174 … … 199 199 // for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e)) 200 200 // if (flow.get(e)) 201 // std::cout << G.id(G. tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";201 // std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " "; 202 202 // std::cout<<std::endl; 203 203 // std::cout << "edges which are not in this maximum matching: "<< std::endl; 204 204 // for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e)) 205 205 // if (!flow.get(e)) 206 // std::cout << G.id(G. tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";206 // std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " "; 207 207 // std::cout<<std::endl; 208 208
Note: See TracChangeset
for help on using the changeset viewer.