COIN-OR::LEMON - Graph Library

Changeset 567:efaa79ee8d14 in lemon-0.x


Ignore:
Timestamp:
05/07/04 08:57:50 (16 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

Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • doc/Doxyfile

    r561 r567  
    400400                         ../src/work/athos/minlengthpaths.h \
    401401                         ../src/work/klao/path.h \
    402                          ../src/work/jacint/max_flow.h
     402                         ../src/work/jacint/max_flow.h \
     403                         ../src/test/test_tools.h
    403404
    404405# If the value of the INPUT tag contains directories, you can use the
  • src/test/Makefile.am

    r545 r567  
    11AM_CPPFLAGS = -I$(top_srcdir)/src
    22
    3 check_PROGRAMS = graph_test time_measure
     3check_PROGRAMS = graph_test dijkstra_test time_measure_test
    44
    55TESTS = $(check_PROGRAMS)
    66XFAIL_TESTS =
    77
    8 graph_test_SOURCES = graph_test.cc
    9 time_measure_SOURCES = time_measure.cc
     8graph_test_SOURCES = graph_test.cc test_tools.h
     9dijkstra_test_SOURCES = dijkstra_test.cc test_tools.h
     10time_measure_test_SOURCES = time_measure_test.cc
  • 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{
  • src/test/time_measure_test.cc

    r566 r567  
    1212  int j=0;
    1313  Timer T;
    14   for(int i=0;i++;i<100) j+=2;
     14  for(int i=0;i<100;i++) j+=2;
    1515  std::cout << T << '\n';
    1616  T.reset();
    17   for(int i=0;i++;i<100) j+=2;
     17  for(int i=0;i<100;i++) j+=2;
    1818  std::cout << T << '\n';
    19 
     19 
    2020  return 0;
    2121}
Note: See TracChangeset for help on using the changeset viewer.