Changeset 286:da414906fe21 in lemon-main for test
- Timestamp:
- 09/26/08 12:40:11 (16 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
test/bfs_test.cc
r278 r286 55 55 typedef concepts::Digraph Digraph; 56 56 typedef Bfs<Digraph> BType; 57 typedef Digraph::Node Node; 58 typedef Digraph::Arc Arc; 57 59 58 60 Digraph G; 59 Digraph::Node n;60 Digraph::Arc e;61 Node s, t; 62 Arc e; 61 63 int l; 62 64 bool b; 63 65 BType::DistMap d(G); 64 66 BType::PredMap p(G); 67 Path<Digraph> pp; 65 68 66 BType bfs_test(G); 69 { 70 BType bfs_test(G); 67 71 68 bfs_test.run(n); 72 bfs_test.run(s); 73 bfs_test.run(s,t); 74 bfs_test.run(); 69 75 70 l = bfs_test.dist(n); 71 e = bfs_test.predArc(n); 72 n = bfs_test.predNode(n); 73 d = bfs_test.distMap(); 74 p = bfs_test.predMap(); 75 b = bfs_test.reached(n); 76 l = bfs_test.dist(t); 77 e = bfs_test.predArc(t); 78 s = bfs_test.predNode(t); 79 b = bfs_test.reached(t); 80 d = bfs_test.distMap(); 81 p = bfs_test.predMap(); 82 pp = bfs_test.path(t); 83 } 84 { 85 BType 86 ::SetPredMap<concepts::ReadWriteMap<Node,Arc> > 87 ::SetDistMap<concepts::ReadWriteMap<Node,int> > 88 ::SetReachedMap<concepts::ReadWriteMap<Node,bool> > 89 ::SetProcessedMap<concepts::WriteMap<Node,bool> > 90 ::SetStandardProcessedMap 91 ::Create bfs_test(G); 76 92 77 Path<Digraph> pp = bfs_test.path(n); 93 bfs_test.run(s); 94 bfs_test.run(s,t); 95 bfs_test.run(); 96 97 l = bfs_test.dist(t); 98 e = bfs_test.predArc(t); 99 s = bfs_test.predNode(t); 100 b = bfs_test.reached(t); 101 pp = bfs_test.path(t); 102 } 78 103 } 79 104 -
test/dfs_test.cc
r278 r286 57 57 typedef concepts::Digraph Digraph; 58 58 typedef Dfs<Digraph> DType; 59 typedef Digraph::Node Node; 60 typedef Digraph::Arc Arc; 59 61 60 62 Digraph G; 61 Digraph::Node n;62 Digraph::Arc e;63 Node s, t; 64 Arc e; 63 65 int l; 64 66 bool b; 65 67 DType::DistMap d(G); 66 68 DType::PredMap p(G); 69 Path<Digraph> pp; 67 70 68 DType dfs_test(G); 71 { 72 DType dfs_test(G); 69 73 70 dfs_test.run(n); 74 dfs_test.run(s); 75 dfs_test.run(s,t); 76 dfs_test.run(); 71 77 72 l = dfs_test.dist(n); 73 e = dfs_test.predArc(n); 74 n = dfs_test.predNode(n); 75 d = dfs_test.distMap(); 76 p = dfs_test.predMap(); 77 b = dfs_test.reached(n); 78 l = dfs_test.dist(t); 79 e = dfs_test.predArc(t); 80 s = dfs_test.predNode(t); 81 b = dfs_test.reached(t); 82 d = dfs_test.distMap(); 83 p = dfs_test.predMap(); 84 pp = dfs_test.path(t); 85 } 86 { 87 DType 88 ::SetPredMap<concepts::ReadWriteMap<Node,Arc> > 89 ::SetDistMap<concepts::ReadWriteMap<Node,int> > 90 ::SetReachedMap<concepts::ReadWriteMap<Node,bool> > 91 ::SetProcessedMap<concepts::WriteMap<Node,bool> > 92 ::SetStandardProcessedMap 93 ::Create dfs_test(G); 78 94 79 Path<Digraph> pp = dfs_test.path(n); 95 dfs_test.run(s); 96 dfs_test.run(s,t); 97 dfs_test.run(); 98 99 l = dfs_test.dist(t); 100 e = dfs_test.predArc(t); 101 s = dfs_test.predNode(t); 102 b = dfs_test.reached(t); 103 pp = dfs_test.path(t); 104 } 80 105 } 81 106 -
test/dijkstra_test.cc
r278 r286 23 23 #include <lemon/dijkstra.h> 24 24 #include <lemon/path.h> 25 #include <lemon/bin_heap.h> 25 26 26 27 #include "graph_test.h" … … 56 57 typedef concepts::ReadMap<Digraph::Arc,VType> LengthMap; 57 58 typedef Dijkstra<Digraph, LengthMap> DType; 59 typedef Digraph::Node Node; 60 typedef Digraph::Arc Arc; 58 61 59 62 Digraph G; 60 Digraph::Node n;61 Digraph::Arc e;63 Node s, t; 64 Arc e; 62 65 VType l; 63 66 bool b; … … 65 68 DType::PredMap p(G); 66 69 LengthMap length; 70 Path<Digraph> pp; 67 71 68 DType dijkstra_test(G,length); 72 { 73 DType dijkstra_test(G,length); 69 74 70 dijkstra_test.run(n); 75 dijkstra_test.run(s); 76 dijkstra_test.run(s,t); 71 77 72 l = dijkstra_test.dist(n); 73 e = dijkstra_test.predArc(n); 74 n = dijkstra_test.predNode(n); 75 d = dijkstra_test.distMap(); 76 p = dijkstra_test.predMap(); 77 b = dijkstra_test.reached(n); 78 l = dijkstra_test.dist(t); 79 e = dijkstra_test.predArc(t); 80 s = dijkstra_test.predNode(t); 81 b = dijkstra_test.reached(t); 82 d = dijkstra_test.distMap(); 83 p = dijkstra_test.predMap(); 84 pp = dijkstra_test.path(t); 85 } 86 { 87 DType 88 ::SetPredMap<concepts::ReadWriteMap<Node,Arc> > 89 ::SetDistMap<concepts::ReadWriteMap<Node,VType> > 90 ::SetProcessedMap<concepts::WriteMap<Node,bool> > 91 ::SetStandardProcessedMap 92 ::SetOperationTraits<DijkstraWidestPathOperationTraits<VType> > 93 ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > > 94 ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > > 95 ::Create dijkstra_test(G,length); 78 96 79 Path<Digraph> pp = dijkstra_test.path(n); 97 dijkstra_test.run(s); 98 dijkstra_test.run(s,t); 99 100 l = dijkstra_test.dist(t); 101 e = dijkstra_test.predArc(t); 102 s = dijkstra_test.predNode(t); 103 b = dijkstra_test.reached(t); 104 pp = dijkstra_test.path(t); 105 } 106 80 107 } 81 108
Note: See TracChangeset
for help on using the changeset viewer.