test/dijkstra_test.cc
changeset 2368 6b2e8b734ae7
parent 2298 d77ddf9e592f
child 2391 14a343be7a5a
equal deleted inserted replaced
10:bfb6ca7ecf30 11:3c288620eca8
    61   d  = dijkstra_test.distMap();
    61   d  = dijkstra_test.distMap();
    62   p  = dijkstra_test.predMap();
    62   p  = dijkstra_test.predMap();
    63   //  pn = dijkstra_test.predNodeMap();
    63   //  pn = dijkstra_test.predNodeMap();
    64   b  = dijkstra_test.reached(n);
    64   b  = dijkstra_test.reached(n);
    65 
    65 
    66   Path<Graph> pp(G);
    66   Path<Graph> pp = dijkstra_test.path(n);
    67   dijkstra_test.getPath(pp,n);
       
    68 }
    67 }
    69 
    68 
    70 void check_Dijkstra_Function_Compile() 
    69 void check_Dijkstra_Function_Compile() 
    71 {
    70 {
    72   typedef int VType;
    71   typedef int VType;
   118   dijkstra_test.run(s);
   117   dijkstra_test.run(s);
   119   
   118   
   120   check(dijkstra_test.dist(t)==13,"Dijkstra found a wrong path.");
   119   check(dijkstra_test.dist(t)==13,"Dijkstra found a wrong path.");
   121 
   120 
   122 
   121 
   123   Path<Graph> p(G);
   122   Path<Graph> p = dijkstra_test.path(t);
   124   check(dijkstra_test.getPath(p,t),"getPath() failed to set the path.");
       
   125   check(p.length()==4,"getPath() found a wrong path.");
   123   check(p.length()==4,"getPath() found a wrong path.");
       
   124   check(checkPath(G, p),"path() found a wrong path.");
       
   125   check(pathSource(G, p) == s,"path() found a wrong path.");
       
   126   check(pathTarget(G, p) == t,"path() found a wrong path.");
   126   
   127   
   127 
   128 
   128   for(EdgeIt e(G); e!=INVALID; ++e) {
   129   for(EdgeIt e(G); e!=INVALID; ++e) {
   129     Node u=G.source(e);
   130     Node u=G.source(e);
   130     Node v=G.target(e);
   131     Node v=G.target(e);