Changeset 263:f24f276e0b6b in lemon0.x for src/work/marci/graph_wrapper.h
 Timestamp:
 03/30/04 09:07:44 (17 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@369
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/marci/graph_wrapper.h
r259 r263 92 92 93 93 public: 94 typedef typename GraphWrapper::BaseGraph BaseGraph;94 //typedef typename GraphWrapper::BaseGraph BaseGraph; 95 95 96 96 typedef typename GraphWrapper::Node Node; … … 106 106 GraphWrapperSkeleton(GraphWrapper _gw) : gw(_gw) { } 107 107 108 void setGraph(BaseGraph& _graph) { gw.setGraph(_graph); }109 BaseGraph& getGraph() const { return gw.getGraph(); }108 //void setGraph(BaseGraph& _graph) { gw.setGraph(_graph); } 109 //BaseGraph& getGraph() const { return gw.getGraph(); } 110 110 111 111 template<typename I> I& first(I& i) const { return gw.first(i); } … … 343 343 }; 344 344 345 //Subgraph on the same nodeset and partial edgeset 346 template<typename GraphWrapper, typename EdgeFilterMap> 347 class SubGraphWrapper : public GraphWrapperSkeleton<GraphWrapper> { 348 protected: 349 EdgeFilterMap* filter_map; 350 public: 351 typedef typename GraphWrapperSkeleton<GraphWrapper>::Node Node; 352 typedef typename GraphWrapperSkeleton<GraphWrapper>::NodeIt NodeIt; 353 typedef typename GraphWrapperSkeleton<GraphWrapper>::Edge Edge; 354 typedef typename GraphWrapperSkeleton<GraphWrapper>::EdgeIt EdgeIt; 355 typedef typename GraphWrapperSkeleton<GraphWrapper>::InEdgeIt InEdgeIt; 356 typedef typename GraphWrapperSkeleton<GraphWrapper>::OutEdgeIt OutEdgeIt; 357 358 SubGraphWrapper(GraphWrapper _gw, EdgeFilterMap& _filter_map) : 359 GraphWrapperSkeleton<GraphWrapper>(_gw), filter_map(&_filter_map) { } 360 361 template<typename I> I& first(I& i) const { 362 gw.first(i); 363 while (gw.valid(i) && !filter_map>get(i)) { gw.next(i); } 364 return i; 365 } 366 template<typename I, typename P> I& first(I& i, const P& p) const { 367 gw.first(i, p); 368 while (gw.valid(i) && !filter_map>get(i)) { gw.next(i); } 369 return i; 370 } 371 372 //template<typename I> I getNext(const I& i) const { 373 // return gw.getNext(i); 374 //} 375 template<typename I> I& next(I &i) const { 376 gw.next(i); 377 while (gw.valid(i) && !filter_map>get(i)) { gw.next(i); } 378 return i; 379 } 380 381 template< typename It > It first() const { 382 It e; this>first(e); return e; } 383 384 template< typename It > It first(const Node& v) const { 385 It e; this>first(e, v); return e; } 386 }; 345 387 346 388 // template<typename GraphWrapper> … … 858 900 // } 859 901 }; 902 903 //FIXME This is just for having InEdgeIt 904 typedef void InEdgeIt; 860 905 861 906 class EdgeIt : public Edge { … … 1006 1051 return ((e.out_or_in) ? gw.bNode(e.out) : gw.bNode(e.in)); } 1007 1052 1053 int nodeNum() const { return gw.nodeNum(); } 1054 //FIXME 1055 //int edgeNum() const { return gw.edgeNum(); } 1056 1057 1008 1058 int id(Node v) const { return gw.id(v); } 1009 1059
Note: See TracChangeset
for help on using the changeset viewer.