# HG changeset patch # User athos # Date 1083661380 0 # Node ID 474f5508e9a2b8efbf910c6b0734e22ba686f393 # Parent fcdb561b8c7841f58211e718481461701f3f500c Putting things in their place diff -r fcdb561b8c78 -r 474f5508e9a2 src/work/athos/minlengthpaths.h --- a/src/work/athos/minlengthpaths.h Tue May 04 09:00:11 2004 +0000 +++ b/src/work/athos/minlengthpaths.h Tue May 04 09:03:00 2004 +0000 @@ -180,7 +180,7 @@ ///This function gives back the \c j-th path in argument p. ///Assumes that \c run() has been run and nothing changed since then. - /// \warning It is assumed that \c p is constructed to be a path of graph \c G. + /// \warning It is assumed that \c p is constructed to be a path of graph \c G. If \c j is greater than the result of previous \c run, then the result here will be an empty path. template void getPath(DirPath& p, int j){ p.clear(); diff -r fcdb561b8c78 -r 474f5508e9a2 src/work/athos/minlengthpaths_test.cc --- a/src/work/athos/minlengthpaths_test.cc Tue May 04 09:00:11 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -// -*- c++ -*- -//#include -//#include -//#include - -#include -#include - -using namespace hugo; - - -int main() -{ - - - typedef ListGraph::Node Node; - typedef ListGraph::Edge Edge; - - ListGraph graph; - - /* - //Marci példája - - - NodeIt s=graph.addNode(); - NodeIt v1=graph.addNode(); - NodeIt v2=graph.addNode(); - NodeIt v3=graph.addNode(); - NodeIt v4=graph.addNode(); - NodeIt t=graph.addNode(); - - - EdgeIt s_v1=graph.addEdge(s, v1); - EdgeIt s_v2=graph.addEdge(s, v2); - EdgeIt v1_v2=graph.addEdge(v1, v2); - EdgeIt v2_v1=graph.addEdge(v2, v1); - EdgeIt v1_v3=graph.addEdge(v1, v3); - EdgeIt v3_v2=graph.addEdge(v3, v2); - EdgeIt v2_v4=graph.addEdge(v2, v4); - EdgeIt v4_v3=graph.addEdge(v4, v3); - EdgeIt v3_t=graph.addEdge(v3, t); - EdgeIt v4_t=graph.addEdge(v4, t); - - ListGraph::EdgeMap length(graph); - - length.set(s_v1, 16); - length.set(s_v2, 13); - length.set(v1_v2, 10); - length.set(v2_v1, 4); - length.set(v1_v3, 12); - length.set(v3_v2, 9); - length.set(v2_v4, 14); - length.set(v4_v3, 7); - length.set(v3_t, 20); - length.set(v4_t, 4); - */ - - - //Ahuja könyv példája - - Node s=graph.addNode(); - Node v2=graph.addNode(); - Node v3=graph.addNode(); - Node v4=graph.addNode(); - Node v5=graph.addNode(); - Node t=graph.addNode(); - - Edge s_v2=graph.addEdge(s, v2); - Edge s_v3=graph.addEdge(s, v3); - Edge v2_v4=graph.addEdge(v2, v4); - Edge v2_v5=graph.addEdge(v2, v5); - Edge v3_v5=graph.addEdge(v3, v5); - Edge v4_t=graph.addEdge(v4, t); - Edge v5_t=graph.addEdge(v5, t); - - //Kis modositas - //edge_iterator v2_s=graph.add_edge(v2, s); - - ListGraph::EdgeMap length(graph); - - length.set(s_v2, 10); - length.set(s_v3, 10); - length.set(v2_v4, 5); - length.set(v2_v5, 8); - length.set(v3_v5, 5); - length.set(v4_t, 8); - length.set(v5_t, 8); - - //Kis modositas - //length.put(v2_s, 100); - - - - - /*Egyszerű példa - NodeIt s=flow_test.add_node(); - NodeIt v1=flow_test.add_node(); - NodeIt v2=flow_test.add_node(); - NodeIt t=flow_test.add_node(); - - node_property_vector node_name(flow_test); - node_name.put(s, "s"); - node_name.put(v1, "v1"); - node_name.put(v2, "v2"); - node_name.put(t, "t"); - - edge_iterator s_v1=flow_test.add_edge(s, v1); - edge_iterator v1_v2=flow_test.add_edge(v1, v2); - edge_iterator v2_t=flow_test.add_edge(v2, t); - - edge_property_vector length(flow_test); - - length.put(s_v1, 16); - length.put(v1_v2, 10); - length.put(v2_t, 4); - */ - - std::cout << "Suurballe algorithm test..." << std::endl; - - - int k=3; - MinLengthPaths > - surb_test(graph, length); - std::cout << surb_test.run(s,t,k) << std::endl; - - - return 0; -} diff -r fcdb561b8c78 -r 474f5508e9a2 src/work/athos/xy/xy_test.cc --- a/src/work/athos/xy/xy_test.cc Tue May 04 09:00:11 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -#include -#include -using namespace std; -using namespace hugo; - -bool passed = true; - -void check(bool rc) { - passed = passed && rc; - if(!rc) { - cout << "Test failed!" << endl; - } -} - - - -int main() -{ - - - - typedef xy XY; - - XY seged; - XY a(1,2); - XY b(3,4); - - seged = a+b; - check(seged.x==4 && seged.y==6); - - seged = a-b; - check(seged.x==-1 && seged.y==-1); - - check(a.normSquare()==5); - check(a*b==11); - - int l=2; - seged = a*l; - check(seged.x==2 && seged.y==4); - - seged = b/l; - check(seged.x==1 && seged.y==2); - - typedef BoundingBox BB; - BB doboz1; - doboz1 += a; - doboz1 += b; - - cout << (passed ? "All tests passed." : "Some of the tests failed!!!") - << endl; - - return passed ? 0 : 1; - -}