Changeset 627:6cc21a9c9fda in lemon0.x for src/work/deba/test_graph.h
 Timestamp:
 05/13/04 10:20:39 (20 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@818
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/deba/test_graph.h
r595 r627 31 31 class SymEdgeIt; 32 32 33 // template <typename T> class NodeMap;34 // template <typename T> class EdgeMap;33 // template <typename T> class NodeMap; 34 // template <typename T> class EdgeMap; 35 35 private: 36 // template <typename T> friend class NodeMap;37 // template <typename T> friend class EdgeMap;36 // template <typename T> friend class NodeMap; 37 // template <typename T> friend class EdgeMap; 38 38 39 39 private: 40 40 41 41 42 42 public: 43 43 44 typedef MapBase<ListGraph, Node, NodeIt> NodeMapBase; 45 typedef MapRegistry<ListGraph, Node, NodeIt> NodeMapRegistry; 46 typedef VectorMapFactory<ListGraph, Node, NodeIt> NodeMapFactory; 47 NodeMapRegistry node_maps; 48 49 50 51 typedef MapBase<ListGraph, Edge, EdgeIt> EdgeMapBase; 52 typedef MapRegistry<ListGraph, Edge, EdgeIt> EdgeMapRegistry; 53 typedef VectorMapFactory<ListGraph, Edge, EdgeIt> EdgeMapFactory; 54 EdgeMapRegistry edge_maps; 44 typedef MapRegistry<ListGraph, Node, NodeIt> NodeMapRegistry; 45 typedef VectorMapFactory<NodeMapRegistry> NodeMapFactory; 46 NodeMapRegistry node_maps; 47 48 49 50 typedef MapRegistry<ListGraph, Edge, EdgeIt> EdgeMapRegistry; 51 typedef VectorMapFactory<EdgeMapRegistry> EdgeMapFactory; 52 EdgeMapRegistry edge_maps; 55 53 56 54 … … 303 301 304 302 Node addNode() { 305 306 307 308 303 Node n = _add_node(); 304 node_maps.add(n); 305 return n; 306 } 309 307 Edge addEdge(Node u, Node v) { 310 311 308 Edge e = _add_edge(u.node, v.node); 309 edge_maps.add(e); 312 310 return e; 313 311 } 314 312 315 313 void erase(Node i) { 316 314 node_maps.erase(i); 317 315 while (first<OutEdgeIt>(i).valid()) erase(first<OutEdgeIt>(i)); 318 316 while (first<InEdgeIt>(i).valid()) erase(first<InEdgeIt>(i)); … … 321 319 322 320 void erase(Edge e) { 323 324 325 321 edge_maps.erase(e); 322 _delete_edge(e.edge); 323 } 326 324 327 325 void clear() { … … 511 509 }; 512 510 513 // template< typename T >514 // T ListGraph::first() const {515 // std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>();" << std::endl;516 // return T();517 // }518 519 // template<>520 // ListGraph::NodeIt ListGraph::first<ListGraph::NodeIt>() const {521 // return firstNode();522 // }523 524 // template<>525 // ListGraph::EdgeIt ListGraph::first<ListGraph::EdgeIt>() const {526 // return firstEdge();527 // }528 529 // template< typename T >530 // T ListGraph::first(ListGraph::Node v) const {531 // std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>(ListGRaph::Node);" << std::endl;532 // return T();533 // }534 535 // template<>536 // ListGraph::OutEdgeIt ListGraph::first<ListGraph::OutEdgeIt>(const ListGraph::Node v) const {537 // return firstOutEdge(v);538 // }539 540 // template<>541 // ListGraph::InEdgeIt ListGraph::first<ListGraph::InEdgeIt>(const ListGraph::Node v) const {542 // return firstInEdge(v);543 // }544 545 // template<>546 // ListGraph::SymEdgeIt ListGraph::first<ListGraph::SymEdgeIt>(const ListGraph::Node v) const {547 // return firstSymEdge(v);548 // }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::NodeIt ListGraph::first<ListGraph::NodeIt>() const { 519 // return firstNode(); 520 // } 521 522 // template<> 523 // ListGraph::EdgeIt ListGraph::first<ListGraph::EdgeIt>() const { 524 // return firstEdge(); 525 // } 526 527 // template< typename T > 528 // T ListGraph::first(ListGraph::Node v) const { 529 // std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>(ListGRaph::Node);" << std::endl; 530 // return T(); 531 // } 532 533 // template<> 534 // ListGraph::OutEdgeIt ListGraph::first<ListGraph::OutEdgeIt>(const ListGraph::Node v) const { 535 // return firstOutEdge(v); 536 // } 537 538 // template<> 539 // ListGraph::InEdgeIt ListGraph::first<ListGraph::InEdgeIt>(const ListGraph::Node v) const { 540 // return firstInEdge(v); 541 // } 542 543 // template<> 544 // ListGraph::SymEdgeIt ListGraph::first<ListGraph::SymEdgeIt>(const ListGraph::Node v) const { 545 // return firstSymEdge(v); 546 // } 549 547 550 548
Note: See TracChangeset
for help on using the changeset viewer.