COIN-OR::LEMON - Graph Library

Changeset 1158:8d2e55fac752 in lemon for test


Ignore:
Timestamp:
09/13/12 11:52:50 (7 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
1.1
Parents:
1156:939d747055cd (diff), 1157: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 branch 1.1

Location:
test
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • test/adaptors_test.cc

    r1156 r1158  
    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

    r1157 r1158  
    13811381
    13821382  // Apply several adaptors on the grid graph
    1383   typedef SplitNodes< ReverseDigraph< const Orienter<
    1384             const GridGraph, GridGraph::EdgeMap<bool> > > >
    1385     RevSplitGridGraph;
     1383  typedef Orienter<const GridGraph, GridGraph::EdgeMap<bool> >
     1384    OrientedGridGraph;
     1385  typedef ReverseDigraph<const OrientedGridGraph> RevOrientedGridGraph;
     1386  typedef SplitNodes<RevOrientedGridGraph> RevSplitGridGraph;
    13861387  typedef ReverseDigraph<const RevSplitGridGraph> SplitGridGraph;
    13871388  typedef Undirector<const SplitGridGraph> USplitGridGraph;
     
    13921393  checkConcept<concepts::Graph, UUSplitGridGraph>();
    13931394
     1395  OrientedGridGraph ori_adaptor = orienter(graph, dir_map);
     1396  RevOrientedGridGraph rev_ori_adaptor = reverseDigraph(ori_adaptor);
    13941397  RevSplitGridGraph rev_adaptor =
    1395     splitNodes(reverseDigraph(orienter(graph, dir_map)));
     1398    splitNodes(rev_ori_adaptor);
    13961399  SplitGridGraph adaptor = reverseDigraph(rev_adaptor);
    13971400  USplitGridGraph uadaptor = undirector(adaptor);
  • test/connectivity_test.cc

    r1081 r1158  
    6969    Graph g(d);
    7070    Digraph::Node n = d.addNode();
     71    ignore_unused_variable_warning(n);
    7172
    7273    check(stronglyConnected(d), "This digraph is strongly connected");
     
    246247    Digraph::Node watch = d.addNode();
    247248    Digraph::Node pants = d.addNode();
     249    ignore_unused_variable_warning(watch);
    248250
    249251    d.addArc(socks, shoe);
  • test/connectivity_test.cc

    r1157 r1158  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    3030  typedef ListDigraph Digraph;
    3131  typedef Undirector<Digraph> Graph;
    32  
    33   {
    34     Digraph d;
    35     Digraph::NodeMap<int> order(d);
    36     Graph g(d);
    37    
     32
     33  {
     34    Digraph d;
     35    Digraph::NodeMap<int> order(d);
     36    Graph g(d);
     37
    3838    check(stronglyConnected(d), "The empty digraph is strongly connected");
    3939    check(countStronglyConnectedComponents(d) == 0,
     
    4949    check(countBiEdgeConnectedComponents(g) == 0,
    5050          "The empty graph has 0 bi-edge-connected component");
    51          
     51
    5252    check(dag(d), "The empty digraph is DAG.");
    5353    check(checkedTopologicalSort(d, order), "The empty digraph is DAG.");
     
    8484    check(countBiEdgeConnectedComponents(g) == 1,
    8585          "This graph has 1 bi-edge-connected component");
    86          
     86
    8787    check(dag(d), "This digraph is DAG.");
    8888    check(checkedTopologicalSort(d, order), "This digraph is DAG.");
     
    103103    Digraph::NodeMap<int> order(d);
    104104    Graph g(d);
    105    
     105
    106106    Digraph::Node n1 = d.addNode();
    107107    Digraph::Node n2 = d.addNode();
     
    110110    Digraph::Node n5 = d.addNode();
    111111    Digraph::Node n6 = d.addNode();
    112    
     112
    113113    d.addArc(n1, n3);
    114114    d.addArc(n3, n2);
     
    138138    check(!parallelFree(g), "This graph is not parallel-free.");
    139139    check(!simpleGraph(g), "This graph is not simple.");
    140    
     140
    141141    d.addArc(n3, n3);
    142    
     142
    143143    check(!loopFree(d), "This digraph is not loop-free.");
    144144    check(!loopFree(g), "This graph is not loop-free.");
    145145    check(!simpleGraph(d), "This digraph is not simple.");
    146    
     146
    147147    d.addArc(n3, n2);
    148    
     148
    149149    check(!parallelFree(d), "This digraph is not parallel-free.");
    150150  }
    151  
     151
    152152  {
    153153    Digraph d;
    154154    Digraph::ArcMap<bool> cutarcs(d, false);
    155155    Graph g(d);
    156    
     156
    157157    Digraph::Node n1 = d.addNode();
    158158    Digraph::Node n2 = d.addNode();
     
    174174    d.addArc(n6, n7);
    175175    d.addArc(n7, n6);
    176    
     176
    177177    check(!stronglyConnected(d), "This digraph is not strongly connected");
    178178    check(countStronglyConnectedComponents(d) == 3,
     
    237237    Digraph d;
    238238    Digraph::NodeMap<int> order(d);
    239    
     239
    240240    Digraph::Node belt = d.addNode();
    241241    Digraph::Node trousers = d.addNode();
     
    258258    d.addArc(shirt, necktie);
    259259    d.addArc(necktie, coat);
    260    
     260
    261261    check(dag(d), "This digraph is DAG.");
    262262    topologicalSort(d, order);
     
    270270    ListGraph g;
    271271    ListGraph::NodeMap<bool> map(g);
    272    
     272
    273273    ListGraph::Node n1 = g.addNode();
    274274    ListGraph::Node n2 = g.addNode();
     
    286286    g.addEdge(n4, n7);
    287287    g.addEdge(n5, n7);
    288    
     288
    289289    check(bipartite(g), "This graph is bipartite");
    290290    check(bipartitePartitions(g, map), "This graph is bipartite");
    291    
     291
    292292    check(map[n1] == map[n2] && map[n1] == map[n6] && map[n1] == map[n7],
    293293          "Wrong bipartitePartitions()");
  • test/edge_set_test.cc

    r1081 r1158  
    4545
    4646  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     47  ignore_unused_variable_warning(ga1);
    4748
    4849  ArcSet arc_set(digraph);
    4950
    5051  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     52  ignore_unused_variable_warning(ga2);
    5153
    5254  checkGraphNodeList(arc_set, 2);
     
    7678    a3 = arc_set.addArc(n2, n3),
    7779    a4 = arc_set.addArc(n2, n3);
     80  ignore_unused_variable_warning(a2,a3,a4);
     81
    7882  checkGraphNodeList(arc_set, 3);
    7983  checkGraphArcList(arc_set, 4);
     
    111115
    112116  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     117  ignore_unused_variable_warning(ga1);
    113118
    114119  ArcSet arc_set(digraph);
    115120
    116121  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     122  ignore_unused_variable_warning(ga2);
    117123
    118124  checkGraphNodeList(arc_set, 2);
     
    142148    a3 = arc_set.addArc(n2, n3),
    143149    a4 = arc_set.addArc(n2, n3);
     150  ignore_unused_variable_warning(a2,a3,a4);
     151
    144152  checkGraphNodeList(arc_set, 3);
    145153  checkGraphArcList(arc_set, 4);
     
    191199
    192200  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     201  ignore_unused_variable_warning(ga1);
    193202
    194203  EdgeSet edge_set(digraph);
    195204
    196205  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     206  ignore_unused_variable_warning(ga2);
    197207
    198208  checkGraphNodeList(edge_set, 2);
     
    231241    e3 = edge_set.addEdge(n2, n3),
    232242    e4 = edge_set.addEdge(n2, n3);
     243  ignore_unused_variable_warning(e2,e3,e4);
     244
    233245  checkGraphNodeList(edge_set, 3);
    234246  checkGraphEdgeList(edge_set, 4);
     
    275287
    276288  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     289  ignore_unused_variable_warning(ga1);
    277290
    278291  EdgeSet edge_set(digraph);
    279292
    280293  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     294  ignore_unused_variable_warning(ga2);
    281295
    282296  checkGraphNodeList(edge_set, 2);
     
    315329    e3 = edge_set.addEdge(n2, n3),
    316330    e4 = edge_set.addEdge(n2, n3);
     331  ignore_unused_variable_warning(e2,e3,e4);
     332
    317333  checkGraphNodeList(edge_set, 3);
    318334  checkGraphEdgeList(edge_set, 4);
  • test/edge_set_test.cc

    r1157 r1158  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/euler_test.cc

    r1081 r1158  
    102102    Graph g(d);
    103103    Digraph::Node n = d.addNode();
    104 
     104    ignore_unused_variable_warning(n);
     105 
    105106    checkDiEulerIt(d);
    106107    checkDiEulerIt(g);
     
    190191    Digraph::Node n4 = d.addNode();
    191192    Digraph::Node n5 = d.addNode();
     193    ignore_unused_variable_warning(n0,n4,n5);
    192194
    193195    d.addArc(n1, n2);
  • test/euler_test.cc

    r1157 r1158  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    8686  typedef ListDigraph Digraph;
    8787  typedef Undirector<Digraph> Graph;
    88  
    89   {
    90     Digraph d;
    91     Graph g(d);
    92    
     88
     89  {
     90    Digraph d;
     91    Graph g(d);
     92
    9393    checkDiEulerIt(d);
    9494    checkDiEulerIt(g);
     
    130130    Digraph::Node n2 = d.addNode();
    131131    Digraph::Node n3 = d.addNode();
    132    
     132
    133133    d.addArc(n1, n2);
    134134    d.addArc(n2, n1);
     
    155155    Digraph::Node n5 = d.addNode();
    156156    Digraph::Node n6 = d.addNode();
    157    
     157
    158158    d.addArc(n1, n2);
    159159    d.addArc(n2, n4);
     
    214214    Digraph::Node n2 = d.addNode();
    215215    Digraph::Node n3 = d.addNode();
    216    
     216
    217217    d.addArc(n1, n2);
    218218    d.addArc(n2, n3);
  • test/maps_test.cc

    r1081 r1158  
    8181    NullMap<A,B> map1;
    8282    NullMap<A,B> map2 = map1;
     83    ignore_unused_variable_warning(map2);
    8384    map1 = nullMap<A,B>();
    8485  }
     
    9192    ConstMap<A,B> map2 = B();
    9293    ConstMap<A,B> map3 = map1;
     94    ignore_unused_variable_warning(map2,map3);
     95
    9396    map1 = constMap<A>(B());
    9497    map1 = constMap<A,B>();
     
    9699    ConstMap<A,C> map4(C(1));
    97100    ConstMap<A,C> map5 = map4;
     101    ignore_unused_variable_warning(map5);
     102
    98103    map4 = constMap<A>(C(2));
    99104    map4.setAll(C(3));
     
    116121    IdentityMap<A> map1;
    117122    IdentityMap<A> map2 = map1;
     123    ignore_unused_variable_warning(map2);
     124
    118125    map1 = identityMap<A>();
    119126
     
    175182    checkConcept<ReadMap<B,double>, CompMap>();
    176183    CompMap map1 = CompMap(DoubleMap(),ReadMap<B,A>());
     184    ignore_unused_variable_warning(map1);
    177185    CompMap map2 = composeMap(DoubleMap(), ReadMap<B,A>());
     186    ignore_unused_variable_warning(map2);
    178187
    179188    SparseMap<double, bool> m1(false); m1[3.14] = true;
     
    188197    checkConcept<ReadMap<A,double>, CombMap>();
    189198    CombMap map1 = CombMap(DoubleMap(), DoubleMap());
     199    ignore_unused_variable_warning(map1);
    190200    CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus<double>());
     201    ignore_unused_variable_warning(map2);
    191202
    192203    check(combineMap(constMap<B,int,2>(), identityMap<B>(), &binc)[B()] == 3,
     
    200211    FunctorToMap<F> map1;
    201212    FunctorToMap<F> map2 = FunctorToMap<F>(F());
     213    ignore_unused_variable_warning(map2);
     214
    202215    B b = functorToMap(F())[A()];
     216    ignore_unused_variable_warning(b);
    203217
    204218    checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >();
    205219    MapToFunctor<ReadMap<A,B> > map =
    206220      MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
     221    ignore_unused_variable_warning(map);
    207222
    208223    check(functorToMap(&func)[A()] == 3,
     
    222237      ConvertMap<ReadMap<double, int>, double> >();
    223238    ConvertMap<RangeMap<bool>, int> map1(rangeMap(1, true));
     239    ignore_unused_variable_warning(map1);
    224240    ConvertMap<RangeMap<bool>, int> map2 = convertMap<int>(rangeMap(2, false));
     241    ignore_unused_variable_warning(map2);
     242
    225243  }
    226244
  • test/maps_test.cc

    r1157 r1158  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    7171  checkConcept<ReadWriteMap<A,B>, ReadWriteMap<A,B> >();
    7272  checkConcept<ReadWriteMap<A,C>, ReadWriteMap<A,C> >();
    73   checkConcept<ReferenceMap<A,B,B&,const B&>, ReferenceMap<A,B,B&,const B&> >();
    74   checkConcept<ReferenceMap<A,C,C&,const C&>, ReferenceMap<A,C,C&,const C&> >();
     73  checkConcept<ReferenceMap<A,B,B&,const B&>,
     74               ReferenceMap<A,B,B&,const B&> >();
     75  checkConcept<ReferenceMap<A,C,C&,const C&>,
     76               ReferenceMap<A,C,C&,const C&> >();
    7577
    7678  // NullMap
     
    369371      check(v1[i++] == *it, "Something is wrong with LoggerBoolMap");
    370372  }
    371  
     373
    372374  // CrossRefMap
    373375  {
     
    377379    checkConcept<ReadWriteMap<Node, int>,
    378380                 CrossRefMap<Graph, Node, int> >();
    379    
     381
    380382    Graph gr;
    381383    typedef CrossRefMap<Graph, Node, char> CRMap;
    382384    typedef CRMap::ValueIterator ValueIt;
    383385    CRMap map(gr);
    384    
     386
    385387    Node n0 = gr.addNode();
    386388    Node n1 = gr.addNode();
    387389    Node n2 = gr.addNode();
    388    
     390
    389391    map.set(n0, 'A');
    390392    map.set(n1, 'B');
Note: See TracChangeset for help on using the changeset viewer.