Changeset 907:1937b6455b7d in lemon-main for test
- Timestamp:
- 09/22/10 09:38:23 (14 years ago)
- Branch:
- default
- Children:
- 908:10242c611190, 913:5087694945e4, 916:70bee017b584
- Parents:
- 905:de428ebb47ab (diff), 906:e24922c56bc2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/dfs_test.cc
r877 r907 51 51 "@attributes\n" 52 52 "source 0\n" 53 "target 5\n"; 53 "target 5\n" 54 "source1 6\n" 55 "target1 3\n"; 56 54 57 55 58 void checkDfsCompile() … … 180 183 Digraph G; 181 184 Node s, t; 185 Node s1, t1; 182 186 183 187 std::istringstream input(test_lgf); … … 185 189 node("source", s). 186 190 node("target", t). 191 node("source1", s1). 192 node("target1", t1). 187 193 run(); 188 194 … … 211 217 212 218 { 219 Dfs<Digraph> dfs(G); 220 check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6."); 221 } 222 223 { 213 224 NullMap<Node,Arc> myPredMap; 214 225 dfs(G).predMap(myPredMap).run(s); -
test/dfs_test.cc
r906 r907 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 085 * Copyright (C) 2003-2010 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 66 66 Node s, t; 67 67 Arc e; 68 int l ;68 int l, i; 69 69 bool b; 70 70 DType::DistMap d(G); 71 71 DType::PredMap p(G); 72 72 Path<Digraph> pp; 73 concepts::ReadMap<Arc,bool> am; 73 74 74 75 { 75 76 DType dfs_test(G); 77 const DType& const_dfs_test = dfs_test; 76 78 77 79 dfs_test.run(s); … … 79 81 dfs_test.run(); 80 82 81 l = dfs_test.dist(t); 82 e = dfs_test.predArc(t); 83 s = dfs_test.predNode(t); 84 b = dfs_test.reached(t); 85 d = dfs_test.distMap(); 86 p = dfs_test.predMap(); 87 pp = dfs_test.path(t); 83 dfs_test.init(); 84 dfs_test.addSource(s); 85 e = dfs_test.processNextArc(); 86 e = const_dfs_test.nextArc(); 87 b = const_dfs_test.emptyQueue(); 88 i = const_dfs_test.queueSize(); 89 90 dfs_test.start(); 91 dfs_test.start(t); 92 dfs_test.start(am); 93 94 l = const_dfs_test.dist(t); 95 e = const_dfs_test.predArc(t); 96 s = const_dfs_test.predNode(t); 97 b = const_dfs_test.reached(t); 98 d = const_dfs_test.distMap(); 99 p = const_dfs_test.predMap(); 100 pp = const_dfs_test.path(t); 88 101 } 89 102 { … … 92 105 ::SetDistMap<concepts::ReadWriteMap<Node,int> > 93 106 ::SetReachedMap<concepts::ReadWriteMap<Node,bool> > 107 ::SetStandardProcessedMap 94 108 ::SetProcessedMap<concepts::WriteMap<Node,bool> > 95 ::SetStandardProcessedMap96 109 ::Create dfs_test(G); 110 111 concepts::ReadWriteMap<Node,Arc> pred_map; 112 concepts::ReadWriteMap<Node,int> dist_map; 113 concepts::ReadWriteMap<Node,bool> reached_map; 114 concepts::WriteMap<Node,bool> processed_map; 115 116 dfs_test 117 .predMap(pred_map) 118 .distMap(dist_map) 119 .reachedMap(reached_map) 120 .processedMap(processed_map); 97 121 98 122 dfs_test.run(s); 99 123 dfs_test.run(s,t); 100 124 dfs_test.run(); 125 dfs_test.init(); 126 127 dfs_test.addSource(s); 128 e = dfs_test.processNextArc(); 129 e = dfs_test.nextArc(); 130 b = dfs_test.emptyQueue(); 131 i = dfs_test.queueSize(); 132 133 dfs_test.start(); 134 dfs_test.start(t); 135 dfs_test.start(am); 101 136 102 137 l = dfs_test.dist(t);
Note: See TracChangeset
for help on using the changeset viewer.