Changeset 567:efaa79ee8d14 in lemon-0.x for src/test
- Timestamp:
- 05/07/04 08:57:50 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@742
- Location:
- src/test
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/test/Makefile.am
r545 r567 1 1 AM_CPPFLAGS = -I$(top_srcdir)/src 2 2 3 check_PROGRAMS = graph_test time_measure3 check_PROGRAMS = graph_test dijkstra_test time_measure_test 4 4 5 5 TESTS = $(check_PROGRAMS) 6 6 XFAIL_TESTS = 7 7 8 graph_test_SOURCES = graph_test.cc 9 time_measure_SOURCES = time_measure.cc 8 graph_test_SOURCES = graph_test.cc test_tools.h 9 dijkstra_test_SOURCES = dijkstra_test.cc test_tools.h 10 time_measure_test_SOURCES = time_measure_test.cc -
src/test/graph_test.cc
r564 r567 2 2 #include<hugo/smart_graph.h> 3 3 #include<hugo/skeletons/graph.h> 4 #include"test_tools.h" 5 4 6 //#include<../work/alpar/list_graph.h> 5 7 … … 12 14 13 15 using 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 28 16 29 17 template<class Graph> void checkCompile(Graph &G) … … 173 161 } 174 162 175 template<class Graph> struct PetNodes176 {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 200 163 template<class Graph> void checkNodeList(Graph &G, int nn) 201 164 { -
src/test/time_measure_test.cc
r566 r567 12 12 int j=0; 13 13 Timer T; 14 for(int i=0;i ++;i<100) j+=2;14 for(int i=0;i<100;i++) j+=2; 15 15 std::cout << T << '\n'; 16 16 T.reset(); 17 for(int i=0;i ++;i<100) j+=2;17 for(int i=0;i<100;i++) j+=2; 18 18 std::cout << T << '\n'; 19 19 20 20 return 0; 21 21 }
Note: See TracChangeset
for help on using the changeset viewer.