test/graph_adaptor_test.cc
changeset 456 aff6888e71c9
parent 416 76287c8caa26
child 463 a2fd8b8d0b30
equal deleted inserted replaced
2:4242f200ca55 3:7681ddaf6cf2
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2008
     5  * Copyright (C) 2003-2009
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
   101   Digraph::Arc a2 = digraph.addArc(n1, n3);
   101   Digraph::Arc a2 = digraph.addArc(n1, n3);
   102   Digraph::Arc a3 = digraph.addArc(n2, n3);
   102   Digraph::Arc a3 = digraph.addArc(n2, n3);
   103 
   103 
   104   node_filter[n1] = node_filter[n2] = node_filter[n3] = true;
   104   node_filter[n1] = node_filter[n2] = node_filter[n3] = true;
   105   arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = true;
   105   arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = true;
   106   
   106 
   107   checkGraphNodeList(adaptor, 3);
   107   checkGraphNodeList(adaptor, 3);
   108   checkGraphArcList(adaptor, 3);
   108   checkGraphArcList(adaptor, 3);
   109   checkGraphConArcList(adaptor, 3);
   109   checkGraphConArcList(adaptor, 3);
   110 
   110 
   111   checkGraphOutArcList(adaptor, n1, 2);
   111   checkGraphOutArcList(adaptor, n1, 2);
   194   Digraph::Arc a1 = digraph.addArc(n1, n2);
   194   Digraph::Arc a1 = digraph.addArc(n1, n2);
   195   Digraph::Arc a2 = digraph.addArc(n1, n3);
   195   Digraph::Arc a2 = digraph.addArc(n1, n3);
   196   Digraph::Arc a3 = digraph.addArc(n2, n3);
   196   Digraph::Arc a3 = digraph.addArc(n2, n3);
   197 
   197 
   198   node_filter[n1] = node_filter[n2] = node_filter[n3] = true;
   198   node_filter[n1] = node_filter[n2] = node_filter[n3] = true;
   199   
   199 
   200   checkGraphNodeList(adaptor, 3);
   200   checkGraphNodeList(adaptor, 3);
   201   checkGraphArcList(adaptor, 3);
   201   checkGraphArcList(adaptor, 3);
   202   checkGraphConArcList(adaptor, 3);
   202   checkGraphConArcList(adaptor, 3);
   203 
   203 
   204   checkGraphOutArcList(adaptor, n1, 2);
   204   checkGraphOutArcList(adaptor, n1, 2);
   266   Digraph::Arc a1 = digraph.addArc(n1, n2);
   266   Digraph::Arc a1 = digraph.addArc(n1, n2);
   267   Digraph::Arc a2 = digraph.addArc(n1, n3);
   267   Digraph::Arc a2 = digraph.addArc(n1, n3);
   268   Digraph::Arc a3 = digraph.addArc(n2, n3);
   268   Digraph::Arc a3 = digraph.addArc(n2, n3);
   269 
   269 
   270   arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = true;
   270   arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = true;
   271   
   271 
   272   checkGraphNodeList(adaptor, 3);
   272   checkGraphNodeList(adaptor, 3);
   273   checkGraphArcList(adaptor, 3);
   273   checkGraphArcList(adaptor, 3);
   274   checkGraphConArcList(adaptor, 3);
   274   checkGraphConArcList(adaptor, 3);
   275 
   275 
   276   checkGraphOutArcList(adaptor, n1, 2);
   276   checkGraphOutArcList(adaptor, n1, 2);
   575   Graph::Edge e3 = graph.addEdge(n2, n3);
   575   Graph::Edge e3 = graph.addEdge(n2, n3);
   576   Graph::Edge e4 = graph.addEdge(n3, n4);
   576   Graph::Edge e4 = graph.addEdge(n3, n4);
   577 
   577 
   578   node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = true;
   578   node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = true;
   579   edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = true;
   579   edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = true;
   580   
   580 
   581   checkGraphNodeList(adaptor, 4);
   581   checkGraphNodeList(adaptor, 4);
   582   checkGraphArcList(adaptor, 8);
   582   checkGraphArcList(adaptor, 8);
   583   checkGraphEdgeList(adaptor, 4);
   583   checkGraphEdgeList(adaptor, 4);
   584   checkGraphConArcList(adaptor, 8);
   584   checkGraphConArcList(adaptor, 8);
   585   checkGraphConEdgeList(adaptor, 4);
   585   checkGraphConEdgeList(adaptor, 4);
   706   Graph::Edge e2 = graph.addEdge(n1, n3);
   706   Graph::Edge e2 = graph.addEdge(n1, n3);
   707   Graph::Edge e3 = graph.addEdge(n2, n3);
   707   Graph::Edge e3 = graph.addEdge(n2, n3);
   708   Graph::Edge e4 = graph.addEdge(n3, n4);
   708   Graph::Edge e4 = graph.addEdge(n3, n4);
   709 
   709 
   710   node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = true;
   710   node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = true;
   711   
   711 
   712   checkGraphNodeList(adaptor, 4);
   712   checkGraphNodeList(adaptor, 4);
   713   checkGraphArcList(adaptor, 8);
   713   checkGraphArcList(adaptor, 8);
   714   checkGraphEdgeList(adaptor, 4);
   714   checkGraphEdgeList(adaptor, 4);
   715   checkGraphConArcList(adaptor, 8);
   715   checkGraphConArcList(adaptor, 8);
   716   checkGraphConEdgeList(adaptor, 4);
   716   checkGraphConEdgeList(adaptor, 4);
   805   Graph::Edge e2 = graph.addEdge(n1, n3);
   805   Graph::Edge e2 = graph.addEdge(n1, n3);
   806   Graph::Edge e3 = graph.addEdge(n2, n3);
   806   Graph::Edge e3 = graph.addEdge(n2, n3);
   807   Graph::Edge e4 = graph.addEdge(n3, n4);
   807   Graph::Edge e4 = graph.addEdge(n3, n4);
   808 
   808 
   809   edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = true;
   809   edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = true;
   810   
   810 
   811   checkGraphNodeList(adaptor, 4);
   811   checkGraphNodeList(adaptor, 4);
   812   checkGraphArcList(adaptor, 8);
   812   checkGraphArcList(adaptor, 8);
   813   checkGraphEdgeList(adaptor, 4);
   813   checkGraphEdgeList(adaptor, 4);
   814   checkGraphConArcList(adaptor, 8);
   814   checkGraphConArcList(adaptor, 8);
   815   checkGraphConEdgeList(adaptor, 4);
   815   checkGraphConEdgeList(adaptor, 4);