test/graph_test.cc
changeset 911 481496e6d71f
parent 740 819ca5b50de0
child 998 7fdaa05a69a1
equal deleted inserted replaced
19:a3d6c24fdc0e 20:d7cd00e42ec9
     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-2009
     5  * Copyright (C) 2003-2010
     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
   262   snapshot.save(G);
   262   snapshot.save(G);
   263 
   263 
   264   checkGraphNodeList(G, 4);
   264   checkGraphNodeList(G, 4);
   265   checkGraphEdgeList(G, 3);
   265   checkGraphEdgeList(G, 3);
   266   checkGraphArcList(G, 6);
   266   checkGraphArcList(G, 6);
   267   
   267 
   268   G.addEdge(G.addNode(), G.addNode());
   268   G.addEdge(G.addNode(), G.addNode());
   269 
   269 
   270   snapshot.restore();
   270   snapshot.restore();
   271 
   271 
   272   checkGraphNodeList(G, 4);
   272   checkGraphNodeList(G, 4);
   511   HypercubeGraph G(dim);
   511   HypercubeGraph G(dim);
   512   check(G.dimension() == dim, "Wrong dimension");
   512   check(G.dimension() == dim, "Wrong dimension");
   513 
   513 
   514   G.resize(dim);
   514   G.resize(dim);
   515   check(G.dimension() == dim, "Wrong dimension");
   515   check(G.dimension() == dim, "Wrong dimension");
   516   
   516 
   517   checkGraphNodeList(G, 1 << dim);
   517   checkGraphNodeList(G, 1 << dim);
   518   checkGraphEdgeList(G, dim * (1 << (dim-1)));
   518   checkGraphEdgeList(G, dim * (1 << (dim-1)));
   519   checkGraphArcList(G, dim * (1 << dim));
   519   checkGraphArcList(G, dim * (1 << dim));
   520 
   520 
   521   Node n = G.nodeFromId(dim);
   521   Node n = G.nodeFromId(dim);