Changeset 880:9d0bfd35b97c in lemon-0.x for src/work/marci/experiment
- Timestamp:
- 09/17/04 17:51:50 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1188
- Location:
- src/work/marci/experiment
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/experiment/graph_wrapper.h
r281 r880 162 162 163 163 template<typename GraphWrapper> 164 class GraphWrapper Skeleton{164 class GraphWrapper { 165 165 protected: 166 166 GraphWrapper gw; … … 185 185 GraphWrapper::NodeIt(n) { } 186 186 NodeIt(const Invalid& i) : GraphWrapper::NodeIt(i) { } 187 NodeIt(const GraphWrapper Skeleton<GraphWrapper>& _G) :187 NodeIt(const GraphWrapper<GraphWrapper>& _G) : 188 188 GraphWrapper::NodeIt(_G.gw) { } 189 189 }; … … 196 196 GraphWrapper::OutEdgeIt(e) { } 197 197 OutEdgeIt(const Invalid& i) : GraphWrapper::OutEdgeIt(i) { } 198 OutEdgeIt(const GraphWrapper Skeleton<GraphWrapper>& _G, const Node& n) :198 OutEdgeIt(const GraphWrapper<GraphWrapper>& _G, const Node& n) : 199 199 GraphWrapper::OutEdgeIt(_G.gw, n) { } 200 200 }; … … 206 206 GraphWrapper::InEdgeIt(e) { } 207 207 InEdgeIt(const Invalid& i) : GraphWrapper::InEdgeIt(i) { } 208 InEdgeIt(const GraphWrapper Skeleton<GraphWrapper>& _G, const Node& n) :208 InEdgeIt(const GraphWrapper<GraphWrapper>& _G, const Node& n) : 209 209 GraphWrapper::InEdgeIt(_G.gw, n) { } 210 210 }; … … 217 217 GraphWrapper::EdgeIt(e) { } 218 218 EdgeIt(const Invalid& i) : GraphWrapper::EdgeIt(i) { } 219 EdgeIt(const GraphWrapper Skeleton<GraphWrapper>& _G) :219 EdgeIt(const GraphWrapper<GraphWrapper>& _G) : 220 220 GraphWrapper::EdgeIt(_G.gw) { } 221 221 }; 222 222 223 223 224 //GraphWrapper Skeleton() : gw() { }225 GraphWrapper Skeleton(GraphWrapper _gw) : gw(_gw) { }224 //GraphWrapper() : gw() { } 225 GraphWrapper(GraphWrapper _gw) : gw(_gw) { } 226 226 227 227 //void setGraph(BaseGraph& _graph) { gw.setGraph(_graph); } … … 270 270 template<typename T> class NodeMap : public GraphWrapper::NodeMap<T> { 271 271 public: 272 NodeMap(const GraphWrapper Skeleton<GraphWrapper>& _G) :272 NodeMap(const GraphWrapper<GraphWrapper>& _G) : 273 273 GraphWrapper::NodeMap<T>(_G.gw) { } 274 NodeMap(const GraphWrapper Skeleton<GraphWrapper>& _G, T a) :274 NodeMap(const GraphWrapper<GraphWrapper>& _G, T a) : 275 275 GraphWrapper::NodeMap<T>(_G.gw, a) { } 276 276 }; … … 278 278 template<typename T> class EdgeMap : public GraphWrapper::EdgeMap<T> { 279 279 public: 280 EdgeMap(const GraphWrapper Skeleton<GraphWrapper>& _G) :280 EdgeMap(const GraphWrapper<GraphWrapper>& _G) : 281 281 GraphWrapper::EdgeMap<T>(_G.gw) { } 282 EdgeMap(const GraphWrapper Skeleton<GraphWrapper>& _G, T a) :282 EdgeMap(const GraphWrapper<GraphWrapper>& _G, T a) : 283 283 GraphWrapper::EdgeMap<T>(_G.gw, a) { } 284 284 }; … … 366 366 367 367 // template<typename /*Graph*/GraphWrapper 368 // /*=typename GraphWrapper Skeleton< TrivGraphWrapper<Graph>*/ >368 // /*=typename GraphWrapper< TrivGraphWrapper<Graph>*/ > 369 369 // class RevGraphWrapper : 370 // public GraphWrapper/*GraphWrapper Skeleton< TrivGraphWrapper<Graph> >*/ {370 // public GraphWrapper/*GraphWrapper< TrivGraphWrapper<Graph> >*/ { 371 371 // protected: 372 372 // //Graph* graph; … … 379 379 380 380 // //typedef typename Graph::Edge Edge; 381 // typedef typename GraphWrapper/*typename GraphWrapper Skeleton< TrivGraphWrapper<Graph> >*/::OutEdgeIt InEdgeIt;382 // typedef typename GraphWrapper/*typename GraphWrapper Skeleton< TrivGraphWrapper<Graph> >*/::InEdgeIt OutEdgeIt;381 // typedef typename GraphWrapper/*typename GraphWrapper< TrivGraphWrapper<Graph> >*/::OutEdgeIt InEdgeIt; 382 // typedef typename GraphWrapper/*typename GraphWrapper< TrivGraphWrapper<Graph> >*/::InEdgeIt OutEdgeIt; 383 383 // //typedef typename Graph::SymEdgeIt SymEdgeIt; 384 384 // //typedef typename Graph::EdgeIt EdgeIt; 385 385 386 386 // //RevGraphWrapper() : graph(0) { } 387 // RevGraphWrapper(GraphWrapper _gw/*BaseGraph& _graph*/) : GraphWrapper/*GraphWrapper Skeleton< TrivGraphWrapper<Graph> >*/(_gw/*TrivGraphWrapper<Graph>(_graph)*/) { }387 // RevGraphWrapper(GraphWrapper _gw/*BaseGraph& _graph*/) : GraphWrapper/*GraphWrapper< TrivGraphWrapper<Graph> >*/(_gw/*TrivGraphWrapper<Graph>(_graph)*/) { } 388 388 389 389 // //void setGraph(Graph& _graph) { graph = &_graph; } … … 430 430 431 431 // template<typename T> class NodeMap : 432 // public GraphWrapper/* Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T>432 // public GraphWrapper/*< TrivGraphWrapper<Graph> >*/::NodeMap<T> 433 433 // { 434 434 // public: 435 435 // NodeMap(const RevGraphWrapper<GraphWrapper>& _gw) : 436 // GraphWrapper/* Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw) { }436 // GraphWrapper/*< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw) { } 437 437 // NodeMap(const RevGraphWrapper<GraphWrapper>& _gw, T a) : 438 // GraphWrapper/* Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw, a) { }438 // GraphWrapper/*< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw, a) { } 439 439 // }; 440 440 441 441 // template<typename T> class EdgeMap : 442 // public GraphWrapper/* Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T> {442 // public GraphWrapper/*< TrivGraphWrapper<Graph> >*/::EdgeMap<T> { 443 443 // public: 444 444 // EdgeMap(const RevGraphWrapper<GraphWrapper>& _gw) : 445 // GraphWrapper/* Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw) { }445 // GraphWrapper/*< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw) { } 446 446 // EdgeMap(const RevGraphWrapper<GraphWrapper>& _gw, T a) : 447 // GraphWrapper/* Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw, a) { }447 // GraphWrapper/*< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw, a) { } 448 448 // }; 449 449 // }; 450 450 451 451 template<typename GraphWrapper> 452 class RevGraphWrapper : public GraphWrapper Skeleton<GraphWrapper> {452 class RevGraphWrapper : public GraphWrapper<GraphWrapper> { 453 453 public: 454 typedef typename GraphWrapper Skeleton<GraphWrapper>::Node Node;455 typedef typename GraphWrapper Skeleton<GraphWrapper>::Edge Edge;454 typedef typename GraphWrapper<GraphWrapper>::Node Node; 455 typedef typename GraphWrapper<GraphWrapper>::Edge Edge; 456 456 //FIXME 457 457 //If GraphWrapper::OutEdgeIt is not defined … … 462 462 //Unfortunately all the typedefs are instantiated in templates, 463 463 //unlike other stuff 464 typedef typename GraphWrapper Skeleton<GraphWrapper>::OutEdgeIt InEdgeIt;465 typedef typename GraphWrapper Skeleton<GraphWrapper>::InEdgeIt OutEdgeIt;464 typedef typename GraphWrapper<GraphWrapper>::OutEdgeIt InEdgeIt; 465 typedef typename GraphWrapper<GraphWrapper>::InEdgeIt OutEdgeIt; 466 466 467 467 RevGraphWrapper(GraphWrapper _gw) : 468 GraphWrapper Skeleton<GraphWrapper>(_gw) { }468 GraphWrapper<GraphWrapper>(_gw) { } 469 469 470 470 Node head(const Edge& e) const 471 { return GraphWrapper Skeleton<GraphWrapper>::tail(e); }471 { return GraphWrapper<GraphWrapper>::tail(e); } 472 472 Node tail(const Edge& e) const 473 { return GraphWrapper Skeleton<GraphWrapper>::head(e); }473 { return GraphWrapper<GraphWrapper>::head(e); } 474 474 }; 475 475 476 476 //Subgraph on the same node-set and partial edge-set 477 477 template<typename GraphWrapper, typename EdgeFilterMap> 478 class SubGraphWrapper : public GraphWrapper Skeleton<GraphWrapper> {478 class SubGraphWrapper : public GraphWrapper<GraphWrapper> { 479 479 protected: 480 480 EdgeFilterMap* filter_map; 481 481 public: 482 typedef typename GraphWrapper Skeleton<GraphWrapper>::Node Node;483 typedef typename GraphWrapper Skeleton<GraphWrapper>::NodeIt NodeIt;484 typedef typename GraphWrapper Skeleton<GraphWrapper>::Edge Edge;485 typedef typename GraphWrapper Skeleton<GraphWrapper>::EdgeIt EdgeIt;486 typedef typename GraphWrapper Skeleton<GraphWrapper>::InEdgeIt InEdgeIt;487 typedef typename GraphWrapper Skeleton<GraphWrapper>::OutEdgeIt OutEdgeIt;482 typedef typename GraphWrapper<GraphWrapper>::Node Node; 483 typedef typename GraphWrapper<GraphWrapper>::NodeIt NodeIt; 484 typedef typename GraphWrapper<GraphWrapper>::Edge Edge; 485 typedef typename GraphWrapper<GraphWrapper>::EdgeIt EdgeIt; 486 typedef typename GraphWrapper<GraphWrapper>::InEdgeIt InEdgeIt; 487 typedef typename GraphWrapper<GraphWrapper>::OutEdgeIt OutEdgeIt; 488 488 489 489 SubGraphWrapper(GraphWrapper _gw, EdgeFilterMap& _filter_map) : 490 GraphWrapper Skeleton<GraphWrapper>(_gw), filter_map(&_filter_map) { }490 GraphWrapper<GraphWrapper>(_gw), filter_map(&_filter_map) { } 491 491 492 492 template<typename I> I& first(I& i) const { … … 678 678 679 679 template<typename GraphWrapper> 680 class UndirGraphWrapper : public GraphWrapper Skeleton<GraphWrapper> {680 class UndirGraphWrapper : public GraphWrapper<GraphWrapper> { 681 681 protected: 682 682 // GraphWrapper gw; … … 685 685 //typedef GraphWrapper BaseGraph; 686 686 687 typedef typename GraphWrapper Skeleton<GraphWrapper>::Node Node;688 typedef typename GraphWrapper Skeleton<GraphWrapper>::NodeIt NodeIt;687 typedef typename GraphWrapper<GraphWrapper>::Node Node; 688 typedef typename GraphWrapper<GraphWrapper>::NodeIt NodeIt; 689 689 690 690 //private: 691 691 //FIXME ezeknek valojaban a GraphWrapper megfelelo dolgai kellene hogy 692 692 //legyenek, at kell irni 693 typedef typename /*GraphWrapper Skeleton<GraphWrapper>*/693 typedef typename /*GraphWrapper<GraphWrapper>*/ 694 694 GraphWrapper::Edge GraphEdge; 695 typedef typename /*GraphWrapper Skeleton<GraphWrapper>*/695 typedef typename /*GraphWrapper<GraphWrapper>*/ 696 696 GraphWrapper::OutEdgeIt GraphOutEdgeIt; 697 typedef typename /*GraphWrapper Skeleton<GraphWrapper>*/697 typedef typename /*GraphWrapper<GraphWrapper>*/ 698 698 GraphWrapper::InEdgeIt GraphInEdgeIt; 699 699 //public: … … 701 701 //UndirGraphWrapper() : graph(0) { } 702 702 UndirGraphWrapper(GraphWrapper _gw) : 703 GraphWrapper Skeleton<GraphWrapper>(_gw) { }703 GraphWrapper<GraphWrapper>(_gw) { } 704 704 705 705 //UndirGraphWrapper(GraphWrapper _gw) : gw(_gw) { } … … 865 865 866 866 // template<typename T> class EdgeMap : 867 // public GraphWrapper Skeleton<GraphWrapper>::EdgeMap<T> {867 // public GraphWrapper<GraphWrapper>::EdgeMap<T> { 868 868 // public: 869 869 // EdgeMap(const UndirGraphWrapper<GraphWrapper>& _G) : 870 // GraphWrapper Skeleton<GraphWrapper>::EdgeMap<T>(_G.gw) { }870 // GraphWrapper<GraphWrapper>::EdgeMap<T>(_G.gw) { } 871 871 // EdgeMap(const UndirGraphWrapper<GraphWrapper>& _G, T a) : 872 872 // GraphWrapper::EdgeMap<T>(_G.gw, a) { } … … 948 948 949 949 template<typename GraphWrapper, typename Number, typename FlowMap, typename CapacityMap> 950 class ResGraphWrapper : public GraphWrapper Skeleton<GraphWrapper>{950 class ResGraphWrapper : public GraphWrapper<GraphWrapper>{ 951 951 public: 952 952 //typedef Graph BaseGraph; 953 953 //typedef TrivGraphWrapper<const Graph> GraphWrapper; 954 typedef typename GraphWrapper Skeleton<GraphWrapper>::Node Node;955 typedef typename GraphWrapper Skeleton<GraphWrapper>::NodeIt NodeIt;954 typedef typename GraphWrapper<GraphWrapper>::Node Node; 955 typedef typename GraphWrapper<GraphWrapper>::NodeIt NodeIt; 956 956 private: 957 typedef typename /*GraphWrapper Skeleton<GraphWrapper>*/957 typedef typename /*GraphWrapper<GraphWrapper>*/ 958 958 GraphWrapper::OutEdgeIt OldOutEdgeIt; 959 typedef typename /*GraphWrapper Skeleton<GraphWrapper>*/959 typedef typename /*GraphWrapper<GraphWrapper>*/ 960 960 GraphWrapper::InEdgeIt OldInEdgeIt; 961 961 protected: … … 968 968 ResGraphWrapper(const GraphWrapper& _gw, FlowMap& _flow, 969 969 const CapacityMap& _capacity) : 970 GraphWrapper Skeleton<GraphWrapper>(_gw),970 GraphWrapper<GraphWrapper>(_gw), 971 971 flow(&_flow), capacity(&_capacity) { } 972 972 … … 1265 1265 //Subgraph on the same node-set and partial edge-set 1266 1266 template<typename GraphWrapper, typename FirstOutEdgesMap> 1267 class ErasingFirstGraphWrapper : public GraphWrapper Skeleton<GraphWrapper> {1267 class ErasingFirstGraphWrapper : public GraphWrapper<GraphWrapper> { 1268 1268 protected: 1269 1269 FirstOutEdgesMap* first_out_edges; 1270 1270 public: 1271 typedef typename GraphWrapper Skeleton<GraphWrapper>::Node Node;1272 typedef typename GraphWrapper Skeleton<GraphWrapper>::NodeIt NodeIt;1273 typedef typename GraphWrapper Skeleton<GraphWrapper>::Edge Edge;1274 typedef typename GraphWrapper Skeleton<GraphWrapper>::EdgeIt EdgeIt;1275 typedef typename GraphWrapper Skeleton<GraphWrapper>::InEdgeIt InEdgeIt;1276 typedef typename GraphWrapper Skeleton<GraphWrapper>::OutEdgeIt OutEdgeIt;1271 typedef typename GraphWrapper<GraphWrapper>::Node Node; 1272 typedef typename GraphWrapper<GraphWrapper>::NodeIt NodeIt; 1273 typedef typename GraphWrapper<GraphWrapper>::Edge Edge; 1274 typedef typename GraphWrapper<GraphWrapper>::EdgeIt EdgeIt; 1275 typedef typename GraphWrapper<GraphWrapper>::InEdgeIt InEdgeIt; 1276 typedef typename GraphWrapper<GraphWrapper>::OutEdgeIt OutEdgeIt; 1277 1277 1278 1278 ErasingFirstGraphWrapper(GraphWrapper _gw, FirstOutEdgesMap& _first_out_edges) : 1279 GraphWrapper Skeleton<GraphWrapper>(_gw), first_out_edges(&_first_out_edges) { }1279 GraphWrapper<GraphWrapper>(_gw), first_out_edges(&_first_out_edges) { } 1280 1280 1281 1281 template<typename I> I& first(I& i) const { -
src/work/marci/experiment/graph_wrapper_1.h
r298 r880 759 759 760 760 // template<typename T> class EdgeMap : 761 // public GraphWrapper Skeleton<Graph>::EdgeMap<T> {761 // public GraphWrapper<Graph>::EdgeMap<T> { 762 762 // public: 763 763 // EdgeMap(const UndirGraphWrapper<Graph>& _G) : 764 // GraphWrapper Skeleton<Graph>::EdgeMap<T>(_G.gw) { }764 // GraphWrapper<Graph>::EdgeMap<T>(_G.gw) { } 765 765 // EdgeMap(const UndirGraphWrapper<Graph>& _G, T a) : 766 766 // Graph::EdgeMap<T>(_G.gw, a) { }
Note: See TracChangeset
for help on using the changeset viewer.