COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/test/graph_utils_test.h @ 1040:372f08e8f403

Last change on this file since 1040:372f08e8f403 was 977:48962802d168, checked in by Mihaly Barasz, 20 years ago
  • enable_if imported from BOOST
  • count{Nodes,Edges} implemented via graph tags
  • some #include bugs fixed
File size: 1.3 KB
Line 
1/* -*- C++ -*-
2 * src/test/graph_utils_test.h - Part of LEMON, a generic C++ optimization library
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#ifndef LEMON_TEST_GRAPH_UTILS_TEST_H
17#define LEMON_TEST_GRAPH_UTILS_TEST_H
18
19
20#include "test_tools.h"
21
22//! \ingroup misc
23//! \file
24//! \brief Test cases for graph utils.
25namespace lemon {
26 
27  template <typename Graph>
28  void checkGraphCounters() {
29    const int num = 5;
30    Graph graph;
31    addPetersen(graph, num);
32    bidirGraph(graph);
33    check(countNodes(graph) == 2*num, "Wrong node number.");
34    check(countEdges(graph) == 6*num, "Wrong edge number.");   
35    for (typename Graph::NodeIt it(graph); it != INVALID; ++it) {
36      check(countOutEdges(graph, it) == 3, "Wrong out degree number.");
37      check(countInEdges(graph, it) == 3, "Wrong in degree number.");
38    }
39  }
40 
41} //namespace lemon
42
43
44#endif
Note: See TracBrowser for help on using the repository browser.