# HG changeset patch # User marci # Date 1101145747 0 # Node ID ee01de62188daaca762d5f2907c3284832a92643 # Parent 68beae6758a75f68c1f386bc511a05fbf70ec8f3 the old-style codes are removed from comment diff -r 68beae6758a7 -r ee01de62188d src/lemon/graph_wrapper.h --- a/src/lemon/graph_wrapper.h Mon Nov 22 14:39:40 2004 +0000 +++ b/src/lemon/graph_wrapper.h Mon Nov 22 17:49:07 2004 +0000 @@ -125,7 +125,6 @@ public: GraphWrapperBase(Graph& _graph) : graph(&_graph) { } -// GraphWrapperBase(const GraphWrapperBase<_Graph>& gw) : graph(gw.graph) { } typedef typename Graph::Node Node; typedef typename Graph::Edge Edge; @@ -134,18 +133,6 @@ void first(Edge& i) const { graph->first(i); } void firstIn(Edge& i, const Node& n) const { graph->firstIn(i, n); } void firstOut(Edge& i, const Node& n ) const { graph->firstOut(i, n); } -// NodeIt& first(NodeIt& i) const { -// i=NodeIt(*this); return i; -// } -// OutEdgeIt& first(OutEdgeIt& i, const Node& p) const { -// i=OutEdgeIt(*this, p); return i; -// } -// InEdgeIt& first(InEdgeIt& i, const Node& p) const { -// i=InEdgeIt(*this, p); return i; -// } -// EdgeIt& first(EdgeIt& i) const { -// i=EdgeIt(*this); return i; -// } void next(Node& i) const { graph->next(i); } void next(Edge& i) const { graph->next(i); } @@ -154,10 +141,6 @@ Node source(const Edge& e) const { return graph->source(e); } Node target(const Edge& e) const { return graph->target(e); } -// Node source(const Edge& e) const { -// return Node(graph->source(static_cast(e))); } -// Node target(const Edge& e) const { -// return Node(graph->target(static_cast(e))); } int nodeNum() const { return graph->nodeNum(); } int edgeNum() const { return graph->edgeNum(); } @@ -271,71 +254,6 @@ public: RevGraphWrapper(_Graph& _graph) { setGraph(_graph); } }; -// template -// class RevGraphWrapper : public GraphWrapper { -// public: -// typedef GraphWrapper Parent; -// protected: -// RevGraphWrapper() : GraphWrapper() { } -// public: -// RevGraphWrapper(Graph& _graph) : GraphWrapper(_graph) { } -// RevGraphWrapper(const RevGraphWrapper& gw) : Parent(gw) { } - -// typedef typename GraphWrapper::Node Node; -// typedef typename GraphWrapper::Edge Edge; -// //remark: OutEdgeIt and InEdgeIt cannot be typedef-ed to each other -// //because this does not work is some of them are not defined in the -// //original graph. The problem with this is that typedef-ed stuff -// //are instantiated in c++. -// class OutEdgeIt : public Edge { -// const RevGraphWrapper* gw; -// friend class GraphWrapper; -// public: -// OutEdgeIt() { } -// OutEdgeIt(Invalid i) : Edge(i) { } -// OutEdgeIt(const RevGraphWrapper& _gw, const Node& n) : -// Edge(typename Graph::InEdgeIt(*(_gw.graph), n)), gw(&_gw) { } -// OutEdgeIt(const RevGraphWrapper& _gw, const Edge& e) : -// Edge(e), gw(&_gw) { } -// OutEdgeIt& operator++() { -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// return *this; -// } -// }; -// class InEdgeIt : public Edge { -// const RevGraphWrapper* gw; -// friend class GraphWrapper; -// public: -// InEdgeIt() { } -// InEdgeIt(Invalid i) : Edge(i) { } -// InEdgeIt(const RevGraphWrapper& _gw, const Node& n) : -// Edge(typename Graph::OutEdgeIt(*(_gw.graph), n)), gw(&_gw) { } -// InEdgeIt(const RevGraphWrapper& _gw, const Edge& e) : -// Edge(e), gw(&_gw) { } -// InEdgeIt& operator++() { -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// return *this; -// } -// }; - -// using GraphWrapper::first; -// OutEdgeIt& first(OutEdgeIt& i, const Node& p) const { -// i=OutEdgeIt(*this, p); return i; -// } -// InEdgeIt& first(InEdgeIt& i, const Node& p) const { -// i=InEdgeIt(*this, p); return i; -// } - -// Node source(const Edge& e) const { -// return GraphWrapper::target(e); } -// Node target(const Edge& e) const { -// return GraphWrapper::source(e); } - -// // KEEP_MAPS(Parent, RevGraphWrapper); - -// }; template @@ -516,195 +434,6 @@ } }; -// template -// class SubGraphWrapper : public GraphWrapper { -// public: -// typedef GraphWrapper Parent; -// protected: -// NodeFilterMap* node_filter_map; -// EdgeFilterMap* edge_filter_map; - -// SubGraphWrapper() : GraphWrapper(), -// node_filter_map(0), edge_filter_map(0) { } -// void setNodeFilterMap(NodeFilterMap& _node_filter_map) { -// node_filter_map=&_node_filter_map; -// } -// void setEdgeFilterMap(EdgeFilterMap& _edge_filter_map) { -// edge_filter_map=&_edge_filter_map; -// } - -// public: -// SubGraphWrapper(Graph& _graph, NodeFilterMap& _node_filter_map, -// EdgeFilterMap& _edge_filter_map) : -// GraphWrapper(_graph), node_filter_map(&_node_filter_map), -// edge_filter_map(&_edge_filter_map) { } - -// typedef typename GraphWrapper::Node Node; -// class NodeIt : public Node { -// const SubGraphWrapper* gw; -// friend class SubGraphWrapper; -// public: -// NodeIt() { } -// NodeIt(Invalid i) : Node(i) { } -// NodeIt(const SubGraphWrapper& _gw) : -// Node(typename Graph::NodeIt(*(_gw.graph))), gw(&_gw) { -// while (*static_cast(this)!=INVALID && -// !(*(gw->node_filter_map))[*this]) -// *(static_cast(this))= -// ++(typename Graph::NodeIt(*(gw->graph), *this)); -// } -// NodeIt(const SubGraphWrapper& _gw, -// const Node& n) : -// Node(n), gw(&_gw) { } -// NodeIt& operator++() { -// *(static_cast(this))= -// ++(typename Graph::NodeIt(*(gw->graph), *this)); -// while (*static_cast(this)!=INVALID && -// !(*(gw->node_filter_map))[*this]) -// *(static_cast(this))= -// ++(typename Graph::NodeIt(*(gw->graph), *this)); -// return *this; -// } -// }; -// typedef typename GraphWrapper::Edge Edge; -// class OutEdgeIt : public Edge { -// const SubGraphWrapper* gw; -// friend class SubGraphWrapper; -// public: -// OutEdgeIt() { } -// OutEdgeIt(Invalid i) : Edge(i) { } -// OutEdgeIt(const SubGraphWrapper& _gw, const Node& n) : -// Edge(typename Graph::OutEdgeIt(*(_gw.graph), n)), gw(&_gw) { -// while (*static_cast(this)!=INVALID && -// !(*(gw->edge_filter_map))[*this]) -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// } -// OutEdgeIt(const SubGraphWrapper& _gw, -// const Edge& e) : -// Edge(e), gw(&_gw) { } -// OutEdgeIt& operator++() { -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// while (*static_cast(this)!=INVALID && -// !(*(gw->edge_filter_map))[*this]) -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// return *this; -// } -// }; -// class InEdgeIt : public Edge { -// const SubGraphWrapper* gw; -// friend class SubGraphWrapper; -// public: -// InEdgeIt() { } -// // InEdgeIt(const InEdgeIt& e) : Edge(e), gw(e.gw) { } -// InEdgeIt(Invalid i) : Edge(i) { } -// InEdgeIt(const SubGraphWrapper& _gw, const Node& n) : -// Edge(typename Graph::InEdgeIt(*(_gw.graph), n)), gw(&_gw) { -// while (*static_cast(this)!=INVALID && -// !(*(gw->edge_filter_map))[*this]) -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// } -// InEdgeIt(const SubGraphWrapper& _gw, -// const Edge& e) : -// Edge(e), gw(&_gw) { } -// InEdgeIt& operator++() { -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// while (*static_cast(this)!=INVALID && -// !(*(gw->edge_filter_map))[*this]) -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// return *this; -// } -// }; -// class EdgeIt : public Edge { -// const SubGraphWrapper* gw; -// friend class SubGraphWrapper; -// public: -// EdgeIt() { } -// EdgeIt(Invalid i) : Edge(i) { } -// EdgeIt(const SubGraphWrapper& _gw) : -// Edge(typename Graph::EdgeIt(*(_gw.graph))), gw(&_gw) { -// while (*static_cast(this)!=INVALID && -// !(*(gw->edge_filter_map))[*this]) -// *(static_cast(this))= -// ++(typename Graph::EdgeIt(*(gw->graph), *this)); -// } -// EdgeIt(const SubGraphWrapper& _gw, -// const Edge& e) : -// Edge(e), gw(&_gw) { } -// EdgeIt& operator++() { -// *(static_cast(this))= -// ++(typename Graph::EdgeIt(*(gw->graph), *this)); -// while (*static_cast(this)!=INVALID && -// !(*(gw->edge_filter_map))[*this]) -// *(static_cast(this))= -// ++(typename Graph::EdgeIt(*(gw->graph), *this)); -// return *this; -// } -// }; - -// NodeIt& first(NodeIt& i) const { -// i=NodeIt(*this); return i; -// } -// OutEdgeIt& first(OutEdgeIt& i, const Node& p) const { -// i=OutEdgeIt(*this, p); return i; -// } -// InEdgeIt& first(InEdgeIt& i, const Node& p) const { -// i=InEdgeIt(*this, p); return i; -// } -// EdgeIt& first(EdgeIt& i) const { -// i=EdgeIt(*this); return i; -// } - -// /// This function hides \c n in the graph, i.e. the iteration -// /// jumps over it. This is done by simply setting the value of \c n -// /// to be false in the corresponding node-map. -// void hide(const Node& n) const { node_filter_map->set(n, false); } - -// /// This function hides \c e in the graph, i.e. the iteration -// /// jumps over it. This is done by simply setting the value of \c e -// /// to be false in the corresponding edge-map. -// void hide(const Edge& e) const { edge_filter_map->set(e, false); } - -// /// The value of \c n is set to be true in the node-map which stores -// /// hide information. If \c n was hidden previuosly, then it is shown -// /// again -// void unHide(const Node& n) const { node_filter_map->set(n, true); } - -// /// The value of \c e is set to be true in the edge-map which stores -// /// hide information. If \c e was hidden previuosly, then it is shown -// /// again -// void unHide(const Edge& e) const { edge_filter_map->set(e, true); } - -// /// Returns true if \c n is hidden. -// bool hidden(const Node& n) const { return !(*node_filter_map)[n]; } - -// /// Returns true if \c n is hidden. -// bool hidden(const Edge& e) const { return !(*edge_filter_map)[e]; } - -// /// \warning This is a linear time operation and works only if -// /// \c Graph::NodeIt is defined. -// int nodeNum() const { -// int i=0; -// for (NodeIt n(*this); n!=INVALID; ++n) ++i; -// return i; -// } - -// /// \warning This is a linear time operation and works only if -// /// \c Graph::EdgeIt is defined. -// int edgeNum() const { -// int i=0; -// for (EdgeIt e(*this); e!=INVALID; ++e) ++i; -// return i; -// } - -// // KEEP_MAPS(Parent, SubGraphWrapper); -// }; /*! \brief A wrapper for hiding nodes from a graph. @@ -1266,344 +995,6 @@ } }; -// template -// class SubBidirGraphWrapper : public GraphWrapper { -// public: -// typedef GraphWrapper Parent; -// protected: -// ForwardFilterMap* forward_filter; -// BackwardFilterMap* backward_filter; - -// SubBidirGraphWrapper() : GraphWrapper() { } -// void setForwardFilterMap(ForwardFilterMap& _forward_filter) { -// forward_filter=&_forward_filter; -// } -// void setBackwardFilterMap(BackwardFilterMap& _backward_filter) { -// backward_filter=&_backward_filter; -// } - -// public: - -// SubBidirGraphWrapper(Graph& _graph, ForwardFilterMap& _forward_filter, -// BackwardFilterMap& _backward_filter) : -// GraphWrapper(_graph), -// forward_filter(&_forward_filter), backward_filter(&_backward_filter) { } -// SubBidirGraphWrapper(const SubBidirGraphWrapper& gw) : -// Parent(gw), -// forward_filter(gw.forward_filter), -// backward_filter(gw.backward_filter) { } - -// class Edge; -// class OutEdgeIt; -// friend class Edge; -// friend class OutEdgeIt; - -// template class EdgeMap; - -// typedef typename GraphWrapper::Node Node; - -// typedef typename Graph::Edge GraphEdge; -// /// SubBidirGraphWrapper<..., ..., ...>::Edge is inherited from -// /// Graph::Edge. It contains an extra bool flag which is true -// /// if and only if the -// /// edge is the backward version of the original edge. -// class Edge : public Graph::Edge { -// friend class SubBidirGraphWrapper; -// template friend class EdgeMap; -// protected: -// bool backward; //true, iff backward -// public: -// Edge() { } -// /// \todo =false is needed, or causes problems? -// /// If \c _backward is false, then we get an edge corresponding to the -// /// original one, otherwise its oppositely directed pair is obtained. -// Edge(const typename Graph::Edge& e, bool _backward/*=false*/) : -// Graph::Edge(e), backward(_backward) { } -// Edge(Invalid i) : Graph::Edge(i), backward(true) { } -// bool operator==(const Edge& v) const { -// return (this->backward==v.backward && -// static_cast(*this)== -// static_cast(v)); -// } -// bool operator!=(const Edge& v) const { -// return (this->backward!=v.backward || -// static_cast(*this)!= -// static_cast(v)); -// } -// }; - -// class OutEdgeIt : public Edge { -// friend class SubBidirGraphWrapper; -// protected: -// const SubBidirGraphWrapper* gw; -// public: -// OutEdgeIt() { } -// OutEdgeIt(Invalid i) : Edge(i) { } -// OutEdgeIt(const SubBidirGraphWrapper& _gw, const Node& n) : -// Edge(typename Graph::OutEdgeIt(*(_gw.graph), n), false), gw(&_gw) { -// while (*static_cast(this)!=INVALID && -// !(*(gw->forward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// if (*static_cast(this)==INVALID) { -// *static_cast(this)= -// Edge(typename Graph::InEdgeIt(*(_gw.graph), n), true); -// while (*static_cast(this)!=INVALID && -// !(*(gw->backward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// } -// } -// OutEdgeIt(const SubBidirGraphWrapper& _gw, const Edge& e) : -// Edge(e), gw(&_gw) { } -// OutEdgeIt& operator++() { -// if (!this->backward) { -// Node n=gw->source(*this); -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// while (*static_cast(this)!=INVALID && -// !(*(gw->forward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// if (*static_cast(this)==INVALID) { -// *static_cast(this)= -// Edge(typename Graph::InEdgeIt(*(gw->graph), n), true); -// while (*static_cast(this)!=INVALID && -// !(*(gw->backward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// } -// } else { -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// while (*static_cast(this)!=INVALID && -// !(*(gw->backward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// } -// return *this; -// } -// }; - -// class InEdgeIt : public Edge { -// friend class SubBidirGraphWrapper; -// protected: -// const SubBidirGraphWrapper* gw; -// public: -// InEdgeIt() { } -// InEdgeIt(Invalid i) : Edge(i) { } -// InEdgeIt(const SubBidirGraphWrapper& _gw, const Node& n) : -// Edge(typename Graph::InEdgeIt(*(_gw.graph), n), false), gw(&_gw) { -// while (*static_cast(this)!=INVALID && -// !(*(gw->forward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// if (*static_cast(this)==INVALID) { -// *static_cast(this)= -// Edge(typename Graph::OutEdgeIt(*(_gw.graph), n), true); -// while (*static_cast(this)!=INVALID && -// !(*(gw->backward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// } -// } -// InEdgeIt(const SubBidirGraphWrapper& _gw, const Edge& e) : -// Edge(e), gw(&_gw) { } -// InEdgeIt& operator++() { -// if (!this->backward) { -// Node n=gw->source(*this); -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// while (*static_cast(this)!=INVALID && -// !(*(gw->forward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::InEdgeIt(*(gw->graph), *this)); -// if (*static_cast(this)==INVALID) { -// *static_cast(this)= -// Edge(typename Graph::OutEdgeIt(*(gw->graph), n), true); -// while (*static_cast(this)!=INVALID && -// !(*(gw->backward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// } -// } else { -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// while (*static_cast(this)!=INVALID && -// !(*(gw->backward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// } -// return *this; -// } -// }; - -// class EdgeIt : public Edge { -// friend class SubBidirGraphWrapper; -// protected: -// const SubBidirGraphWrapper* gw; -// public: -// EdgeIt() { } -// EdgeIt(Invalid i) : Edge(i) { } -// EdgeIt(const SubBidirGraphWrapper& _gw) : -// Edge(typename Graph::EdgeIt(*(_gw.graph)), false), gw(&_gw) { -// while (*static_cast(this)!=INVALID && -// !(*(gw->forward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::EdgeIt(*(gw->graph), *this)); -// if (*static_cast(this)==INVALID) { -// *static_cast(this)= -// Edge(typename Graph::EdgeIt(*(_gw.graph)), true); -// while (*static_cast(this)!=INVALID && -// !(*(gw->backward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::EdgeIt(*(gw->graph), *this)); -// } -// } -// EdgeIt(const SubBidirGraphWrapper& _gw, const Edge& e) : -// Edge(e), gw(&_gw) { } -// EdgeIt& operator++() { -// if (!this->backward) { -// *(static_cast(this))= -// ++(typename Graph::EdgeIt(*(gw->graph), *this)); -// while (*static_cast(this)!=INVALID && -// !(*(gw->forward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::EdgeIt(*(gw->graph), *this)); -// if (*static_cast(this)==INVALID) { -// *static_cast(this)= -// Edge(typename Graph::EdgeIt(*(gw->graph)), true); -// while (*static_cast(this)!=INVALID && -// !(*(gw->backward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::EdgeIt(*(gw->graph), *this)); -// } -// } else { -// *(static_cast(this))= -// ++(typename Graph::EdgeIt(*(gw->graph), *this)); -// while (*static_cast(this)!=INVALID && -// !(*(gw->backward_filter))[*this]) -// *(static_cast(this))= -// ++(typename Graph::EdgeIt(*(gw->graph), *this)); -// } -// return *this; -// } -// }; - -// // using GraphWrapper::first; -// // OutEdgeIt& first(OutEdgeIt& i, const Node& p) const { -// // i=OutEdgeIt(*this, p); return i; -// // } -// // InEdgeIt& first(InEdgeIt& i, const Node& p) const { -// // i=InEdgeIt(*this, p); return i; -// // } -// // EdgeIt& first(EdgeIt& i) const { -// // i=EdgeIt(*this); return i; -// // } - - -// Node source(Edge e) const { -// return ((!e.backward) ? this->graph->source(e) : this->graph->target(e)); } -// Node target(Edge e) const { -// return ((!e.backward) ? this->graph->target(e) : this->graph->source(e)); } - -// /// Gives back the opposite edge. -// Edge opposite(const Edge& e) const { -// Edge f=e; -// f.backward=!f.backward; -// return f; -// } - -// /// \warning This is a linear time operation and works only if -// /// \c Graph::EdgeIt is defined. -// int edgeNum() const { -// int i=0; -// for (EdgeIt e(*this); e!=INVALID; ++e) ++i; -// return i; -// } - -// bool forward(const Edge& e) const { return !e.backward; } -// bool backward(const Edge& e) const { return e.backward; } - - -// template -// /// \c SubBidirGraphWrapper<..., ..., ...>::EdgeMap contains two -// /// Graph::EdgeMap one for the forward edges and -// /// one for the backward edges. -// class EdgeMap { -// template friend class EdgeMap; -// typename Graph::template EdgeMap forward_map, backward_map; -// public: -// typedef T Value; -// typedef Edge Key; - -// EdgeMap(const SubBidirGraphWrapper& g) : -// forward_map(*(g.graph)), backward_map(*(g.graph)) { } - -// EdgeMap(const SubBidirGraphWrapper& g, T a) : -// forward_map(*(g.graph), a), backward_map(*(g.graph), a) { } - -// template -// EdgeMap(const EdgeMap& copy) -// : forward_map(copy.forward_map), backward_map(copy.backward_map) {} - -// template -// EdgeMap& operator=(const EdgeMap& copy) { -// forward_map = copy.forward_map; -// backward_map = copy.backward_map; -// return *this; -// } - -// void set(Edge e, T a) { -// if (!e.backward) -// forward_map.set(e, a); -// else -// backward_map.set(e, a); -// } - -// typename Graph::template EdgeMap::ConstReference -// operator[](Edge e) const { -// if (!e.backward) -// return forward_map[e]; -// else -// return backward_map[e]; -// } - -// typename Graph::template EdgeMap::Reference -// operator[](Edge e) { -// if (!e.backward) -// return forward_map[e]; -// else -// return backward_map[e]; -// } - -// void update() { -// forward_map.update(); -// backward_map.update(); -// } -// }; - - -// // KEEP_NODE_MAP(Parent, SubBidirGraphWrapper); - -// }; ///\brief A wrapper for composing bidirected graph from a directed one. @@ -1809,19 +1200,6 @@ typedef typename Parent::Node Node; typedef typename Parent::Edge Edge; -// using Parent::first; -// void first(Node& i) const { -// Parent::first(i); -// while (i!=INVALID && !(*node_filter_map)[i]) Parent::next(i); -// } -// void first(Edge& i) const { -// Parent::first(i); -// while (i!=INVALID && !(*edge_filter_map)[i]) Parent::next(i); -// } -// void firstIn(Edge& i, const Node& n) const { -// Parent::firstIn(i, n); -// while (i!=INVALID && !(*edge_filter_map)[i]) Parent::nextIn(i); -// } void firstOut(Edge& i, const Node& n) const { i=(*first_out_edges)[n]; } @@ -1832,22 +1210,6 @@ Parent::nextOut(f); first_out_edges->set(n, f); } -// void next(Node& i) const { -// Parent::next(i); -// while (i!=INVALID && !(*node_filter_map)[i]) Parent::next(i); -// } -// void next(Edge& i) const { -// Parent::next(i); -// while (i!=INVALID && !(*edge_filter_map)[i]) Parent::next(i); -// } -// void nextIn(Edge& i) const { -// Parent::nextIn(i); -// while (i!=INVALID && !(*edge_filter_map)[i]) Parent::nextIn(i); -// } -// void nextOut(Edge& i) const { -// Parent::nextOut(i); -// while (i!=INVALID && !(*edge_filter_map)[i]) Parent::nextOut(i); -// } }; @@ -1878,57 +1240,8 @@ setGraph(_graph); setFirstOutEdgesMap(_first_out_edges); } -// using GraphWrapper::first; -// OutEdgeIt& first(OutEdgeIt& i, const Node& p) const { -// i=OutEdgeIt(*this, p); return i; -// } + }; -// template -// class ErasingFirstGraphWrapper : public GraphWrapper { -// public: -// typedef GraphWrapper Parent; -// protected: -// FirstOutEdgesMap* first_out_edges; -// public: -// ErasingFirstGraphWrapper(Graph& _graph, -// FirstOutEdgesMap& _first_out_edges) : -// GraphWrapper(_graph), first_out_edges(&_first_out_edges) { } - -// typedef typename GraphWrapper::Node Node; -// typedef typename GraphWrapper::Edge Edge; -// class OutEdgeIt : public Edge { -// friend class GraphWrapper; -// friend class ErasingFirstGraphWrapper; -// const ErasingFirstGraphWrapper* gw; -// public: -// OutEdgeIt() { } -// OutEdgeIt(Invalid i) : Edge(i) { } -// OutEdgeIt(const ErasingFirstGraphWrapper& _gw, -// const Node& n) : -// Edge((*(_gw.first_out_edges))[n]), gw(&_gw) { } -// OutEdgeIt(const ErasingFirstGraphWrapper& _gw, -// const Edge& e) : -// Edge(e), gw(&_gw) { } -// OutEdgeIt& operator++() { -// *(static_cast(this))= -// ++(typename Graph::OutEdgeIt(*(gw->graph), *this)); -// return *this; -// } -// }; - -// // using GraphWrapper::first; -// // OutEdgeIt& first(OutEdgeIt& i, const Node& p) const { -// // i=OutEdgeIt(*this, p); return i; -// // } -// void erase(const Edge& e) const { -// Node n=source(e); -// typename Graph::OutEdgeIt f(*Parent::graph, n); -// ++f; -// first_out_edges->set(n, f); -// } - -// // KEEP_MAPS(Parent, ErasingFirstGraphWrapper); -// }; ///@}