test/dfs_test.cc
changeset 289 d91884dcd572
parent 278 931190050520
child 293 47fbc814aa31
equal deleted inserted replaced
4:601fe879bbad 5:64701ce25411
    54 
    54 
    55 void checkDfsCompile()
    55 void checkDfsCompile()
    56 {
    56 {
    57   typedef concepts::Digraph Digraph;
    57   typedef concepts::Digraph Digraph;
    58   typedef Dfs<Digraph> DType;
    58   typedef Dfs<Digraph> DType;
       
    59   typedef Digraph::Node Node;
       
    60   typedef Digraph::Arc Arc;
    59 
    61 
    60   Digraph G;
    62   Digraph G;
    61   Digraph::Node n;
    63   Node s, t;
    62   Digraph::Arc e;
    64   Arc e;
    63   int l;
    65   int l;
    64   bool b;
    66   bool b;
    65   DType::DistMap d(G);
    67   DType::DistMap d(G);
    66   DType::PredMap p(G);
    68   DType::PredMap p(G);
       
    69   Path<Digraph> pp;
    67 
    70 
    68   DType dfs_test(G);
    71   {
       
    72     DType dfs_test(G);
    69 
    73 
    70   dfs_test.run(n);
    74     dfs_test.run(s);
       
    75     dfs_test.run(s,t);
       
    76     dfs_test.run();
    71 
    77 
    72   l  = dfs_test.dist(n);
    78     l  = dfs_test.dist(t);
    73   e  = dfs_test.predArc(n);
    79     e  = dfs_test.predArc(t);
    74   n  = dfs_test.predNode(n);
    80     s  = dfs_test.predNode(t);
    75   d  = dfs_test.distMap();
    81     b  = dfs_test.reached(t);
    76   p  = dfs_test.predMap();
    82     d  = dfs_test.distMap();
    77   b  = dfs_test.reached(n);
    83     p  = dfs_test.predMap();
       
    84     pp = dfs_test.path(t);
       
    85   }
       
    86   {
       
    87     DType
       
    88       ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
       
    89       ::SetDistMap<concepts::ReadWriteMap<Node,int> >
       
    90       ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
       
    91       ::SetProcessedMap<concepts::WriteMap<Node,bool> >
       
    92       ::SetStandardProcessedMap
       
    93       ::Create dfs_test(G);
    78 
    94 
    79   Path<Digraph> pp = dfs_test.path(n);
    95     dfs_test.run(s);
       
    96     dfs_test.run(s,t);
       
    97     dfs_test.run();
       
    98 
       
    99     l  = dfs_test.dist(t);
       
   100     e  = dfs_test.predArc(t);
       
   101     s  = dfs_test.predNode(t);
       
   102     b  = dfs_test.reached(t);
       
   103     pp = dfs_test.path(t);
       
   104   }
    80 }
   105 }
    81 
   106 
    82 void checkDfsFunctionCompile()
   107 void checkDfsFunctionCompile()
    83 {
   108 {
    84   typedef int VType;
   109   typedef int VType;