Nicer and more documented graph_wrapper.h file.
These are only the first steps for making this file more beautiful.
1 #include "test_tools.h"
2 #include <hugo/smart_graph.h>
10 void check_Dfs_SmartGraph_Compile()
13 typedef SmartGraph Graph;
15 typedef Graph::Edge Edge;
16 typedef Graph::Node Node;
17 typedef Graph::EdgeIt EdgeIt;
18 typedef Graph::NodeIt NodeIt;
19 typedef Graph::EdgeMap<VType> LengthMap;
21 typedef Dfs<Graph> BType;
30 BType::PredNodeMap pn(G);
39 n = dfs_test.predNode(n);
40 d = dfs_test.distMap();
41 p = dfs_test.predMap();
42 pn = dfs_test.predNodeMap();
43 b = dfs_test.reached(n);
50 typedef SmartGraph Graph;
52 typedef Graph::Edge Edge;
53 typedef Graph::Node Node;
54 typedef Graph::EdgeIt EdgeIt;
55 typedef Graph::NodeIt NodeIt;
56 typedef Graph::EdgeMap<int> LengthMap;
60 PetStruct<Graph> ps = addPetersen(G,PET_SIZE);
65 Dfs<Graph> dfs_test(G);
68 for(NodeIt v(G); v!=INVALID; ++v) {
69 check(dfs_test.reached(v),"Each node should be reached.");
70 if ( dfs_test.pred(v)!=INVALID ) {
71 Edge e=dfs_test.pred(v);
73 check(u==dfs_test.predNode(v),"Wrong tree.");
74 check(dfs_test.dist(v) - dfs_test.dist(u) == 1,
75 "Wrong distance." << dfs_test.dist(v) << " " <<dfs_test.dist(u) );