The graph adadptors can be alteration observed.
In most cases it uses the adapted graph alteration notifiers.
Only special case is now the UndirGraphAdaptor, where
we have to proxy the signals from the graph.
The SubBidirGraphAdaptor is removed, because it doest not
gives more feature than the EdgeSubGraphAdaptor<UndirGraphAdaptor<Graph>>.
The ResGraphAdaptor is based on this composition.
3 * This file is a part of LEMON, a generic C++ optimization library
5 * Copyright (C) 2003-2006
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
20 #include<lemon/smart_graph.h>
21 #include<lemon/concept/graph.h>
22 #include<lemon/concept/maps.h>
23 #include<lemon/list_graph_base.h>
24 #include<lemon/full_graph.h>
26 #include"test_tools.h"
27 #include"graph_test.h"
31 This test makes consistency checks of list graph structures.
33 G.addNode(), G.addEdge(), G.source(), G.target()
35 \todo Checks for empty graphs and isolated points.
39 using namespace lemon;
41 template<class Graph> void bidirPetersen(Graph &G)
43 typedef typename Graph::Edge Edge;
44 typedef typename Graph::EdgeIt EdgeIt;
46 checkGraphEdgeList(G,15);
50 for(EdgeIt e(G);e!=INVALID;++e) ee.push_back(e);
52 for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++)
53 G.addEdge(G.target(*p),G.source(*p));
56 template<class Graph> void checkPetersen(Graph &G)
58 typedef typename Graph::Node Node;
60 typedef typename Graph::EdgeIt EdgeIt;
61 typedef typename Graph::NodeIt NodeIt;
63 checkGraphNodeList(G,10);
64 checkGraphEdgeList(G,30);
66 for(NodeIt n(G);n!=INVALID;++n) {
67 checkGraphInEdgeList(G,n,3);
68 checkGraphOutEdgeList(G,n,3);
73 template void lemon::concept::checkCompileStaticGraph<concept::StaticGraph>
74 (concept::StaticGraph &);
77 void lemon::concept::checkCompileExtendableGraph<concept::ExtendableGraph>
78 (concept::ExtendableGraph &);
81 void lemon::concept::checkCompileErasableGraph<concept::ErasableGraph>
82 (concept::ErasableGraph &);
86 void lemon::concept::checkCompileExtendableGraph<SmartGraph>(SmartGraph &);
88 void lemon::concept::checkCompileGraphFindEdge<SmartGraph>(SmartGraph &);
90 //Compile SymSmartGraph
91 //template void hugo::checkCompileGraph<SymSmartGraph>(SymSmartGraph &);
92 //template void hugo::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
96 void lemon::concept::checkCompileExtendableGraph<ListGraph>(ListGraph &);
98 void lemon::concept::checkCompileErasableGraph<ListGraph>(ListGraph &);
100 void lemon::concept::checkCompileGraphFindEdge<ListGraph>(ListGraph &);
103 //Compile SymListGraph
104 //template void hugo::checkCompileGraph<SymListGraph>(SymListGraph &);
105 //template void hugo::checkCompileErasableGraph<SymListGraph>(SymListGraph &);
106 //template void hugo::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
109 template void lemon::concept::checkCompileStaticGraph<FullGraph>(FullGraph &);
111 void lemon::concept::checkCompileGraphFindEdge<FullGraph>(FullGraph &);
141 ///\todo copy constr tests.
145 // FIXME: These shouldn't be here.
146 using namespace concept;
147 function_requires< ReadMapConcept< ReadMap<int,int> > >();
148 function_requires< WriteMapConcept< WriteMap<int,int> > >();
149 function_requires< ReadWriteMapConcept< ReadWriteMap<int,int> > >();
150 function_requires< ReferenceMapConcept< ReferenceMap<int,int> > >();
153 std::cout << __FILE__ ": All tests passed.\n";