test/dfs_test.cc
changeset 281 e9b4fbe163f5
parent 228 b6732e0d38c5
child 286 da414906fe21
     1.1 --- a/test/dfs_test.cc	Mon Jul 14 15:23:11 2008 +0100
     1.2 +++ b/test/dfs_test.cc	Fri Sep 26 09:52:28 2008 +0200
     1.3 @@ -20,7 +20,6 @@
     1.4  #include <lemon/smart_graph.h>
     1.5  #include <lemon/list_graph.h>
     1.6  #include <lemon/lgf_reader.h>
     1.7 -
     1.8  #include <lemon/dfs.h>
     1.9  #include <lemon/path.h>
    1.10  
    1.11 @@ -88,14 +87,30 @@
    1.12    typedef Digraph::Node Node;
    1.13  
    1.14    Digraph g;
    1.15 -  dfs(g,Node()).run();
    1.16 -  dfs(g).source(Node()).run();
    1.17 +  bool b;
    1.18 +  dfs(g).run(Node());
    1.19 +  b=dfs(g).run(Node(),Node());
    1.20 +  dfs(g).run();
    1.21    dfs(g)
    1.22 -    .predMap(concepts::WriteMap<Node,Arc>())
    1.23 -    .distMap(concepts::WriteMap<Node,VType>())
    1.24 +    .predMap(concepts::ReadWriteMap<Node,Arc>())
    1.25 +    .distMap(concepts::ReadWriteMap<Node,VType>())
    1.26      .reachedMap(concepts::ReadWriteMap<Node,bool>())
    1.27      .processedMap(concepts::WriteMap<Node,bool>())
    1.28      .run(Node());
    1.29 +  b=dfs(g)
    1.30 +    .predMap(concepts::ReadWriteMap<Node,Arc>())
    1.31 +    .distMap(concepts::ReadWriteMap<Node,VType>())
    1.32 +    .reachedMap(concepts::ReadWriteMap<Node,bool>())
    1.33 +    .processedMap(concepts::WriteMap<Node,bool>())
    1.34 +    .path(concepts::Path<Digraph>())
    1.35 +    .dist(VType())
    1.36 +    .run(Node(),Node());
    1.37 +  dfs(g)
    1.38 +    .predMap(concepts::ReadWriteMap<Node,Arc>())
    1.39 +    .distMap(concepts::ReadWriteMap<Node,VType>())
    1.40 +    .reachedMap(concepts::ReadWriteMap<Node,bool>())
    1.41 +    .processedMap(concepts::WriteMap<Node,bool>())
    1.42 +    .run();
    1.43  }
    1.44  
    1.45  template <class Digraph>
    1.46 @@ -129,10 +144,15 @@
    1.47          check(u==dfs_test.predNode(v),"Wrong tree.");
    1.48          check(dfs_test.dist(v) - dfs_test.dist(u) == 1,
    1.49                "Wrong distance. (" << dfs_test.dist(u) << "->"
    1.50 -              <<dfs_test.dist(v) << ')');
    1.51 +              << dfs_test.dist(v) << ")");
    1.52        }
    1.53      }
    1.54    }
    1.55 +
    1.56 +  {
    1.57 +    NullMap<Node,Arc> myPredMap;
    1.58 +    dfs(G).predMap(myPredMap).run(s);
    1.59 +  }
    1.60  }
    1.61  
    1.62  int main()