Changeset 497:500456d50d21 in lemon-0.x
- Timestamp:
- 04/30/04 18:10:49 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@657
- Location:
- src/work/marci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/bipartite_graph_wrapper.h
r496 r497 27 27 template<typename Graph> 28 28 class BipartiteGraphWrapper : public GraphWrapper<Graph> { 29 protected: 29 30 typedef IterableBoolMap< typename Graph::template NodeMap<int> > 30 31 SFalseTTrueMap; 31 32 SFalseTTrueMap* s_false_t_true_map; 33 34 BipartiteGraphWrapper() : GraphWrapper<Graph>(0) { } 35 void setSFalseTTrueMap(SFalseTTrueMap& _s_false_t_true_map) { 36 s_false_t_true_map=_s_false_t_true_map; 37 } 32 38 33 39 public: … … 176 182 } 177 183 }; 184 185 ///\bug Do not use this while the bipartitemap augmentation 186 /// does not work well. 187 template<typename Graph> 188 class BipartiteGraph : public BipartiteGraphWrapper<Graph> { 189 typedef IterableBoolMap< typename Graph::template NodeMap<int> > 190 SFalseTTrueMap; 191 typedef BipartiteGraphWrapper<Graph> Parent; 192 protected: 193 Graph gr; 194 typename Graph::template NodeMap<int> bipartite_map; 195 SFalseTTrueMap s_false_t_true_map; 196 public: 197 typedef typename Parent::Node Node; 198 typedef typename Parent::Edge Edge; 199 BipartiteGraph() : BipartiteGraphWrapper<Graph>(0), 200 gr(), bipartite_map(gr), 201 s_false_t_true_map(bipartite_map) { 202 Parent::setGraph(gr); 203 Parent::setSFalseTTrueMap(bipartite_map); 204 } 205 206 /// the \c bool parameter which can be \c S_Class or \c T_Class shows 207 /// the color class where the new node is to be inserted. 208 void addNode(bool); 209 210 /// A new edge is inserted. 211 ///\pre \c tail have to be in \c S_Class and \c head in \c T_Class. 212 void addEdge(const Node& tail, const Node& head); 213 214 void erase(const Node&); 215 void erase(const Edge&); 216 217 void clear() { 218 FOR_EACH_LOC(typename Parent::EdgeIt, e, G) erase(e); 219 FOR_EACH_LOC(typename Parent::NodeIt, n, G) erase(n); 220 } 221 }; 222 178 223 179 224 template<typename Graph> -
src/work/marci/graph_wrapper.h
r496 r497 89 89 protected: 90 90 Graph* graph; 91 91 GraphWrapper() : graph(0) { } 92 void setGraph(Graph& _graph) { graph=&_graph; } 93 92 94 public: 93 95 typedef Graph BaseGraph; 94 96 typedef Graph ParentGraph; 95 97 96 // GraphWrapper() : graph(0) { }97 98 GraphWrapper(Graph& _graph) : graph(&_graph) { } 98 // void setGraph(Graph& _graph) { graph=&_graph; }99 99 // Graph& getGraph() const { return *graph; } 100 100 … … 226 226 template<typename Graph> 227 227 class RevGraphWrapper : public GraphWrapper<Graph> { 228 protected: 229 RevGraphWrapper() : GraphWrapper<Graph>(0) { } 228 230 public: 229 230 231 RevGraphWrapper(Graph& _graph) : GraphWrapper<Graph>(_graph) { } 231 232 … … 306 307 NodeFilterMap* node_filter_map; 307 308 EdgeFilterMap* edge_filter_map; 309 310 SubGraphWrapper() : GraphWrapper<Graph>(0), 311 node_filter_map(0), edge_filter_map(0) { } 312 void setNodeFilterMap(NodeFilterMap& _node_filter_map) { 313 node_filter_map=&_node_filte_map; 314 } 315 void setEdgeFilterMap(EdgeFilterMap& _edge_filter_map) { 316 edge_filter_map=&_edge_filte_map; 317 } 318 308 319 public: 309 320 … … 454 465 template<typename Graph> 455 466 class UndirGraphWrapper : public GraphWrapper<Graph> { 467 protected: 468 UndirGraphWrapper() : GraphWrapper<Graph>(0) { } 469 456 470 public: 457 471 typedef typename GraphWrapper<Graph>::Node Node; … … 537 551 const CapacityMap* capacity; 538 552 FlowMap* flow; 553 554 ResGraphWrapper() : GraphWrapper<Graph>(0), 555 capacity(0), flow(0) { } 556 void setCapacityMap(const CapacityMap& _capacity_map) { 557 capacity_map=&_capacity_map; 558 } 559 void setFlowMap(FlowMap& _flow) { 560 flow=&_flow; 561 } 562 539 563 public: 540 564
Note: See TracChangeset
for help on using the changeset viewer.