test/bfs_test.cc
changeset 783 ef88c0a30f85
parent 440 88ed40ad0d4f
child 877 141f9c0db4a3
child 1007 7e368d9b67f7
     1.1 --- a/test/bfs_test.cc	Mon Jan 12 23:11:39 2009 +0100
     1.2 +++ b/test/bfs_test.cc	Thu Nov 05 15:48:01 2009 +0100
     1.3 @@ -58,41 +58,80 @@
     1.4    typedef Digraph::Arc Arc;
     1.5  
     1.6    Digraph G;
     1.7 -  Node s, t;
     1.8 +  Node s, t, n;
     1.9    Arc e;
    1.10 -  int l;
    1.11 +  int l, i;
    1.12    bool b;
    1.13    BType::DistMap d(G);
    1.14    BType::PredMap p(G);
    1.15    Path<Digraph> pp;
    1.16 +  concepts::ReadMap<Node,bool> nm;
    1.17  
    1.18    {
    1.19      BType bfs_test(G);
    1.20 +    const BType& const_bfs_test = bfs_test;
    1.21  
    1.22      bfs_test.run(s);
    1.23      bfs_test.run(s,t);
    1.24      bfs_test.run();
    1.25  
    1.26 -    l  = bfs_test.dist(t);
    1.27 -    e  = bfs_test.predArc(t);
    1.28 -    s  = bfs_test.predNode(t);
    1.29 -    b  = bfs_test.reached(t);
    1.30 -    d  = bfs_test.distMap();
    1.31 -    p  = bfs_test.predMap();
    1.32 -    pp = bfs_test.path(t);
    1.33 +    bfs_test.init();
    1.34 +    bfs_test.addSource(s);
    1.35 +    n = bfs_test.processNextNode();
    1.36 +    n = bfs_test.processNextNode(t, b);
    1.37 +    n = bfs_test.processNextNode(nm, n);
    1.38 +    n = const_bfs_test.nextNode();
    1.39 +    b = const_bfs_test.emptyQueue();
    1.40 +    i = const_bfs_test.queueSize();
    1.41 +    
    1.42 +    bfs_test.start();
    1.43 +    bfs_test.start(t);
    1.44 +    bfs_test.start(nm);
    1.45 +
    1.46 +    l  = const_bfs_test.dist(t);
    1.47 +    e  = const_bfs_test.predArc(t);
    1.48 +    s  = const_bfs_test.predNode(t);
    1.49 +    b  = const_bfs_test.reached(t);
    1.50 +    d  = const_bfs_test.distMap();
    1.51 +    p  = const_bfs_test.predMap();
    1.52 +    pp = const_bfs_test.path(t);
    1.53    }
    1.54    {
    1.55      BType
    1.56        ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
    1.57        ::SetDistMap<concepts::ReadWriteMap<Node,int> >
    1.58        ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
    1.59 +      ::SetStandardProcessedMap
    1.60        ::SetProcessedMap<concepts::WriteMap<Node,bool> >
    1.61 -      ::SetStandardProcessedMap
    1.62        ::Create bfs_test(G);
    1.63 +      
    1.64 +    concepts::ReadWriteMap<Node,Arc> pred_map;
    1.65 +    concepts::ReadWriteMap<Node,int> dist_map;
    1.66 +    concepts::ReadWriteMap<Node,bool> reached_map;
    1.67 +    concepts::WriteMap<Node,bool> processed_map;
    1.68 +    
    1.69 +    bfs_test
    1.70 +      .predMap(pred_map)
    1.71 +      .distMap(dist_map)
    1.72 +      .reachedMap(reached_map)
    1.73 +      .processedMap(processed_map);
    1.74  
    1.75      bfs_test.run(s);
    1.76      bfs_test.run(s,t);
    1.77      bfs_test.run();
    1.78 +    
    1.79 +    bfs_test.init();
    1.80 +    bfs_test.addSource(s);
    1.81 +    n = bfs_test.processNextNode();
    1.82 +    n = bfs_test.processNextNode(t, b);
    1.83 +    n = bfs_test.processNextNode(nm, n);
    1.84 +    n = bfs_test.nextNode();
    1.85 +    b = bfs_test.emptyQueue();
    1.86 +    i = bfs_test.queueSize();
    1.87 +    
    1.88 +    bfs_test.start();
    1.89 +    bfs_test.start(t);
    1.90 +    bfs_test.start(nm);
    1.91  
    1.92      l  = bfs_test.dist(t);
    1.93      e  = bfs_test.predArc(t);