COIN-OR::LEMON - Graph Library

Changeset 737:9d6c3e8b2421 in lemon-1.2 for test/graph_test.cc


Ignore:
Timestamp:
08/23/09 11:11:49 (10 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Add a resize() function to HypercubeGraph? (#311)
just like the similar functions in other static graph structures,
and extend the test files to check these functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/graph_test.cc

    r736 r737  
    271271
    272272  Graph G(num);
     273  check(G.nodeNum() == num && G.edgeNum() == num * (num - 1) / 2,
     274        "Wrong size");
     275
     276  G.resize(num);
     277  check(G.nodeNum() == num && G.edgeNum() == num * (num - 1) / 2,
     278        "Wrong size");
     279
    273280  checkGraphNodeList(G, num);
    274281  checkGraphEdgeList(G, num * (num - 1) / 2);
     
    415422  check(G.height() == height, "Wrong row number");
    416423
     424  G.resize(width, height);
     425  check(G.width() == width, "Wrong column number");
     426  check(G.height() == height, "Wrong row number");
     427
    417428  for (int i = 0; i < width; ++i) {
    418429    for (int j = 0; j < height; ++j) {
     
    490501
    491502  HypercubeGraph G(dim);
     503  check(G.dimension() == dim, "Wrong dimension");
     504
     505  G.resize(dim);
     506  check(G.dimension() == dim, "Wrong dimension");
     507 
    492508  checkGraphNodeList(G, 1 << dim);
    493509  checkGraphEdgeList(G, dim * (1 << (dim-1)));
Note: See TracChangeset for help on using the changeset viewer.