Changeset 10:d7ce0311ece2 in lemon-benchmark
- Timestamp:
- 12/11/11 07:33:29 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- tests
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/CMakeLists.txt
r9 r10 9 9 10 10 ADD_EXECUTABLE(circulation 11 circulation.cc 11 circulation.cc main.cc 12 12 ) 13 13 -
tests/circulation.cc
r9 r10 1 #include <benchmark_tools.h> 1 2 #include <lemon/circulation.h> 2 3 #include <lemon/smart_graph.h> 3 4 #include <lemon/lgf_reader.h> 4 5 #include <lemon/dimacs.h> 5 #include <lemon/time_measure.h>6 6 #include <lemon/error.h> 7 7 … … 10 10 using namespace lemon; 11 11 12 int main(int argc, char **argv)12 int testMain(int argc, char **argv) 13 13 { 14 14 if(argc!=2) exit(1); … … 32 32 return 1; 33 33 } 34 std::cerr << "Read the file: " << ti << '\n'; 34 logTime("file-read",ti); 35 36 Timer tf; 35 37 ti.restart(); 36 37 38 Circulation<SmartDigraph, 38 39 SmartDigraph::ArcMap<Value>,SmartDigraph::ArcMap<Value>, 39 40 SmartDigraph::NodeMap<Value> > circ(g,lo_cap,up_cap,sup); 40 std::cerr << "Setup Circulation class: " << ti << '\n';41 logTime("setup",ti); 41 42 ti.restart(); 42 43 bool res = circ.run(); 44 logTime("alg",ti); 45 logTime("full",tf); 43 46 if(res) 44 47 { 45 std::cerr << "A feasible circulation is found: " << ti << "\n"; 48 std::cerr << "A feasible circulation is found\n"; 49 std::cerr << "Checking...\n"; 46 50 ti.restart(); 47 51 bool res2 = circ.checkFlow(); 48 std::cerr << "Checked in time " << ti << "\n";52 logTime("check",ti); 49 53 if(res2) 50 std::cerr << "Success!\n n";54 std::cerr << "Success!\n"; 51 55 else 52 std::cerr << "Oops!!!!\n \n";56 std::cerr << "Oops!!!!\n"; 53 57 } 54 58 else 55 59 { 56 std::cerr << "A dual solution is found: " << ti << "\n"; 60 std::cerr << "A dual solution is found\n"; 61 std::cerr << "Checking...\n"; 57 62 ti.restart(); 58 63 bool res2 = circ.checkBarrier(); 59 std::cerr << "Checked in time " << ti << "\n";64 logTime("check",ti); 60 65 if(res2) 61 std::cerr << "Success!\n n";66 std::cerr << "Success!\n"; 62 67 else 63 std::cerr << "Dual-Oops!!!!\n \n";68 std::cerr << "Dual-Oops!!!!\n"; 64 69 65 70 }
Note: See TracChangeset
for help on using the changeset viewer.