deba@937
|
1 |
/* -*- C++ -*-
|
deba@937
|
2 |
* src/test/sym_graph_test.cc - Part of LEMON, a generic C++ optimization library
|
deba@937
|
3 |
*
|
deba@937
|
4 |
* Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
|
deba@937
|
5 |
* (Egervary Combinatorial Optimization Research Group, EGRES).
|
deba@937
|
6 |
*
|
deba@937
|
7 |
* Permission to use, modify and distribute this software is granted
|
deba@937
|
8 |
* provided that this copyright notice appears in all copies. For
|
deba@937
|
9 |
* precise terms see the accompanying LICENSE file.
|
deba@937
|
10 |
*
|
deba@937
|
11 |
* This software is provided "AS IS" with no warranty of any kind,
|
deba@937
|
12 |
* express or implied, and with no claim as to its suitability for any
|
deba@937
|
13 |
* purpose.
|
deba@937
|
14 |
*
|
deba@937
|
15 |
*/
|
deba@937
|
16 |
|
deba@937
|
17 |
#include<iostream>
|
deba@937
|
18 |
|
deba@937
|
19 |
#include<lemon/skeletons/sym_graph.h>
|
deba@937
|
20 |
|
deba@937
|
21 |
#include<lemon/list_graph.h>
|
deba@937
|
22 |
#include<lemon/smart_graph.h>
|
deba@937
|
23 |
#include<lemon/full_graph.h>
|
deba@937
|
24 |
|
deba@937
|
25 |
#include"test_tools.h"
|
deba@937
|
26 |
#include"graph_test.h"
|
deba@937
|
27 |
#include"sym_graph_test.h"
|
deba@937
|
28 |
|
deba@937
|
29 |
/**
|
deba@937
|
30 |
\file
|
deba@937
|
31 |
This test makes consistency checks of list graph structures.
|
deba@937
|
32 |
|
deba@937
|
33 |
G.addNode(), G.addEdge(), G.tail(), G.head()
|
deba@937
|
34 |
|
deba@937
|
35 |
\todo Checks for empty graphs and isolated points.
|
deba@937
|
36 |
conversion.
|
deba@937
|
37 |
*/
|
deba@937
|
38 |
|
deba@937
|
39 |
using namespace lemon;
|
deba@937
|
40 |
|
deba@937
|
41 |
template<class Graph> void checkPetersen(Graph &G)
|
deba@937
|
42 |
{
|
deba@937
|
43 |
typedef typename Graph::NodeIt NodeIt;
|
deba@937
|
44 |
|
deba@937
|
45 |
|
deba@937
|
46 |
checkGraphNodeList(G,10);
|
deba@937
|
47 |
checkGraphEdgeList(G,30);
|
deba@937
|
48 |
checkGraphSymEdgeList(G,15);
|
deba@937
|
49 |
|
deba@937
|
50 |
for(NodeIt n(G);n!=INVALID;++n) {
|
deba@937
|
51 |
checkGraphInEdgeList(G,n,3);
|
deba@937
|
52 |
checkGraphOutEdgeList(G,n,3);
|
deba@937
|
53 |
}
|
deba@937
|
54 |
}
|
deba@937
|
55 |
|
deba@937
|
56 |
//Compile Graph
|
deba@937
|
57 |
template void lemon::checkCompileStaticSymGraph<skeleton::StaticSymGraph>
|
deba@937
|
58 |
(skeleton::StaticSymGraph &);
|
deba@937
|
59 |
|
deba@937
|
60 |
template void lemon::checkCompileSymGraph<skeleton::ExtendableSymGraph>
|
deba@937
|
61 |
(skeleton::ExtendableSymGraph &);
|
deba@937
|
62 |
|
deba@937
|
63 |
template void lemon::checkCompileErasableSymGraph<skeleton::ErasableSymGraph>
|
deba@937
|
64 |
(skeleton::ErasableSymGraph &);
|
deba@937
|
65 |
|
deba@937
|
66 |
|
deba@937
|
67 |
//Compile SymSmartGraph
|
deba@937
|
68 |
template void lemon::checkCompileSymGraph<SymSmartGraph>(SymSmartGraph &);
|
alpar@938
|
69 |
template
|
alpar@938
|
70 |
void lemon::skeleton::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
|
deba@937
|
71 |
|
deba@937
|
72 |
//Compile SymListGraph
|
deba@937
|
73 |
template void lemon::checkCompileSymGraph<SymListGraph>(SymListGraph &);
|
deba@937
|
74 |
template void lemon::checkCompileErasableSymGraph<SymListGraph>(SymListGraph &);
|
alpar@938
|
75 |
template
|
alpar@938
|
76 |
void lemon::skeleton::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
|
deba@937
|
77 |
|
deba@937
|
78 |
int main()
|
deba@937
|
79 |
{
|
deba@937
|
80 |
{
|
deba@937
|
81 |
SymSmartGraph G;
|
deba@937
|
82 |
addSymPetersen(G);
|
deba@937
|
83 |
checkPetersen(G);
|
deba@937
|
84 |
}
|
deba@937
|
85 |
{
|
deba@937
|
86 |
SymListGraph G;
|
deba@937
|
87 |
addSymPetersen(G);
|
deba@937
|
88 |
checkPetersen(G);
|
deba@937
|
89 |
}
|
deba@937
|
90 |
|
deba@937
|
91 |
///\file
|
deba@937
|
92 |
///\todo map tests.
|
deba@937
|
93 |
///\todo copy constr tests.
|
deba@937
|
94 |
|
deba@937
|
95 |
std::cout << __FILE__ ": All tests passed.\n";
|
deba@937
|
96 |
|
deba@937
|
97 |
return 0;
|
deba@937
|
98 |
}
|