COIN-OR::LEMON - Graph Library

Changeset 983:8b2d4e5d96e4 in lemon-1.2 for test/graph_test.cc


Ignore:
Timestamp:
08/07/13 06:55:05 (6 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Parents:
971:a26b90a17c81 (diff), 982:3e711ee55d31 (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 #294 to branches >=1.2

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/graph_test.cc

    r964 r983  
    6767  Edge e2 = G.addEdge(n2, n1),
    6868       e3 = G.addEdge(n2, n3);
    69   ignore_unused_variable_warning(e2,e3);
     69  ::lemon::ignore_unused_variable_warning(e2,e3);
    7070
    7171  checkGraphNodeList(G, 3);
     
    100100       e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
    101101       e5 = G.addEdge(n4, n3);
    102   ignore_unused_variable_warning(e1,e3,e4,e5);
     102  ::lemon::ignore_unused_variable_warning(e1,e3,e4,e5);
    103103
    104104  checkGraphNodeList(G, 4);
     
    180180       e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
    181181       e5 = G.addEdge(n4, n3);
    182   ignore_unused_variable_warning(e1,e3,e4,e5);
     182  ::lemon::ignore_unused_variable_warning(e1,e3,e4,e5);
    183183
    184184  // Check edge deletion
     
    221221  Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
    222222       e3 = G.addEdge(n2, n3);
    223   ignore_unused_variable_warning(e1,e2,e3);
     223  ::lemon::ignore_unused_variable_warning(e1,e2,e3);
    224224
    225225  checkGraphNodeList(G, 3);
     
    386386    e1 = g.addEdge(n1, n2),
    387387    e2 = g.addEdge(n2, n3);
    388   ignore_unused_variable_warning(e2);
     388  ::lemon::ignore_unused_variable_warning(e2);
    389389
    390390  check(g.valid(n1), "Wrong validity check");
     
    525525
    526526  Node n = G.nodeFromId(dim);
    527   ignore_unused_variable_warning(n);
     527  ::lemon::ignore_unused_variable_warning(n);
    528528
    529529  for (NodeIt n(G); n != INVALID; ++n) {
  • test/graph_test.cc

    r982 r983  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2010
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    3939  checkGraphArcList(G, 0);
    4040
     41  G.reserveNode(3);
     42  G.reserveEdge(3);
     43
    4144  Node
    4245    n1 = G.addNode(),
     
    261264
    262265  snapshot.restore();
     266  snapshot.save(G);
    263267
    264268  checkGraphNodeList(G, 4);
    265269  checkGraphEdgeList(G, 3);
    266270  checkGraphArcList(G, 6);
     271
     272  G.addEdge(G.addNode(), G.addNode());
     273
     274  snapshot.restore();
     275
     276  checkGraphNodeList(G, 4);
     277  checkGraphEdgeList(G, 3);
     278  checkGraphArcList(G, 6);
    267279}
    268280
     
    272284
    273285  Graph G(num);
     286  check(G.nodeNum() == num && G.edgeNum() == num * (num - 1) / 2,
     287        "Wrong size");
     288
     289  G.resize(num);
     290  check(G.nodeNum() == num && G.edgeNum() == num * (num - 1) / 2,
     291        "Wrong size");
     292
    274293  checkGraphNodeList(G, num);
    275294  checkGraphEdgeList(G, num * (num - 1) / 2);
     
    417436  check(G.height() == height, "Wrong row number");
    418437
     438  G.resize(width, height);
     439  check(G.width() == width, "Wrong column number");
     440  check(G.height() == height, "Wrong row number");
     441
    419442  for (int i = 0; i < width; ++i) {
    420443    for (int j = 0; j < height; ++j) {
     
    492515
    493516  HypercubeGraph G(dim);
     517  check(G.dimension() == dim, "Wrong dimension");
     518
     519  G.resize(dim);
     520  check(G.dimension() == dim, "Wrong dimension");
     521
    494522  checkGraphNodeList(G, 1 << dim);
    495523  checkGraphEdgeList(G, dim * (1 << (dim-1)));
Note: See TracChangeset for help on using the changeset viewer.