alpar@906
|
1 |
/* -*- C++ -*-
|
alpar@921
|
2 |
* src/test/graph_wrapper_test.cc - Part of LEMON, a generic C++ optimization library
|
alpar@906
|
3 |
*
|
alpar@906
|
4 |
* Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
|
alpar@906
|
5 |
* (Egervary Combinatorial Optimization Research Group, EGRES).
|
alpar@906
|
6 |
*
|
alpar@906
|
7 |
* Permission to use, modify and distribute this software is granted
|
alpar@906
|
8 |
* provided that this copyright notice appears in all copies. For
|
alpar@906
|
9 |
* precise terms see the accompanying LICENSE file.
|
alpar@906
|
10 |
*
|
alpar@906
|
11 |
* This software is provided "AS IS" with no warranty of any kind,
|
alpar@906
|
12 |
* express or implied, and with no claim as to its suitability for any
|
alpar@906
|
13 |
* purpose.
|
alpar@906
|
14 |
*
|
alpar@906
|
15 |
*/
|
alpar@906
|
16 |
|
marci@849
|
17 |
#include<iostream>
|
alpar@921
|
18 |
#include<lemon/smart_graph.h>
|
alpar@921
|
19 |
#include<lemon/skeletons/graph.h>
|
alpar@921
|
20 |
#include<lemon/list_graph.h>
|
alpar@921
|
21 |
#include<lemon/full_graph.h>
|
alpar@921
|
22 |
#include<lemon/graph_wrapper.h>
|
marci@849
|
23 |
|
marci@870
|
24 |
#include"test/test_tools.h"
|
marci@870
|
25 |
#include"test/graph_test.h"
|
marci@849
|
26 |
|
marci@849
|
27 |
/**
|
marci@849
|
28 |
\file
|
alpar@878
|
29 |
This test makes consistency checks of graph wrappers.
|
marci@849
|
30 |
|
alpar@878
|
31 |
\todo More extensive tests are needed
|
marci@849
|
32 |
*/
|
marci@849
|
33 |
|
alpar@921
|
34 |
using namespace lemon;
|
marci@849
|
35 |
|
marci@849
|
36 |
|
marci@849
|
37 |
typedef SmartGraph Graph;
|
deba@891
|
38 |
|
deba@891
|
39 |
//Compile GraphWrapper
|
marci@849
|
40 |
typedef GraphWrapper<Graph> GW;
|
marci@849
|
41 |
template void checkCompileStaticGraph<GW>(GW &);
|
marci@849
|
42 |
|
deba@891
|
43 |
//Compile RevGraphWrapper
|
marci@849
|
44 |
typedef RevGraphWrapper<Graph> RevGW;
|
marci@849
|
45 |
template void checkCompileStaticGraph<RevGW>(RevGW &);
|
deba@891
|
46 |
|
deba@891
|
47 |
//Compile SubGraphWrapper
|
deba@891
|
48 |
typedef SubGraphWrapper<Graph, Graph::NodeMap<bool>,
|
deba@891
|
49 |
Graph::EdgeMap<bool> > SubGW;
|
deba@891
|
50 |
template void checkCompileStaticGraph<SubGW>(SubGW &);
|
deba@891
|
51 |
|
marci@933
|
52 |
//Compile NodeSubGraphWrapper
|
marci@933
|
53 |
typedef NodeSubGraphWrapper<Graph, Graph::NodeMap<bool> > NodeSubGW;
|
marci@933
|
54 |
template void checkCompileStaticGraph<NodeSubGW>(NodeSubGW &);
|
marci@933
|
55 |
|
marci@933
|
56 |
//Compile EdgeSubGraphWrapper
|
marci@933
|
57 |
typedef EdgeSubGraphWrapper<Graph, Graph::EdgeMap<bool> > EdgeSubGW;
|
marci@933
|
58 |
template void checkCompileStaticGraph<EdgeSubGW>(EdgeSubGW &);
|
marci@933
|
59 |
|
deba@891
|
60 |
//Compile UndirGraphWrapper
|
deba@891
|
61 |
/// \bug UndirGraphWrapper cannot pass the StaticGraph test
|
deba@891
|
62 |
//typedef UndirGraphWrapper<Graph> UndirGW;
|
deba@891
|
63 |
//template void checkCompileStaticGraph<UndirGW>(UndirGW &);
|
deba@891
|
64 |
|
deba@891
|
65 |
//Compile UndirGraph
|
deba@891
|
66 |
//typedef UndirGraph<Graph> UndirG;
|
deba@891
|
67 |
//template void checkCompileStaticGraph<UndirG>(UndirG &);
|
deba@891
|
68 |
|
marci@892
|
69 |
//Compile SubBidirGraphWrapper
|
marci@892
|
70 |
typedef SubBidirGraphWrapper<Graph, Graph::EdgeMap<bool>,
|
marci@892
|
71 |
Graph::EdgeMap<bool> > SubBDGW;
|
marci@892
|
72 |
template void checkCompileStaticGraph<SubBDGW>(SubBDGW &);
|
deba@891
|
73 |
|
deba@891
|
74 |
//Compile BidirGraphWrapper
|
marci@892
|
75 |
typedef BidirGraphWrapper<Graph> BidirGW;
|
marci@892
|
76 |
template void checkCompileStaticGraph<BidirGW>(BidirGW &);
|
deba@891
|
77 |
|
deba@891
|
78 |
//Compile BidirGraph
|
marci@892
|
79 |
typedef BidirGraph<Graph> BidirG;
|
marci@892
|
80 |
template void checkCompileStaticGraph<BidirG>(BidirG &);
|
deba@891
|
81 |
|
deba@891
|
82 |
//Compile ResGraphWrapper
|
marci@892
|
83 |
typedef ResGraphWrapper<Graph, int, Graph::EdgeMap<int>,
|
marci@892
|
84 |
Graph::EdgeMap<int> > ResGW;
|
marci@892
|
85 |
template void checkCompileStaticGraph<ResGW>(ResGW &);
|
deba@891
|
86 |
|
deba@891
|
87 |
//Compile ErasingFirstGraphWrapper
|
deba@891
|
88 |
typedef ErasingFirstGraphWrapper<Graph, Graph::NodeMap<Graph::Edge> > ErasingFirstGW;
|
deba@891
|
89 |
template void checkCompileStaticGraph<ErasingFirstGW>(ErasingFirstGW &);
|
marci@849
|
90 |
|
marci@849
|
91 |
|
marci@849
|
92 |
int main()
|
marci@849
|
93 |
{
|
marci@849
|
94 |
std::cout << __FILE__ ": All tests passed.\n";
|
marci@849
|
95 |
|
marci@849
|
96 |
return 0;
|
marci@849
|
97 |
}
|