test/dfs_test.cc
changeset 2256 b22dfb6c5ff3
parent 2135 15355b98fb84
child 2260 4274224f8a7d
equal deleted inserted replaced
5:14e60292a81f 6:a6e26d96c90a
    57   d  = dfs_test.distMap();
    57   d  = dfs_test.distMap();
    58   p  = dfs_test.predMap();
    58   p  = dfs_test.predMap();
    59   //  pn = dfs_test.predNodeMap();
    59   //  pn = dfs_test.predNodeMap();
    60   b  = dfs_test.reached(n);
    60   b  = dfs_test.reached(n);
    61 
    61 
    62   DirPath<Graph> pp(G);
    62   Path<Graph> pp(G);
    63   dfs_test.getPath(pp,n);
    63   dfs_test.getPath(pp,n);
    64 }
    64 }
    65 
    65 
    66 
    66 
    67 void check_Dfs_Function_Compile() 
    67 void check_Dfs_Function_Compile() 
   106   t=ps.inner[0];
   106   t=ps.inner[0];
   107   
   107   
   108   Dfs<Graph> dfs_test(G);
   108   Dfs<Graph> dfs_test(G);
   109   dfs_test.run(s);  
   109   dfs_test.run(s);  
   110   
   110   
   111   DirPath<Graph> p(G);
   111   Path<Graph> p(G);
   112   check(dfs_test.getPath(p,t),"getPath() failed to set the path.");
   112   check(dfs_test.getPath(p,t),"getPath() failed to set the path.");
   113   check(p.length()==dfs_test.dist(t),"getPath() found a wrong path.");
   113   check(p.length()==dfs_test.dist(t),"getPath() found a wrong path.");
   114   
   114   
   115   for(NodeIt v(G); v!=INVALID; ++v) {
   115   for(NodeIt v(G); v!=INVALID; ++v) {
   116     check(dfs_test.reached(v),"Each node should be reached.");
   116     check(dfs_test.reached(v),"Each node should be reached.");