Changeset 443:178fb74b22d1 in lemon-0.x for src/work/list_graph.h
- Timestamp:
- 04/27/04 15:44:14 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@591
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/list_graph.h
r436 r443 18 18 19 19 class ListGraph { 20 classnode_item;21 classedge_item;20 struct node_item; 21 struct edge_item; 22 22 public: 23 23 class Node; … … 85 85 node_item* _last_node; 86 86 87 class node_item { 88 friend class ListGraph; 89 template <typename T> friend class NodeMap; 90 91 friend class Node; 92 friend class NodeIt; 93 friend class Edge; 94 friend class EdgeIt; 95 friend class OutEdgeIt; 96 friend class InEdgeIt; 97 friend class SymEdgeIt; 98 friend std::ostream& operator<<(std::ostream& os, const Node& i); 99 friend std::ostream& operator<<(std::ostream& os, const Edge& i); 100 //ListGraph* G; 87 struct node_item { 101 88 int id; 102 89 edge_item* _first_out_edge; … … 106 93 node_item* _next_node; 107 94 node_item* _prev_node; 108 public: 109 node_item() { } 110 }; 111 112 class edge_item { 113 friend class ListGraph; 114 template <typename T> friend class EdgeMap; 115 116 friend class Node; 117 friend class NodeIt; 118 friend class Edge; 119 friend class EdgeIt; 120 friend class OutEdgeIt; 121 friend class InEdgeIt; 122 friend class SymEdgeIt; 123 friend std::ostream& operator<<(std::ostream& os, const Edge& i); 124 //ListGraph* G; 95 }; 96 97 struct edge_item { 125 98 int id; 126 99 node_item* _tail; … … 130 103 edge_item* _next_in; 131 104 edge_item* _prev_in; 132 public:133 edge_item() { }134 105 }; 135 106 … … 547 518 }; 548 519 520 inline 549 521 std::ostream& operator<<(std::ostream& os, const ListGraph::Node& i) { 550 522 if (i.valid()) 551 os << i.node->id; 523 os << i.node->id; 552 524 else 553 525 os << "invalid"; 554 526 return os; 555 527 } 528 529 inline 556 530 std::ostream& operator<<(std::ostream& os, const ListGraph::Edge& i) { 557 531 if (i.valid()) 558 os << "(" << i.edge->_tail->id << "--" << i.edge->id << "->" << i.edge->_head->id << ")"; 532 os << "(" << i.tailNode() << "--" << i.edge->id << "->" 533 << i.headNode() << ")"; 559 534 else 560 535 os << "invalid";
Note: See TracChangeset
for help on using the changeset viewer.