test/bfs_test.cc
changeset 2347 0aaa7ada5395
parent 2260 4274224f8a7d
child 2391 14a343be7a5a
equal deleted inserted replaced
7:c2f169a0857d 8:8af945ec0f2a
    57   d  = bfs_test.distMap();
    57   d  = bfs_test.distMap();
    58   p  = bfs_test.predMap();
    58   p  = bfs_test.predMap();
    59   //  pn = bfs_test.predNodeMap();
    59   //  pn = bfs_test.predNodeMap();
    60   b  = bfs_test.reached(n);
    60   b  = bfs_test.reached(n);
    61 
    61 
    62   Path<Graph> pp(G);
    62   Path<Graph> pp = bfs_test.path(n);
    63   bfs_test.getPath(pp,n);
       
    64 }
    63 }
    65 
    64 
    66 void check_Bfs_Function_Compile() 
    65 void check_Bfs_Function_Compile() 
    67 {
    66 {
    68   typedef int VType;
    67   typedef int VType;
   107   Bfs<Graph> bfs_test(G);
   106   Bfs<Graph> bfs_test(G);
   108   bfs_test.run(s);
   107   bfs_test.run(s);
   109   
   108   
   110   check(bfs_test.dist(t)==3,"Bfs found a wrong path. " << bfs_test.dist(t));
   109   check(bfs_test.dist(t)==3,"Bfs found a wrong path. " << bfs_test.dist(t));
   111 
   110 
   112   Path<Graph> p(G);
   111   Path<Graph> p = bfs_test.path(t);
   113   check(bfs_test.getPath(p,t),"getPath() failed to set the path.");
       
   114   check(p.length()==3,"getPath() found a wrong path.");
   112   check(p.length()==3,"getPath() found a wrong path.");
       
   113   check(checkPath(G, p),"path() found a wrong path.");
       
   114   check(pathSource(G, p) == s,"path() found a wrong path.");
       
   115   check(pathTarget(G, p) == t,"path() found a wrong path.");
   115   
   116   
   116 
   117 
   117   for(EdgeIt e(G); e==INVALID; ++e) {
   118   for(EdgeIt e(G); e==INVALID; ++e) {
   118     Node u=G.source(e);
   119     Node u=G.source(e);
   119     Node v=G.target(e);
   120     Node v=G.target(e);