[Lemon-commits] [lemon_svn] athos: r793 - in hugo/trunk/src: hugo test work/athos
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:41:31 CET 2006
Author: athos
Date: Tue May 11 18:38:17 2004
New Revision: 793
Added:
hugo/trunk/src/test/mincostflows_test.cc
- copied, changed from r783, /hugo/trunk/src/work/athos/mincostflows_test.cc
Removed:
hugo/trunk/src/work/athos/mincostflows_test.cc
Modified:
hugo/trunk/src/hugo/mincostflows.h
hugo/trunk/src/hugo/minlengthpaths.h
hugo/trunk/src/test/minlengthpaths_test.cc
Log:
Some modifications and another testfile.
Modified: hugo/trunk/src/hugo/mincostflows.h
==============================================================================
--- hugo/trunk/src/hugo/mincostflows.h (original)
+++ hugo/trunk/src/hugo/mincostflows.h Tue May 11 18:38:17 2004
@@ -6,7 +6,7 @@
///\file
///\brief An algorithm for finding a flow of value \c k (for small values of \c k) having minimal total cost
-#include <iostream>
+
#include <hugo/dijkstra.h>
#include <hugo/graph_wrapper.h>
#include <hugo/maps.h>
Modified: hugo/trunk/src/hugo/minlengthpaths.h
==============================================================================
--- hugo/trunk/src/hugo/minlengthpaths.h (original)
+++ hugo/trunk/src/hugo/minlengthpaths.h Tue May 11 18:38:17 2004
@@ -6,7 +6,7 @@
///\file
///\brief An algorithm for finding k paths of minimal total length.
-#include <iostream>
+
//#include <hugo/dijkstra.h>
//#include <hugo/graph_wrapper.h>
#include <hugo/maps.h>
Copied: hugo/trunk/src/test/mincostflows_test.cc (from r783, /hugo/trunk/src/work/athos/mincostflows_test.cc)
==============================================================================
--- /hugo/trunk/src/work/athos/mincostflows_test.cc (original)
+++ hugo/trunk/src/test/mincostflows_test.cc Tue May 11 18:38:17 2004
@@ -1,6 +1,7 @@
#include <iostream>
-#include <list_graph.h>
-#include <mincostflows.h>
+#include "test_tools.h"
+#include <hugo/list_graph.h>
+#include <hugo/mincostflows.h>
//#include <path.h>
//#include <maps.h>
@@ -10,7 +11,7 @@
bool passed = true;
-
+/*
void check(bool rc, char *msg="") {
passed = passed && rc;
if(!rc) {
@@ -19,7 +20,7 @@
}
}
-
+*/
int main()
@@ -71,30 +72,14 @@
check( surb_test.run(s,t,k) == 2 && surb_test.totalLength() == 46,"Two paths, total length should be 46");
- check(surb_test.checkSolution(), "Is the primal-dual solution pair really optimal?");
+ check(surb_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?");
k=1;
check( surb_test.run(s,t,k) == 1 && surb_test.totalLength() == 19,"One path, total length should be 19");
- check(surb_test.checkSolution(), "Is the primal-dual solution pair really optimal?");
+ check(surb_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?");
- //cout << surb_test.run(s,t,k) << surb_test.totalLength()<<endl;
- /*
- typedef DirPath<ListGraph> DPath;
- DPath P(graph);
- surb_test.getPath(P,0);
- check(P.length() == 4, "First path should contain 4 edges.");
-
- surb_test.getPath(P,1);
- check(P.length() == 3, "Second path: 3 edges.");
-
- k=1;
- check( surb_test.run(s,t,k) == 1 && surb_test.totalLength() == 19,"One path, total length should be 19");
-
- surb_test.getPath(P,0);
- check(P.length() == 4, "First path should contain 4 edges.");
- */
cout << (passed ? "All tests passed." : "Some of the tests failed!!!")
<< endl;
Modified: hugo/trunk/src/test/minlengthpaths_test.cc
==============================================================================
--- hugo/trunk/src/test/minlengthpaths_test.cc (original)
+++ hugo/trunk/src/test/minlengthpaths_test.cc Tue May 11 18:38:17 2004
@@ -2,6 +2,7 @@
#include <hugo/list_graph.h>
#include <hugo/minlengthpaths.h>
#include <path.h>
+#include "test_tools.h"
using namespace std;
using namespace hugo;
@@ -10,16 +11,6 @@
bool passed = true;
-void check(bool rc, char *msg="") {
- passed = passed && rc;
- if(!rc) {
- std::cerr << "Test failed! ("<< msg << ")" << std::endl; \
-
-
- }
-}
-
-
int main()
{
More information about the Lemon-commits
mailing list