COIN-OR::LEMON - Graph Library

Changeset 964:7fdaa05a69a1 in lemon-1.2 for test/adaptors_test.cc


Ignore:
Timestamp:
09/13/12 11:56:19 (7 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Parents:
961:4bb9e72e1a41 (diff), 963:761fe0846f49 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge #449 to branches >=1.2

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/adaptors_test.cc

    r961 r964  
    6666  Digraph::Arc a2 = digraph.addArc(n1, n3);
    6767  Digraph::Arc a3 = digraph.addArc(n2, n3);
     68  ignore_unused_variable_warning(a3);
    6869
    6970  // Check the adaptor
     
    100101  Adaptor::Arc a7 = adaptor.addArc(n1, n4);
    101102  Adaptor::Arc a8 = adaptor.addArc(n1, n2);
     103  ignore_unused_variable_warning(a6,a7,a8);
    102104
    103105  adaptor.erase(a1);
     
    759761  Digraph::Arc a2 = digraph.addArc(n1, n3);
    760762  Digraph::Arc a3 = digraph.addArc(n2, n3);
     763  ignore_unused_variable_warning(a1,a2,a3);
    761764
    762765  checkGraphNodeList(adaptor, 6);
  • test/adaptors_test.cc

    r963 r964  
    13751375
    13761376  GridGraph::EdgeMap<bool> dir_map(graph);
    1377   dir_map[graph.right(n1)] = graph.u(graph.right(n1)) == n1;
    1378   dir_map[graph.up(n1)] = graph.u(graph.up(n1)) != n1;
    1379   dir_map[graph.left(n4)] = graph.u(graph.left(n4)) != n4;
    1380   dir_map[graph.down(n4)] = graph.u(graph.down(n4)) != n4;
     1377  dir_map[graph.right(n1)] = graph.u(graph.right(n1)) != n1;
     1378  dir_map[graph.up(n1)] = graph.u(graph.up(n1)) == n1;
     1379  dir_map[graph.left(n4)] = graph.u(graph.left(n4)) == n4;
     1380  dir_map[graph.down(n4)] = graph.u(graph.down(n4)) == n4;
    13811381
    13821382  // Apply several adaptors on the grid graph
    1383   typedef SplitNodes< ReverseDigraph< const Orienter<
    1384             const GridGraph, GridGraph::EdgeMap<bool> > > >
    1385     RevSplitGridGraph;
    1386   typedef ReverseDigraph<const RevSplitGridGraph> SplitGridGraph;
     1383  typedef Orienter< const GridGraph, GridGraph::EdgeMap<bool> >
     1384    OrientedGridGraph;
     1385  typedef SplitNodes<OrientedGridGraph> SplitGridGraph;
    13871386  typedef Undirector<const SplitGridGraph> USplitGridGraph;
    1388   typedef Undirector<const USplitGridGraph> UUSplitGridGraph;
    1389   checkConcept<concepts::Digraph, RevSplitGridGraph>();
    13901387  checkConcept<concepts::Digraph, SplitGridGraph>();
    13911388  checkConcept<concepts::Graph, USplitGridGraph>();
    1392   checkConcept<concepts::Graph, UUSplitGridGraph>();
    1393 
    1394   RevSplitGridGraph rev_adaptor =
    1395     splitNodes(reverseDigraph(orienter(graph, dir_map)));
    1396   SplitGridGraph adaptor = reverseDigraph(rev_adaptor);
     1389
     1390  OrientedGridGraph oadaptor = orienter(graph, dir_map);
     1391  SplitGridGraph adaptor = splitNodes(oadaptor);
    13971392  USplitGridGraph uadaptor = undirector(adaptor);
    1398   UUSplitGridGraph uuadaptor = undirector(uadaptor);
    13991393
    14001394  // Check adaptor
     
    14031397  checkGraphConArcList(adaptor, 8);
    14041398
    1405   checkGraphOutArcList(adaptor, rev_adaptor.inNode(n1), 1);
    1406   checkGraphOutArcList(adaptor, rev_adaptor.outNode(n1), 1);
    1407   checkGraphOutArcList(adaptor, rev_adaptor.inNode(n2), 2);
    1408   checkGraphOutArcList(adaptor, rev_adaptor.outNode(n2), 1);
    1409   checkGraphOutArcList(adaptor, rev_adaptor.inNode(n3), 1);
    1410   checkGraphOutArcList(adaptor, rev_adaptor.outNode(n3), 1);
    1411   checkGraphOutArcList(adaptor, rev_adaptor.inNode(n4), 0);
    1412   checkGraphOutArcList(adaptor, rev_adaptor.outNode(n4), 1);
    1413 
    1414   checkGraphInArcList(adaptor, rev_adaptor.inNode(n1), 1);
    1415   checkGraphInArcList(adaptor, rev_adaptor.outNode(n1), 1);
    1416   checkGraphInArcList(adaptor, rev_adaptor.inNode(n2), 1);
    1417   checkGraphInArcList(adaptor, rev_adaptor.outNode(n2), 0);
    1418   checkGraphInArcList(adaptor, rev_adaptor.inNode(n3), 1);
    1419   checkGraphInArcList(adaptor, rev_adaptor.outNode(n3), 1);
    1420   checkGraphInArcList(adaptor, rev_adaptor.inNode(n4), 1);
    1421   checkGraphInArcList(adaptor, rev_adaptor.outNode(n4), 2);
     1399  checkGraphOutArcList(adaptor, adaptor.inNode(n1), 1);
     1400  checkGraphOutArcList(adaptor, adaptor.outNode(n1), 1);
     1401  checkGraphOutArcList(adaptor, adaptor.inNode(n2), 1);
     1402  checkGraphOutArcList(adaptor, adaptor.outNode(n2), 0);
     1403  checkGraphOutArcList(adaptor, adaptor.inNode(n3), 1);
     1404  checkGraphOutArcList(adaptor, adaptor.outNode(n3), 1);
     1405  checkGraphOutArcList(adaptor, adaptor.inNode(n4), 1);
     1406  checkGraphOutArcList(adaptor, adaptor.outNode(n4), 2);
     1407
     1408  checkGraphInArcList(adaptor, adaptor.inNode(n1), 1);
     1409  checkGraphInArcList(adaptor, adaptor.outNode(n1), 1);
     1410  checkGraphInArcList(adaptor, adaptor.inNode(n2), 2);
     1411  checkGraphInArcList(adaptor, adaptor.outNode(n2), 1);
     1412  checkGraphInArcList(adaptor, adaptor.inNode(n3), 1);
     1413  checkGraphInArcList(adaptor, adaptor.outNode(n3), 1);
     1414  checkGraphInArcList(adaptor, adaptor.inNode(n4), 0);
     1415  checkGraphInArcList(adaptor, adaptor.outNode(n4), 1);
    14221416
    14231417  checkNodeIds(adaptor);
     
    14421436  checkGraphArcMap(uadaptor);
    14431437
    1444   checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.inNode(n1), 2);
    1445   checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.outNode(n1), 2);
    1446   checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.inNode(n2), 3);
    1447   checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.outNode(n2), 1);
    1448   checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.inNode(n3), 2);
    1449   checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.outNode(n3), 2);
    1450   checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.inNode(n4), 1);
    1451   checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.outNode(n4), 3);
    1452 
    1453   // Check uuadaptor
    1454   checkGraphNodeList(uuadaptor, 8);
    1455   checkGraphEdgeList(uuadaptor, 16);
    1456   checkGraphArcList(uuadaptor, 32);
    1457   checkGraphConEdgeList(uuadaptor, 16);
    1458   checkGraphConArcList(uuadaptor, 32);
    1459 
    1460   checkNodeIds(uuadaptor);
    1461   checkEdgeIds(uuadaptor);
    1462   checkArcIds(uuadaptor);
    1463 
    1464   checkGraphNodeMap(uuadaptor);
    1465   checkGraphEdgeMap(uuadaptor);
    1466   checkGraphArcMap(uuadaptor);
     1438  checkGraphIncEdgeArcLists(uadaptor, adaptor.inNode(n1), 2);
     1439  checkGraphIncEdgeArcLists(uadaptor, adaptor.outNode(n1), 2);
     1440  checkGraphIncEdgeArcLists(uadaptor, adaptor.inNode(n2), 3);
     1441  checkGraphIncEdgeArcLists(uadaptor, adaptor.outNode(n2), 1);
     1442  checkGraphIncEdgeArcLists(uadaptor, adaptor.inNode(n3), 2);
     1443  checkGraphIncEdgeArcLists(uadaptor, adaptor.outNode(n3), 2);
     1444  checkGraphIncEdgeArcLists(uadaptor, adaptor.inNode(n4), 1);
     1445  checkGraphIncEdgeArcLists(uadaptor, adaptor.outNode(n4), 3);
    14671446}
    14681447
Note: See TracChangeset for help on using the changeset viewer.