equal
deleted
inserted
replaced
25 #include <lemon/bits/clearable_graph_extender.h> |
25 #include <lemon/bits/clearable_graph_extender.h> |
26 #include <lemon/bits/extendable_graph_extender.h> |
26 #include <lemon/bits/extendable_graph_extender.h> |
27 #include <lemon/bits/iterable_graph_extender.h> |
27 #include <lemon/bits/iterable_graph_extender.h> |
28 #include <lemon/bits/alteration_notifier.h> |
28 #include <lemon/bits/alteration_notifier.h> |
29 #include <lemon/bits/default_map.h> |
29 #include <lemon/bits/default_map.h> |
30 |
30 #include <lemon/bits/graph_extender.h> |
31 #include <lemon/bits/undir_graph_extender.h> |
|
32 |
31 |
33 #include <lemon/error.h> |
32 #include <lemon/error.h> |
34 |
33 |
35 #include <list> |
34 #include <list> |
36 |
35 |
103 |
102 |
104 /// Maximum node ID. |
103 /// Maximum node ID. |
105 |
104 |
106 /// Maximum node ID. |
105 /// Maximum node ID. |
107 ///\sa id(Node) |
106 ///\sa id(Node) |
108 int maxId(Node = INVALID) const { return nodes.size()-1; } |
107 int maxNodeId() const { return nodes.size()-1; } |
109 |
108 |
110 /// Maximum edge ID. |
109 /// Maximum edge ID. |
111 |
110 |
112 /// Maximum edge ID. |
111 /// Maximum edge ID. |
113 ///\sa id(Edge) |
112 ///\sa id(Edge) |
114 int maxId(Edge = INVALID) const { return edges.size()-1; } |
113 int maxEdgeId() const { return edges.size()-1; } |
115 |
114 |
116 Node source(Edge e) const { return edges[e.id].source; } |
115 Node source(Edge e) const { return edges[e.id].source; } |
117 Node target(Edge e) const { return edges[e.id].target; } |
116 Node target(Edge e) const { return edges[e.id].target; } |
118 |
117 |
119 |
118 |
162 |
161 |
163 |
162 |
164 static int id(Node v) { return v.id; } |
163 static int id(Node v) { return v.id; } |
165 static int id(Edge e) { return e.id; } |
164 static int id(Edge e) { return e.id; } |
166 |
165 |
167 static Node fromId(int id, Node) { return Node(id);} |
166 static Node nodeFromId(int id) { return Node(id);} |
168 static Edge fromId(int id, Edge) { return Edge(id);} |
167 static Edge edgeFromId(int id) { return Edge(id);} |
169 |
168 |
170 /// Adds a new node to the graph. |
169 /// Adds a new node to the graph. |
171 |
170 |
172 /// \warning It adds the new node to the front of the list. |
171 /// \warning It adds the new node to the front of the list. |
173 /// (i.e. the lastly added node becomes the first.) |
172 /// (i.e. the lastly added node becomes the first.) |
313 typedef ErasableGraphExtender< |
312 typedef ErasableGraphExtender< |
314 ClearableGraphExtender< |
313 ClearableGraphExtender< |
315 ExtendableGraphExtender< |
314 ExtendableGraphExtender< |
316 MappableGraphExtender< |
315 MappableGraphExtender< |
317 IterableGraphExtender< |
316 IterableGraphExtender< |
318 AlterableGraphExtender<ListGraphBase> > > > > > ExtendedListGraphBase; |
317 AlterableGraphExtender< |
|
318 GraphExtender<ListGraphBase> > > > > > > ExtendedListGraphBase; |
319 |
319 |
320 /// \addtogroup graphs |
320 /// \addtogroup graphs |
321 /// @{ |
321 /// @{ |
322 |
322 |
323 ///A list graph class. |
323 ///A list graph class. |