COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/digraph_test.cc

    r228 r354  
    2020#include <lemon/list_graph.h>
    2121#include <lemon/smart_graph.h>
    22 //#include <lemon/full_graph.h>
     22#include <lemon/full_graph.h>
    2323//#include <lemon/hypercube_graph.h>
    2424
     
    8080}
    8181
     82void checkFullDigraph(int num) {
     83  typedef FullDigraph Digraph;
     84  DIGRAPH_TYPEDEFS(Digraph);
     85  Digraph G(num);
     86
     87  checkGraphNodeList(G, num);
     88  checkGraphArcList(G, num * num);
     89
     90  for (NodeIt n(G); n != INVALID; ++n) {
     91    checkGraphOutArcList(G, n, num);
     92    checkGraphInArcList(G, n, num);
     93  }
     94
     95  checkGraphConArcList(G, num * num);
     96
     97  checkNodeIds(G);
     98  checkArcIds(G);
     99  checkGraphNodeMap(G);
     100  checkGraphArcMap(G);
     101
     102  for (int i = 0; i < G.nodeNum(); ++i) {
     103    check(G.index(G(i)) == i, "Wrong index");
     104  }
     105
     106  for (NodeIt s(G); s != INVALID; ++s) {
     107    for (NodeIt t(G); t != INVALID; ++t) {
     108      Arc a = G.arc(s, t);
     109      check(G.source(a) == s && G.target(a) == t, "Wrong arc lookup");
     110    }
     111  }
     112
     113}
     114
    82115
    83116void checkConcepts() {
     
    110143    checkConcept<ClearableDigraphComponent<>, SmartDigraph>();
    111144  }
    112 //  { // Checking FullDigraph
    113 //    checkConcept<Digraph, FullDigraph>();
    114 //  }
     145  { // Checking FullDigraph
     146    checkConcept<Digraph, FullDigraph>();
     147  }
    115148//  { // Checking HyperCubeDigraph
    116149//    checkConcept<Digraph, HyperCubeDigraph>();
     
    177210    checkDigraphValidity<SmartDigraph>();
    178211  }
     212  { // Checking FullDigraph
     213    checkFullDigraph(8);
     214  }
    179215}
    180216
Note: See TracChangeset for help on using the changeset viewer.