/* -*- C++ -*- * * This file is a part of LEMON, a generic C++ optimization library * * Copyright (C) 2003-2006 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * * Permission to use, modify and distribute this software is granted * provided that this copyright notice appears in all copies. For * precise terms see the accompanying LICENSE file. * * This software is provided "AS IS" with no warranty of any kind, * express or implied, and with no claim as to its suitability for any * purpose. * */ #ifndef LEMON_TEST_GRAPH_TEST_H #define LEMON_TEST_GRAPH_TEST_H #include #include "test_tools.h" //! \ingroup misc //! \file //! \brief Some utility and test cases to test graph classes. namespace lemon { template void checkGraphNodeList(Graph &G, int nn) { typename Graph::NodeIt n(G); for(int i=0;i void checkGraphEdgeList(Graph &G, int nn) { typedef typename Graph::EdgeIt EdgeIt; EdgeIt e(G); for(int i=0;i void checkGraphOutEdgeList(Graph &G, typename Graph::Node n, int nn) { typename Graph::OutEdgeIt e(G,n); for(int i=0;i void checkGraphInEdgeList(Graph &G, typename Graph::Node n, int nn) { typename Graph::InEdgeIt e(G,n); for(int i=0;i void checkGraph() { const int num = 5; Graph G; addPetersen(G, num); bidirGraph(G); checkBidirPetersen(G, num); } template void checkGraphIterators(const Graph& graph) { typedef typename Graph::Node Node; typedef typename Graph::NodeIt NodeIt; typedef typename Graph::Edge Edge; typedef typename Graph::EdgeIt EdgeIt; typedef typename Graph::InEdgeIt InEdgeIt; typedef typename Graph::OutEdgeIt OutEdgeIt; typedef ConEdgeIt ConEdgeIt; for (NodeIt it(graph); it != INVALID; ++it) {} } ///\file ///\todo Check target(), source() as well; } //namespace lemon #endif