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