COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/digraph_test.cc

    r228 r365  
    2020#include <lemon/list_graph.h>
    2121#include <lemon/smart_graph.h>
    22 //#include <lemon/full_graph.h>
    23 //#include <lemon/hypercube_graph.h>
     22#include <lemon/full_graph.h>
    2423
    2524#include "test_tools.h"
     
    8079}
    8180
     81void checkFullDigraph(int num) {
     82  typedef FullDigraph Digraph;
     83  DIGRAPH_TYPEDEFS(Digraph);
     84  Digraph G(num);
     85
     86  checkGraphNodeList(G, num);
     87  checkGraphArcList(G, num * num);
     88
     89  for (NodeIt n(G); n != INVALID; ++n) {
     90    checkGraphOutArcList(G, n, num);
     91    checkGraphInArcList(G, n, num);
     92  }
     93
     94  checkGraphConArcList(G, num * num);
     95
     96  checkNodeIds(G);
     97  checkArcIds(G);
     98  checkGraphNodeMap(G);
     99  checkGraphArcMap(G);
     100
     101  for (int i = 0; i < G.nodeNum(); ++i) {
     102    check(G.index(G(i)) == i, "Wrong index");
     103  }
     104
     105  for (NodeIt s(G); s != INVALID; ++s) {
     106    for (NodeIt t(G); t != INVALID; ++t) {
     107      Arc a = G.arc(s, t);
     108      check(G.source(a) == s && G.target(a) == t, "Wrong arc lookup");
     109    }
     110  }
     111
     112}
    82113
    83114void checkConcepts() {
     
    110141    checkConcept<ClearableDigraphComponent<>, SmartDigraph>();
    111142  }
    112 //  { // Checking FullDigraph
    113 //    checkConcept<Digraph, FullDigraph>();
    114 //  }
    115 //  { // Checking HyperCubeDigraph
    116 //    checkConcept<Digraph, HyperCubeDigraph>();
    117 //  }
     143  { // Checking FullDigraph
     144    checkConcept<Digraph, FullDigraph>();
     145  }
    118146}
    119147
     
    177205    checkDigraphValidity<SmartDigraph>();
    178206  }
     207  { // Checking FullDigraph
     208    checkFullDigraph(8);
     209  }
    179210}
    180211
Note: See TracChangeset for help on using the changeset viewer.