Changeset 107:8d62f0072ff0 in lemon-0.x for src/work/list_graph.hh
- Timestamp:
- 02/20/04 22:59:34 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@142
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/list_graph.hh
r94 r107 5 5 #include <vector> 6 6 7 namespace marci{7 namespace hugo { 8 8 9 9 template <typename It> … … 50 50 T& operator[](NodeIt n) { return container[/*G.id(n)*/n.node->id]; } 51 51 const T& operator[](NodeIt n) const { return container[/*G.id(n)*/n.node->id]; } 52 void resize() { container.resize(G.node_id); }53 void resize(T a) { container.resize(G.node_id, a); }52 void update() { container.resize(G.node_id); } 53 void update(T a) { container.resize(G.node_id, a); } 54 54 }; 55 55 … … 68 68 T& operator[](EdgeIt e) { return container[/*G.id(e)*/e.edge->id]; } 69 69 const T& operator[](EdgeIt e) const { return container[/*G.id(e)*/e.edge->id]; } 70 void resize() { container.resize(G.edge_id); }71 void resize(T a) { container.resize(G.edge_id, a); }70 void update() { container.resize(G.edge_id); } 71 void update(T a) { container.resize(G.edge_id, a); } 72 72 }; 73 73 … … 307 307 308 308 template <typename It> It next(It it) const { 309 It tmp(it); return goNext( it); }309 It tmp(it); return goNext(tmp); } 310 310 template <typename It> It& goNext(It& it) const { return ++it; } 311 311 … … 509 509 }; 510 510 511 /* 512 template< typename T > 513 T ListGraph::first() const { 514 std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>();" << std::endl; 515 return T(); 516 } 517 518 template<> 519 ListGraph::EachNodeIt ListGraph::first<ListGraph::EachNodeIt>() const { 520 return firstNode(); 521 } 522 523 template<> 524 ListGraph::EachEdgeIt ListGraph::first<ListGraph::EachEdgeIt>() const { 525 return firstEdge(); 526 } 527 528 template< typename T > 529 T ListGraph::first(ListGraph::NodeIt v) const { 530 std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>(ListGRaph::NodeIt);" << std::endl; 531 return T(); 532 } 533 534 template<> 535 ListGraph::OutEdgeIt ListGraph::first<ListGraph::OutEdgeIt>(const ListGraph::NodeIt v) const { 536 return firstOutEdge(v); 537 } 538 539 template<> 540 ListGraph::InEdgeIt ListGraph::first<ListGraph::InEdgeIt>(const ListGraph::NodeIt v) const { 541 return firstInEdge(v); 542 } 543 544 template<> 545 ListGraph::SymEdgeIt ListGraph::first<ListGraph::SymEdgeIt>(const ListGraph::NodeIt v) const { 546 return firstSymEdge(v); 547 } 548 */ 549 550 551 } //namespace marci 511 // template< typename T > 512 // T ListGraph::first() const { 513 // std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>();" << std::endl; 514 // return T(); 515 // } 516 517 // template<> 518 // ListGraph::EachNodeIt ListGraph::first<ListGraph::EachNodeIt>() const { 519 // return firstNode(); 520 // } 521 522 // template<> 523 // ListGraph::EachEdgeIt ListGraph::first<ListGraph::EachEdgeIt>() const { 524 // return firstEdge(); 525 // } 526 527 // template< typename T > 528 // T ListGraph::first(ListGraph::NodeIt v) const { 529 // std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>(ListGRaph::NodeIt);" << std::endl; 530 // return T(); 531 // } 532 533 // template<> 534 // ListGraph::OutEdgeIt ListGraph::first<ListGraph::OutEdgeIt>(const ListGraph::NodeIt v) const { 535 // return firstOutEdge(v); 536 // } 537 538 // template<> 539 // ListGraph::InEdgeIt ListGraph::first<ListGraph::InEdgeIt>(const ListGraph::NodeIt v) const { 540 // return firstInEdge(v); 541 // } 542 543 // template<> 544 // ListGraph::SymEdgeIt ListGraph::first<ListGraph::SymEdgeIt>(const ListGraph::NodeIt v) const { 545 // return firstSymEdge(v); 546 // } 547 548 549 } //namespace hugo 552 550 553 551 #endif //LIST_GRAPH_HH
Note: See TracChangeset
for help on using the changeset viewer.