COIN-OR::LEMON - Graph Library

Changeset 567:efaa79ee8d14 in lemon-0.x for src/test/graph_test.cc


Ignore:
Timestamp:
05/07/04 08:57:50 (21 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@742
Message:

time_measure.cc was renamed to time_measure_test.cc
Add an alternative dijsktra_test.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/test/graph_test.cc

    r564 r567  
    22#include<hugo/smart_graph.h>
    33#include<hugo/skeletons/graph.h>
     4#include"test_tools.h"
     5
    46//#include<../work/alpar/list_graph.h>
    57
     
    1214
    1315using namespace hugo;
    14 
    15 // void check(bool rc, const char *msg) {
    16 //   if(!rc) {
    17 //     std::cerr << msg << std::endl;
    18 //     exit(1);
    19 //   }
    20 // }
    21 
    22 #define check(rc, msg) \
    23   if(!rc) { \
    24     std::cerr << __FILE__ ":" << __LINE__ << ": error: " << msg << std::endl; \
    25     exit(1); \
    26   } else { } \
    27 
    2816
    2917template<class Graph> void checkCompile(Graph &G)
     
    173161}
    174162
    175 template<class Graph> struct PetNodes
    176 {
    177   std::vector<typename Graph::Node> outer, inner;
    178   std::vector<typename Graph::Edge> outcir, incir, cons;
    179 };
    180 
    181 template<class Graph> PetNodes<Graph> addPetersen(Graph &G,int num=5)
    182 {
    183   //std::vector<typename Graph::Node> outer, inner;
    184  
    185   PetNodes<Graph> n;
    186 
    187   for(int i=0;i<num;i++) {
    188     n.outer.push_back(G.addNode());
    189     n.inner.push_back(G.addNode());
    190   }
    191 
    192  for(int i=0;i<num;i++) {
    193    n.cons.push_back(G.addEdge(n.outer[i],n.inner[i]));
    194    n.outcir.push_back(G.addEdge(n.outer[i],n.outer[(i+1)%5]));
    195    n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%5]));
    196   }
    197  return n;
    198 }
    199 
    200163template<class Graph> void checkNodeList(Graph &G, int nn)
    201164{
Note: See TracChangeset for help on using the changeset viewer.