equal
deleted
inserted
replaced
25 |
25 |
26 #include <lemon/invalid.h> |
26 #include <lemon/invalid.h> |
27 |
27 |
28 #include <lemon/clearable_graph_extender.h> |
28 #include <lemon/clearable_graph_extender.h> |
29 #include <lemon/extendable_graph_extender.h> |
29 #include <lemon/extendable_graph_extender.h> |
30 #include <lemon/idmappable_graph_extender.h> |
|
31 #include <lemon/iterable_graph_extender.h> |
30 #include <lemon/iterable_graph_extender.h> |
32 #include <lemon/alteration_observer_registry.h> |
31 #include <lemon/alteration_observer_registry.h> |
33 #include <lemon/default_map.h> |
32 #include <lemon/default_map.h> |
34 |
33 |
35 #include <lemon/utility.h> |
34 #include <lemon/utility.h> |
89 |
88 |
90 /// Maximum node ID. |
89 /// Maximum node ID. |
91 |
90 |
92 /// Maximum node ID. |
91 /// Maximum node ID. |
93 ///\sa id(Node) |
92 ///\sa id(Node) |
94 int maxNodeId() const { return nodes.size()-1; } |
93 int maxId(Node = INVALID) const { return nodes.size()-1; } |
95 /// Maximum edge ID. |
94 /// Maximum edge ID. |
96 |
95 |
97 /// Maximum edge ID. |
96 /// Maximum edge ID. |
98 ///\sa id(Edge) |
97 ///\sa id(Edge) |
99 int maxEdgeId() const { return edges.size()-1; } |
98 int maxId(Edge = INVALID) const { return edges.size()-1; } |
100 |
99 |
101 Node tail(Edge e) const { return edges[e.n].tail; } |
100 Node tail(Edge e) const { return edges[e.n].tail; } |
102 Node head(Edge e) const { return edges[e.n].head; } |
101 Node head(Edge e) const { return edges[e.n].head; } |
103 |
102 |
104 /// Node ID. |
103 /// Node ID. |
219 |
218 |
220 }; |
219 }; |
221 |
220 |
222 typedef AlterableGraphExtender<SmartGraphBase> AlterableSmartGraphBase; |
221 typedef AlterableGraphExtender<SmartGraphBase> AlterableSmartGraphBase; |
223 typedef IterableGraphExtender<AlterableSmartGraphBase> IterableSmartGraphBase; |
222 typedef IterableGraphExtender<AlterableSmartGraphBase> IterableSmartGraphBase; |
224 typedef IdMappableGraphExtender<IterableSmartGraphBase> IdMappableSmartGraphBase; |
223 typedef DefaultMappableGraphExtender<IterableSmartGraphBase> MappableSmartGraphBase; |
225 typedef DefaultMappableGraphExtender<IdMappableSmartGraphBase> MappableSmartGraphBase; |
|
226 typedef ExtendableGraphExtender<MappableSmartGraphBase> ExtendableSmartGraphBase; |
224 typedef ExtendableGraphExtender<MappableSmartGraphBase> ExtendableSmartGraphBase; |
227 typedef ClearableGraphExtender<ExtendableSmartGraphBase> ClearableSmartGraphBase; |
225 typedef ClearableGraphExtender<ExtendableSmartGraphBase> ClearableSmartGraphBase; |
228 |
226 |
229 ///A smart graph class. |
227 ///A smart graph class. |
230 |
228 |
237 ///\sa concept::ExtendableGraph. |
235 ///\sa concept::ExtendableGraph. |
238 /// |
236 /// |
239 ///\todo Some member functions could be \c static. |
237 ///\todo Some member functions could be \c static. |
240 /// |
238 /// |
241 ///\author Alpar Juttner |
239 ///\author Alpar Juttner |
242 class SmartGraph :public ClearableSmartGraphBase { |
240 class SmartGraph : public ClearableSmartGraphBase { |
243 public: |
241 public: |
244 /// Finds an edge between two nodes. |
242 /// Finds an edge between two nodes. |
245 |
243 |
246 /// Finds an edge from node \c u to node \c v. |
244 /// Finds an edge from node \c u to node \c v. |
247 /// |
245 /// |