bug fix. previously, it did not work with graphs having non-reference node-maps
3 * src/lemon/concept/undir_graph_component.h - Part of LEMON, a generic
4 * C++ optimization library
6 * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi
7 * Kutatocsoport (Egervary Combinatorial Optimization Research Group,
10 * Permission to use, modify and distribute this software is granted
11 * provided that this copyright notice appears in all copies. For
12 * precise terms see the accompanying LICENSE file.
14 * This software is provided "AS IS" with no warranty of any kind,
15 * express or implied, and with no claim as to its suitability for any
22 ///\brief Undirected graphs and components of.
25 #ifndef LEMON_CONCEPT_UNDIR_GRAPH_H
26 #define LEMON_CONCEPT_UNDIR_GRAPH_H
28 #include <lemon/concept/graph_component.h>
35 struct BaseIterableUndirGraphConcept {
37 template <typename Graph>
40 typedef typename Graph::UndirEdge UndirEdge;
41 typedef typename Graph::Edge Edge;
42 typedef typename Graph::Node Node;
45 checkConcept<BaseIterableGraphComponent, Graph>();
46 checkConcept<GraphItem<'u'>, UndirEdge >();
48 /// \bug this should be base_and_derived:
66 struct IterableUndirGraphConcept {
68 template <typename Graph>
71 /// \todo we don't need the iterable component to be base iterable
72 /// Don't we really???
73 //checkConcept< BaseIterableUndirGraphConcept, Graph > ();
75 checkConcept<IterableGraphComponent, Graph> ();
77 typedef typename Graph::UndirEdge UndirEdge;
78 typedef typename Graph::UndirEdgeIt UndirEdgeIt;
79 typedef typename Graph::UndirIncEdgeIt UndirIncEdgeIt;
81 checkConcept<GraphIterator<Graph, UndirEdge>, UndirEdgeIt>();
82 checkConcept<GraphIncIterator<Graph, UndirEdge>, UndirIncEdgeIt>();
88 struct MappableUndirGraphConcept {
90 template <typename Graph>
96 Dummy(int _v) : value(_v) {}
100 checkConcept<MappableGraphComponent, Graph>();
102 typedef typename Graph::template UndirEdgeMap<int> IntMap;
103 checkConcept<GraphMap<Graph, typename Graph::UndirEdge, int>,
106 typedef typename Graph::template UndirEdgeMap<bool> BoolMap;
107 checkConcept<GraphMap<Graph, typename Graph::UndirEdge, bool>,
110 typedef typename Graph::template UndirEdgeMap<Dummy> DummyMap;
111 checkConcept<GraphMap<Graph, typename Graph::UndirEdge, Dummy>,
118 struct ExtendableUndirGraphConcept {
120 template <typename Graph>
123 node_a = graph.addNode();
124 uedge = graph.addEdge(node_a, node_b);
126 typename Graph::Node node_a, node_b;
127 typename Graph::UndirEdge uedge;
133 struct ErasableUndirGraphConcept {
135 template <typename Graph>
142 typename Graph::Node n;
143 typename Graph::UndirEdge e;
151 template <typename Graph>
154 checkConcept<BaseIterableUndirGraphConcept, Graph>();
155 checkConcept<IterableUndirGraphConcept, Graph>();
156 checkConcept<MappableUndirGraphConcept, Graph>();
162 class ExtendableUndirGraph : public UndirGraph {
165 template <typename Graph>
168 checkConcept<BaseIterableUndirGraphConcept, Graph>();
169 checkConcept<IterableUndirGraphConcept, Graph>();
170 checkConcept<MappableUndirGraphConcept, Graph>();
172 checkConcept<UndirGraph, Graph>();
173 checkConcept<ExtendableUndirGraphConcept, Graph>();
174 checkConcept<ClearableGraphComponent, Graph>();
180 class ErasableUndirGraph : public ExtendableUndirGraph {
183 template <typename Graph>
186 checkConcept<ExtendableUndirGraph, Graph>();
187 checkConcept<ErasableUndirGraphConcept, Graph>();