diff -r 7c463a7635d4 -r 500456d50d21 src/work/marci/bipartite_graph_wrapper.h --- a/src/work/marci/bipartite_graph_wrapper.h Fri Apr 30 14:02:10 2004 +0000 +++ b/src/work/marci/bipartite_graph_wrapper.h Fri Apr 30 16:10:49 2004 +0000 @@ -26,10 +26,16 @@ ///\author Marton Makai template class BipartiteGraphWrapper : public GraphWrapper { + protected: typedef IterableBoolMap< typename Graph::template NodeMap > SFalseTTrueMap; SFalseTTrueMap* s_false_t_true_map; + BipartiteGraphWrapper() : GraphWrapper(0) { } + void setSFalseTTrueMap(SFalseTTrueMap& _s_false_t_true_map) { + s_false_t_true_map=_s_false_t_true_map; + } + public: //marci //FIXME vhogy igy kellene, csak az en forditom nem eszi meg @@ -176,6 +182,45 @@ } }; + ///\bug Do not use this while the bipartitemap augmentation + /// does not work well. + template + class BipartiteGraph : public BipartiteGraphWrapper { + typedef IterableBoolMap< typename Graph::template NodeMap > + SFalseTTrueMap; + typedef BipartiteGraphWrapper Parent; + protected: + Graph gr; + typename Graph::template NodeMap bipartite_map; + SFalseTTrueMap s_false_t_true_map; + public: + typedef typename Parent::Node Node; + typedef typename Parent::Edge Edge; + BipartiteGraph() : BipartiteGraphWrapper(0), + gr(), bipartite_map(gr), + s_false_t_true_map(bipartite_map) { + Parent::setGraph(gr); + Parent::setSFalseTTrueMap(bipartite_map); + } + + /// the \c bool parameter which can be \c S_Class or \c T_Class shows + /// the color class where the new node is to be inserted. + void addNode(bool); + + /// A new edge is inserted. + ///\pre \c tail have to be in \c S_Class and \c head in \c T_Class. + void addEdge(const Node& tail, const Node& head); + + void erase(const Node&); + void erase(const Edge&); + + void clear() { + FOR_EACH_LOC(typename Parent::EdgeIt, e, G) erase(e); + FOR_EACH_LOC(typename Parent::NodeIt, n, G) erase(n); + } + }; + + template class stGraphWrapper;