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