test/graph_test.cc
changeset 1030 4936be66d2f5
parent 877 141f9c0db4a3
parent 997 761fe0846f49
child 1084 8b2d4e5d96e4
equal deleted inserted replaced
20:d7cd00e42ec9 22:dfffbd94d230
    64   checkGraphConEdgeList(G, 1);
    64   checkGraphConEdgeList(G, 1);
    65   checkGraphConArcList(G, 2);
    65   checkGraphConArcList(G, 2);
    66 
    66 
    67   Edge e2 = G.addEdge(n2, n1),
    67   Edge e2 = G.addEdge(n2, n1),
    68        e3 = G.addEdge(n2, n3);
    68        e3 = G.addEdge(n2, n3);
       
    69   ignore_unused_variable_warning(e2,e3);
    69 
    70 
    70   checkGraphNodeList(G, 3);
    71   checkGraphNodeList(G, 3);
    71   checkGraphEdgeList(G, 3);
    72   checkGraphEdgeList(G, 3);
    72   checkGraphArcList(G, 6);
    73   checkGraphArcList(G, 6);
    73 
    74 
    96   Node n1 = G.addNode(), n2 = G.addNode(),
    97   Node n1 = G.addNode(), n2 = G.addNode(),
    97        n3 = G.addNode(), n4 = G.addNode();
    98        n3 = G.addNode(), n4 = G.addNode();
    98   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
    99   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
    99        e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
   100        e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
   100        e5 = G.addEdge(n4, n3);
   101        e5 = G.addEdge(n4, n3);
       
   102   ignore_unused_variable_warning(e1,e3,e4,e5);
   101 
   103 
   102   checkGraphNodeList(G, 4);
   104   checkGraphNodeList(G, 4);
   103   checkGraphEdgeList(G, 5);
   105   checkGraphEdgeList(G, 5);
   104   checkGraphArcList(G, 10);
   106   checkGraphArcList(G, 10);
   105 
   107 
   175   Node n1 = G.addNode(), n2 = G.addNode(),
   177   Node n1 = G.addNode(), n2 = G.addNode(),
   176        n3 = G.addNode(), n4 = G.addNode();
   178        n3 = G.addNode(), n4 = G.addNode();
   177   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
   179   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
   178        e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
   180        e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
   179        e5 = G.addEdge(n4, n3);
   181        e5 = G.addEdge(n4, n3);
       
   182   ignore_unused_variable_warning(e1,e3,e4,e5);
   180 
   183 
   181   // Check edge deletion
   184   // Check edge deletion
   182   G.erase(e2);
   185   G.erase(e2);
   183 
   186 
   184   checkGraphNodeList(G, 4);
   187   checkGraphNodeList(G, 4);
   215 
   218 
   216   Graph G;
   219   Graph G;
   217   Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode();
   220   Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode();
   218   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
   221   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
   219        e3 = G.addEdge(n2, n3);
   222        e3 = G.addEdge(n2, n3);
       
   223   ignore_unused_variable_warning(e1,e2,e3);
   220 
   224 
   221   checkGraphNodeList(G, 3);
   225   checkGraphNodeList(G, 3);
   222   checkGraphEdgeList(G, 3);
   226   checkGraphEdgeList(G, 3);
   223   checkGraphArcList(G, 6);
   227   checkGraphArcList(G, 6);
   224 
   228 
   379     n3 = g.addNode();
   383     n3 = g.addNode();
   380 
   384 
   381   Edge
   385   Edge
   382     e1 = g.addEdge(n1, n2),
   386     e1 = g.addEdge(n1, n2),
   383     e2 = g.addEdge(n2, n3);
   387     e2 = g.addEdge(n2, n3);
       
   388   ignore_unused_variable_warning(e2);
   384 
   389 
   385   check(g.valid(n1), "Wrong validity check");
   390   check(g.valid(n1), "Wrong validity check");
   386   check(g.valid(e1), "Wrong validity check");
   391   check(g.valid(e1), "Wrong validity check");
   387   check(g.valid(g.direct(e1, true)), "Wrong validity check");
   392   check(g.valid(g.direct(e1, true)), "Wrong validity check");
   388 
   393 
   517   checkGraphNodeList(G, 1 << dim);
   522   checkGraphNodeList(G, 1 << dim);
   518   checkGraphEdgeList(G, dim * (1 << (dim-1)));
   523   checkGraphEdgeList(G, dim * (1 << (dim-1)));
   519   checkGraphArcList(G, dim * (1 << dim));
   524   checkGraphArcList(G, dim * (1 << dim));
   520 
   525 
   521   Node n = G.nodeFromId(dim);
   526   Node n = G.nodeFromId(dim);
       
   527   ignore_unused_variable_warning(n);
   522 
   528 
   523   for (NodeIt n(G); n != INVALID; ++n) {
   529   for (NodeIt n(G); n != INVALID; ++n) {
   524     checkGraphIncEdgeList(G, n, dim);
   530     checkGraphIncEdgeList(G, n, dim);
   525     for (IncEdgeIt e(G, n); e != INVALID; ++e) {
   531     for (IncEdgeIt e(G, n); e != INVALID; ++e) {
   526       check( (G.u(e) == n &&
   532       check( (G.u(e) == n &&