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