deba@909: /* -*- C++ -*- deba@909: * src/test/sym_graph_test.cc - Part of HUGOlib, a generic C++ optimization library deba@909: * deba@909: * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport deba@909: * (Egervary Combinatorial Optimization Research Group, EGRES). deba@909: * deba@909: * Permission to use, modify and distribute this software is granted deba@909: * provided that this copyright notice appears in all copies. For deba@909: * precise terms see the accompanying LICENSE file. deba@909: * deba@909: * This software is provided "AS IS" with no warranty of any kind, deba@909: * express or implied, and with no claim as to its suitability for any deba@909: * purpose. deba@909: * deba@909: */ deba@909: deba@909: #include deba@909: deba@909: #include deba@909: deba@909: #include deba@909: #include deba@909: #include deba@909: deba@909: #include"test_tools.h" deba@909: #include"graph_test.h" deba@909: #include"sym_graph_test.h" deba@909: deba@909: /** deba@909: \file deba@909: This test makes consistency checks of list graph structures. deba@909: deba@909: G.addNode(), G.addEdge(), G.tail(), G.head() deba@909: deba@909: \todo Checks for empty graphs and isolated points. deba@909: conversion. deba@909: */ deba@909: deba@909: using namespace hugo; deba@909: deba@909: template void checkPetersen(Graph &G) deba@909: { deba@909: typedef typename Graph::NodeIt NodeIt; deba@909: deba@909: deba@909: checkGraphNodeList(G,10); deba@909: checkGraphEdgeList(G,30); deba@909: checkGraphSymEdgeList(G,15); deba@909: deba@909: for(NodeIt n(G);n!=INVALID;++n) { deba@909: checkGraphInEdgeList(G,n,3); deba@909: checkGraphOutEdgeList(G,n,3); deba@909: } deba@909: } deba@909: deba@909: //Compile Graph deba@909: template void hugo::checkCompileStaticSymGraph deba@909: (skeleton::StaticSymGraph &); deba@909: deba@909: template void hugo::checkCompileSymGraph deba@909: (skeleton::ExtendableSymGraph &); deba@909: deba@909: template void hugo::checkCompileErasableSymGraph deba@909: (skeleton::ErasableSymGraph &); deba@909: deba@909: deba@909: //Compile SymSmartGraph deba@909: template void hugo::checkCompileSymGraph(SymSmartGraph &); deba@909: template void hugo::checkCompileGraphFindEdge(SymSmartGraph &); deba@909: deba@909: //Compile SymListGraph deba@909: template void hugo::checkCompileSymGraph(SymListGraph &); deba@909: template void hugo::checkCompileErasableSymGraph(SymListGraph &); deba@909: template void hugo::checkCompileGraphFindEdge(SymListGraph &); deba@909: deba@909: int main() deba@909: { deba@909: { deba@909: SymSmartGraph G; deba@909: addSymPetersen(G); deba@909: checkPetersen(G); deba@909: } deba@909: { deba@909: SymListGraph G; deba@909: addSymPetersen(G); deba@909: checkPetersen(G); deba@909: } deba@909: deba@909: ///\file deba@909: ///\todo map tests. deba@909: ///\todo copy constr tests. deba@909: deba@909: std::cout << __FILE__ ": All tests passed.\n"; deba@909: deba@909: return 0; deba@909: }