Correction in doc: skeleton/path.h has been moved to the 'skeletons' module.
1 #include "test_tools.h"
2 #include <hugo/smart_graph.h>
4 #include<hugo/skeletons/graph.h>
11 void check_Dfs_SmartGraph_Compile()
13 typedef skeleton::StaticGraphSkeleton Graph;
15 typedef Graph::Edge Edge;
16 typedef Graph::Node Node;
17 typedef Graph::EdgeIt EdgeIt;
18 typedef Graph::NodeIt NodeIt;
20 typedef Dfs<Graph> DType;
29 DType::PredNodeMap pn(G);
37 n = dfs_test.predNode(n);
38 d = dfs_test.distMap();
39 p = dfs_test.predMap();
40 pn = dfs_test.predNodeMap();
41 b = dfs_test.reached(n);
48 typedef SmartGraph Graph;
50 typedef Graph::Edge Edge;
51 typedef Graph::Node Node;
52 typedef Graph::EdgeIt EdgeIt;
53 typedef Graph::NodeIt NodeIt;
54 typedef Graph::EdgeMap<int> LengthMap;
58 PetStruct<Graph> ps = addPetersen(G,PET_SIZE);
63 Dfs<Graph> dfs_test(G);
66 for(NodeIt v(G); v!=INVALID; ++v) {
67 check(dfs_test.reached(v),"Each node should be reached.");
68 if ( dfs_test.pred(v)!=INVALID ) {
69 Edge e=dfs_test.pred(v);
71 check(u==dfs_test.predNode(v),"Wrong tree.");
72 check(dfs_test.dist(v) - dfs_test.dist(u) == 1,
73 "Wrong distance." << dfs_test.dist(v) << " " <<dfs_test.dist(u) );