src/test/dfs_test.cc
changeset 793 9cd0aeea47b0
parent 780 e06d0d16595f
child 880 9d0bfd35b97c
equal deleted inserted replaced
0:6499bf0bb13b 1:7d9ccf1f70d5
     1 #include "test_tools.h"
     1 #include "test_tools.h"
     2 #include <hugo/smart_graph.h>
     2 #include <hugo/smart_graph.h>
     3 #include <hugo/dfs.h>
     3 #include <hugo/dfs.h>
       
     4 #include<hugo/skeletons/graph.h>
     4 
     5 
     5 using namespace hugo;
     6 using namespace hugo;
     6 
     7 
     7 const int PET_SIZE =5;
     8 const int PET_SIZE =5;
     8 
     9 
     9 
    10 
    10 void check_Dfs_SmartGraph_Compile() 
    11 void check_Dfs_SmartGraph_Compile() 
    11 {
    12 {
    12   typedef int VType;
    13   typedef skeleton::StaticGraphSkeleton Graph;
    13   typedef SmartGraph Graph;
       
    14 
    14 
    15   typedef Graph::Edge Edge;
    15   typedef Graph::Edge Edge;
    16   typedef Graph::Node Node;
    16   typedef Graph::Node Node;
    17   typedef Graph::EdgeIt EdgeIt;
    17   typedef Graph::EdgeIt EdgeIt;
    18   typedef Graph::NodeIt NodeIt;
    18   typedef Graph::NodeIt NodeIt;
    19   typedef Graph::EdgeMap<VType> LengthMap;
       
    20  
    19  
    21   typedef Dfs<Graph> BType;
    20   typedef Dfs<Graph> DType;
    22   
    21   
    23   Graph G;
    22   Graph G;
    24   Node n;
    23   Node n;
    25   Edge e;
    24   Edge e;
    26   VType l;
    25   int l;
    27   bool b;
    26   bool b;
    28   BType::DistMap d(G);
    27   DType::DistMap d(G);
    29   BType::PredMap p(G);
    28   DType::PredMap p(G);
    30   BType::PredNodeMap pn(G);
    29   DType::PredNodeMap pn(G);
    31   LengthMap cap(G);
       
    32   
    30   
    33   BType dfs_test(G);
    31   DType dfs_test(G);
    34   
    32   
    35   dfs_test.run(n);
    33   dfs_test.run(n);
    36   
    34   
    37   l  = dfs_test.dist(n);
    35   l  = dfs_test.dist(n);
    38   e  = dfs_test.pred(n);
    36   e  = dfs_test.pred(n);