test/dfs_test.cc
changeset 892 02109e17027f
parent 463 88ed40ad0d4f
child 956 141f9c0db4a3
child 1009 c85f53572941
equal deleted inserted replaced
7:1731c7828e45 8:49fb9d42927c
    60   typedef Digraph::Arc Arc;
    60   typedef Digraph::Arc Arc;
    61 
    61 
    62   Digraph G;
    62   Digraph G;
    63   Node s, t;
    63   Node s, t;
    64   Arc e;
    64   Arc e;
    65   int l;
    65   int l, i;
    66   bool b;
    66   bool b;
    67   DType::DistMap d(G);
    67   DType::DistMap d(G);
    68   DType::PredMap p(G);
    68   DType::PredMap p(G);
    69   Path<Digraph> pp;
    69   Path<Digraph> pp;
       
    70   concepts::ReadMap<Arc,bool> am;
    70 
    71 
    71   {
    72   {
    72     DType dfs_test(G);
    73     DType dfs_test(G);
       
    74     const DType& const_dfs_test = dfs_test;
    73 
    75 
    74     dfs_test.run(s);
    76     dfs_test.run(s);
    75     dfs_test.run(s,t);
    77     dfs_test.run(s,t);
    76     dfs_test.run();
    78     dfs_test.run();
    77 
    79 
    78     l  = dfs_test.dist(t);
    80     dfs_test.init();
    79     e  = dfs_test.predArc(t);
    81     dfs_test.addSource(s);
    80     s  = dfs_test.predNode(t);
    82     e = dfs_test.processNextArc();
    81     b  = dfs_test.reached(t);
    83     e = const_dfs_test.nextArc();
    82     d  = dfs_test.distMap();
    84     b = const_dfs_test.emptyQueue();
    83     p  = dfs_test.predMap();
    85     i = const_dfs_test.queueSize();
    84     pp = dfs_test.path(t);
    86     
       
    87     dfs_test.start();
       
    88     dfs_test.start(t);
       
    89     dfs_test.start(am);
       
    90 
       
    91     l  = const_dfs_test.dist(t);
       
    92     e  = const_dfs_test.predArc(t);
       
    93     s  = const_dfs_test.predNode(t);
       
    94     b  = const_dfs_test.reached(t);
       
    95     d  = const_dfs_test.distMap();
       
    96     p  = const_dfs_test.predMap();
       
    97     pp = const_dfs_test.path(t);
    85   }
    98   }
    86   {
    99   {
    87     DType
   100     DType
    88       ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
   101       ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
    89       ::SetDistMap<concepts::ReadWriteMap<Node,int> >
   102       ::SetDistMap<concepts::ReadWriteMap<Node,int> >
    90       ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
   103       ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
       
   104       ::SetStandardProcessedMap
    91       ::SetProcessedMap<concepts::WriteMap<Node,bool> >
   105       ::SetProcessedMap<concepts::WriteMap<Node,bool> >
    92       ::SetStandardProcessedMap
       
    93       ::Create dfs_test(G);
   106       ::Create dfs_test(G);
       
   107 
       
   108     concepts::ReadWriteMap<Node,Arc> pred_map;
       
   109     concepts::ReadWriteMap<Node,int> dist_map;
       
   110     concepts::ReadWriteMap<Node,bool> reached_map;
       
   111     concepts::WriteMap<Node,bool> processed_map;
       
   112     
       
   113     dfs_test
       
   114       .predMap(pred_map)
       
   115       .distMap(dist_map)
       
   116       .reachedMap(reached_map)
       
   117       .processedMap(processed_map);
    94 
   118 
    95     dfs_test.run(s);
   119     dfs_test.run(s);
    96     dfs_test.run(s,t);
   120     dfs_test.run(s,t);
    97     dfs_test.run();
   121     dfs_test.run();
       
   122     dfs_test.init();
       
   123 
       
   124     dfs_test.addSource(s);
       
   125     e = dfs_test.processNextArc();
       
   126     e = dfs_test.nextArc();
       
   127     b = dfs_test.emptyQueue();
       
   128     i = dfs_test.queueSize();
       
   129     
       
   130     dfs_test.start();
       
   131     dfs_test.start(t);
       
   132     dfs_test.start(am);
    98 
   133 
    99     l  = dfs_test.dist(t);
   134     l  = dfs_test.dist(t);
   100     e  = dfs_test.predArc(t);
   135     e  = dfs_test.predArc(t);
   101     s  = dfs_test.predNode(t);
   136     s  = dfs_test.predNode(t);
   102     b  = dfs_test.reached(t);
   137     b  = dfs_test.reached(t);