Naming and coding style fixes and various other changes.
2 * src/test/graph_test.cc - Part of LEMON, a generic C++ optimization library
4 * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
5 * (Egervary Combinatorial Optimization Research Group, EGRES).
7 * Permission to use, modify and distribute this software is granted
8 * provided that this copyright notice appears in all copies. For
9 * precise terms see the accompanying LICENSE file.
11 * This software is provided "AS IS" with no warranty of any kind,
12 * express or implied, and with no claim as to its suitability for any
18 #include<lemon/smart_graph.h>
19 #include<lemon/skeletons/graph.h>
20 #include<lemon/list_graph.h>
21 #include<lemon/full_graph.h>
23 #include"test_tools.h"
24 #include"graph_test.h"
28 This test makes consistency checks of list graph structures.
30 G.addNode(), G.addEdge(), G.tail(), G.head()
32 \todo Checks for empty graphs and isolated points.
36 using namespace lemon;
38 template<class Graph> void bidirPetersen(Graph &G)
40 typedef typename Graph::Edge Edge;
41 typedef typename Graph::EdgeIt EdgeIt;
43 checkGraphEdgeList(G,15);
47 for(EdgeIt e(G);e!=INVALID;++e) ee.push_back(e);
49 for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++)
50 G.addEdge(G.head(*p),G.tail(*p));
53 template<class Graph> void checkPetersen(Graph &G)
55 typedef typename Graph::Node Node;
57 typedef typename Graph::EdgeIt EdgeIt;
58 typedef typename Graph::NodeIt NodeIt;
60 checkGraphNodeList(G,10);
61 checkGraphEdgeList(G,30);
63 for(NodeIt n(G);n!=INVALID;++n) {
64 checkGraphInEdgeList(G,n,3);
65 checkGraphOutEdgeList(G,n,3);
70 template void lemon::skeleton::checkCompileStaticGraph<skeleton::StaticGraph>
71 (skeleton::StaticGraph &);
74 void lemon::skeleton::checkCompileExtendableGraph<skeleton::ExtendableGraph>
75 (skeleton::ExtendableGraph &);
78 void lemon::skeleton::checkCompileErasableGraph<skeleton::ErasableGraph>
79 (skeleton::ErasableGraph &);
83 void lemon::skeleton::checkCompileExtendableGraph<SmartGraph>(SmartGraph &);
85 void lemon::skeleton::checkCompileGraphFindEdge<SmartGraph>(SmartGraph &);
87 //Compile SymSmartGraph
88 //template void hugo::checkCompileGraph<SymSmartGraph>(SymSmartGraph &);
89 //template void hugo::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
93 void lemon::skeleton::checkCompileExtendableGraph<ListGraph>(ListGraph &);
95 void lemon::skeleton::checkCompileErasableGraph<ListGraph>(ListGraph &);
97 void lemon::skeleton::checkCompileGraphFindEdge<ListGraph>(ListGraph &);
100 //Compile SymListGraph
101 //template void hugo::checkCompileGraph<SymListGraph>(SymListGraph &);
102 //template void hugo::checkCompileErasableGraph<SymListGraph>(SymListGraph &);
103 //template void hugo::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
106 template void lemon::skeleton::checkCompileStaticGraph<FullGraph>(FullGraph &);
108 void lemon::skeleton::checkCompileGraphFindEdge<FullGraph>(FullGraph &);
110 //Compile EdgeSet <ListGraph>
111 template void lemon::skeleton::checkCompileExtendableGraph<EdgeSet <ListGraph> >
112 (EdgeSet <ListGraph> &);
113 template void lemon::skeleton::checkCompileGraphEraseEdge<EdgeSet <ListGraph> >
114 (EdgeSet <ListGraph> &);
115 template void lemon::skeleton::checkCompileGraphFindEdge<EdgeSet <ListGraph> >
116 (EdgeSet <ListGraph> &);
118 //Compile EdgeSet <NodeSet>
119 template void lemon::skeleton::checkCompileExtendableGraph<EdgeSet <NodeSet> >
120 (EdgeSet <NodeSet> &);
121 template void lemon::skeleton::checkCompileGraphEraseEdge<EdgeSet <NodeSet> >
122 (EdgeSet <NodeSet> &);
123 template void lemon::skeleton::checkCompileGraphFindEdge<EdgeSet <NodeSet> >
124 (EdgeSet <NodeSet> &);
154 ///\todo copy constr tests.
156 std::cout << __FILE__ ": All tests passed.\n";