COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/test/sym_graph_test.cc @ 1331:7e93d3f0406d

Last change on this file since 1331:7e93d3f0406d was 1164:80bb73097736, checked in by Alpar Juttner, 20 years ago

A year has passed again.

File size: 2.3 KB
RevLine 
[937]1/* -*- C++ -*-
2 * src/test/sym_graph_test.cc - Part of LEMON, a generic C++ optimization library
3 *
[1164]4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
[937]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
17#include<iostream>
18
[959]19#include<lemon/concept/sym_graph.h>
[937]20
21#include<lemon/list_graph.h>
22#include<lemon/smart_graph.h>
23#include<lemon/full_graph.h>
24
25#include"test_tools.h"
26#include"graph_test.h"
27#include"sym_graph_test.h"
28
29/**
30\file
31This test makes consistency checks of list graph structures.
32
[986]33G.addNode(), G.addEdge(), G.source(), G.target()
[937]34
35\todo Checks for empty graphs and isolated points.
36conversion.
37*/
38
39using namespace lemon;
40
41template<class Graph> void checkPetersen(Graph &G)
42{
43  typedef typename Graph::NodeIt NodeIt;
44
45
46  checkGraphNodeList(G,10);
47  checkGraphEdgeList(G,30);
48  checkGraphSymEdgeList(G,15);
49
50  for(NodeIt n(G);n!=INVALID;++n) {
51    checkGraphInEdgeList(G,n,3);
52    checkGraphOutEdgeList(G,n,3);
53  } 
54}
55
56//Compile Graph
[959]57template void lemon::checkCompileStaticSymGraph<concept::StaticSymGraph>
58(concept::StaticSymGraph &);
[937]59
[959]60template void lemon::checkCompileSymGraph<concept::ExtendableSymGraph>
61(concept::ExtendableSymGraph &);
[937]62
[959]63template void lemon::checkCompileErasableSymGraph<concept::ErasableSymGraph>
64(concept::ErasableSymGraph &);
[937]65
66
67//Compile SymSmartGraph
68template void lemon::checkCompileSymGraph<SymSmartGraph>(SymSmartGraph &);
[938]69template
[959]70void lemon::concept::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
[937]71
72//Compile SymListGraph
73template void lemon::checkCompileSymGraph<SymListGraph>(SymListGraph &);
74template void lemon::checkCompileErasableSymGraph<SymListGraph>(SymListGraph &);
[938]75template
[959]76void lemon::concept::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
[937]77
78int main()
79{
80  {
81    SymSmartGraph G;
82    addSymPetersen(G);
83    checkPetersen(G);
84  }
85  {
86    SymListGraph G;
87    addSymPetersen(G);
88    checkPetersen(G);
89  }
90
91  ///\file
92  ///\todo map tests.
93  ///\todo copy constr tests.
94
95  std::cout << __FILE__ ": All tests passed.\n";
96
97  return 0;
98}
Note: See TracBrowser for help on using the repository browser.