Changes in / [589:630c4898c548:588:58f70400e139] in lemon-1.2
- Location:
- test
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
test/bfs_test.cc
r585 r440 59 59 60 60 Digraph G; 61 Node s, t , n;61 Node s, t; 62 62 Arc e; 63 int l , i;63 int l; 64 64 bool b; 65 65 BType::DistMap d(G); 66 66 BType::PredMap p(G); 67 67 Path<Digraph> pp; 68 concepts::ReadMap<Node,bool> nm;69 68 70 69 { 71 70 BType bfs_test(G); 72 const BType& const_bfs_test = bfs_test;73 71 74 72 bfs_test.run(s); … … 76 74 bfs_test.run(); 77 75 78 bfs_test.init(); 79 bfs_test.addSource(s); 80 n = bfs_test.processNextNode(); 81 n = bfs_test.processNextNode(t, b); 82 n = bfs_test.processNextNode(nm, n); 83 n = const_bfs_test.nextNode(); 84 b = const_bfs_test.emptyQueue(); 85 i = const_bfs_test.queueSize(); 86 87 bfs_test.start(); 88 bfs_test.start(t); 89 bfs_test.start(nm); 90 91 l = const_bfs_test.dist(t); 92 e = const_bfs_test.predArc(t); 93 s = const_bfs_test.predNode(t); 94 b = const_bfs_test.reached(t); 95 d = const_bfs_test.distMap(); 96 p = const_bfs_test.predMap(); 97 pp = const_bfs_test.path(t); 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); 98 83 } 99 84 { … … 102 87 ::SetDistMap<concepts::ReadWriteMap<Node,int> > 103 88 ::SetReachedMap<concepts::ReadWriteMap<Node,bool> > 89 ::SetProcessedMap<concepts::WriteMap<Node,bool> > 104 90 ::SetStandardProcessedMap 105 ::SetProcessedMap<concepts::WriteMap<Node,bool> >106 91 ::Create bfs_test(G); 107 108 concepts::ReadWriteMap<Node,Arc> pred_map;109 concepts::ReadWriteMap<Node,int> dist_map;110 concepts::ReadWriteMap<Node,bool> reached_map;111 concepts::WriteMap<Node,bool> processed_map;112 113 bfs_test114 .predMap(pred_map)115 .distMap(dist_map)116 .reachedMap(reached_map)117 .processedMap(processed_map);118 92 119 93 bfs_test.run(s); 120 94 bfs_test.run(s,t); 121 95 bfs_test.run(); 122 123 bfs_test.init();124 bfs_test.addSource(s);125 n = bfs_test.processNextNode();126 n = bfs_test.processNextNode(t, b);127 n = bfs_test.processNextNode(nm, n);128 n = bfs_test.nextNode();129 b = bfs_test.emptyQueue();130 i = bfs_test.queueSize();131 132 bfs_test.start();133 bfs_test.start(t);134 bfs_test.start(nm);135 96 136 97 l = bfs_test.dist(t); -
test/circulation_test.cc
r585 r440 72 72 FlowMap flow; 73 73 BarrierMap bar; 74 VType v;75 bool b;76 74 77 typedef Circulation<Digraph, CapMap, CapMap, DeltaMap> 78 ::SetFlowMap<FlowMap> 79 ::SetElevator<Elev> 80 ::SetStandardElevator<LinkedElev> 81 ::Create CirculationType; 82 CirculationType circ_test(g, lcap, ucap, delta); 83 const CirculationType& const_circ_test = circ_test; 84 85 circ_test 86 .lowerCapMap(lcap) 87 .upperCapMap(ucap) 88 .deltaMap(delta) 89 .flowMap(flow); 75 Circulation<Digraph, CapMap, CapMap, DeltaMap> 76 ::SetFlowMap<FlowMap> 77 ::SetElevator<Elev> 78 ::SetStandardElevator<LinkedElev> 79 ::Create circ_test(g,lcap,ucap,delta); 80 81 circ_test.lowerCapMap(lcap); 82 circ_test.upperCapMap(ucap); 83 circ_test.deltaMap(delta); 84 flow = circ_test.flowMap(); 85 circ_test.flowMap(flow); 90 86 91 87 circ_test.init(); … … 94 90 circ_test.run(); 95 91 96 v = const_circ_test.flow(a); 97 const FlowMap& fm = const_circ_test.flowMap(); 98 b = const_circ_test.barrier(n); 99 const_circ_test.barrierMap(bar); 100 101 ignore_unused_variable_warning(fm); 92 circ_test.barrier(n); 93 circ_test.barrierMap(bar); 94 circ_test.flow(a); 102 95 } 103 96 -
test/dfs_test.cc
r585 r440 63 63 Node s, t; 64 64 Arc e; 65 int l , i;65 int l; 66 66 bool b; 67 67 DType::DistMap d(G); 68 68 DType::PredMap p(G); 69 69 Path<Digraph> pp; 70 concepts::ReadMap<Arc,bool> am;71 70 72 71 { 73 72 DType dfs_test(G); 74 const DType& const_dfs_test = dfs_test;75 73 76 74 dfs_test.run(s); … … 78 76 dfs_test.run(); 79 77 80 dfs_test.init(); 81 dfs_test.addSource(s); 82 e = dfs_test.processNextArc(); 83 e = const_dfs_test.nextArc(); 84 b = const_dfs_test.emptyQueue(); 85 i = const_dfs_test.queueSize(); 86 87 dfs_test.start(); 88 dfs_test.start(t); 89 dfs_test.start(am); 90 91 l = const_dfs_test.dist(t); 92 e = const_dfs_test.predArc(t); 93 s = const_dfs_test.predNode(t); 94 b = const_dfs_test.reached(t); 95 d = const_dfs_test.distMap(); 96 p = const_dfs_test.predMap(); 97 pp = const_dfs_test.path(t); 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); 98 85 } 99 86 { … … 102 89 ::SetDistMap<concepts::ReadWriteMap<Node,int> > 103 90 ::SetReachedMap<concepts::ReadWriteMap<Node,bool> > 91 ::SetProcessedMap<concepts::WriteMap<Node,bool> > 104 92 ::SetStandardProcessedMap 105 ::SetProcessedMap<concepts::WriteMap<Node,bool> >106 93 ::Create dfs_test(G); 107 108 concepts::ReadWriteMap<Node,Arc> pred_map;109 concepts::ReadWriteMap<Node,int> dist_map;110 concepts::ReadWriteMap<Node,bool> reached_map;111 concepts::WriteMap<Node,bool> processed_map;112 113 dfs_test114 .predMap(pred_map)115 .distMap(dist_map)116 .reachedMap(reached_map)117 .processedMap(processed_map);118 94 119 95 dfs_test.run(s); 120 96 dfs_test.run(s,t); 121 97 dfs_test.run(); 122 dfs_test.init();123 124 dfs_test.addSource(s);125 e = dfs_test.processNextArc();126 e = dfs_test.nextArc();127 b = dfs_test.emptyQueue();128 i = dfs_test.queueSize();129 130 dfs_test.start();131 dfs_test.start(t);132 dfs_test.start(am);133 98 134 99 l = dfs_test.dist(t); -
test/dijkstra_test.cc
r585 r440 61 61 62 62 Digraph G; 63 Node s, t , n;63 Node s, t; 64 64 Arc e; 65 65 VType l; 66 int i;67 66 bool b; 68 67 DType::DistMap d(G); … … 70 69 LengthMap length; 71 70 Path<Digraph> pp; 72 concepts::ReadMap<Node,bool> nm;73 71 74 72 { 75 73 DType dijkstra_test(G,length); 76 const DType& const_dijkstra_test = dijkstra_test;77 74 78 75 dijkstra_test.run(s); 79 76 dijkstra_test.run(s,t); 80 77 81 dijkstra_test.init(); 82 dijkstra_test.addSource(s); 83 dijkstra_test.addSource(s, 1); 84 n = dijkstra_test.processNextNode(); 85 n = const_dijkstra_test.nextNode(); 86 b = const_dijkstra_test.emptyQueue(); 87 i = const_dijkstra_test.queueSize(); 88 89 dijkstra_test.start(); 90 dijkstra_test.start(t); 91 dijkstra_test.start(nm); 92 93 l = const_dijkstra_test.dist(t); 94 e = const_dijkstra_test.predArc(t); 95 s = const_dijkstra_test.predNode(t); 96 b = const_dijkstra_test.reached(t); 97 b = const_dijkstra_test.processed(t); 98 d = const_dijkstra_test.distMap(); 99 p = const_dijkstra_test.predMap(); 100 pp = const_dijkstra_test.path(t); 101 l = const_dijkstra_test.currentDist(t); 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); 102 85 } 103 86 { … … 105 88 ::SetPredMap<concepts::ReadWriteMap<Node,Arc> > 106 89 ::SetDistMap<concepts::ReadWriteMap<Node,VType> > 90 ::SetProcessedMap<concepts::WriteMap<Node,bool> > 107 91 ::SetStandardProcessedMap 108 ::SetProcessedMap<concepts::WriteMap<Node,bool> >109 92 ::SetOperationTraits<DijkstraDefaultOperationTraits<VType> > 110 93 ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > > 111 94 ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > > 112 ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >,113 concepts::ReadWriteMap<Node,int> >114 95 ::Create dijkstra_test(G,length); 115 116 LengthMap length_map;117 concepts::ReadWriteMap<Node,Arc> pred_map;118 concepts::ReadWriteMap<Node,VType> dist_map;119 concepts::WriteMap<Node,bool> processed_map;120 concepts::ReadWriteMap<Node,int> heap_cross_ref;121 BinHeap<VType, concepts::ReadWriteMap<Node,int> > heap(heap_cross_ref);122 123 dijkstra_test124 .lengthMap(length_map)125 .predMap(pred_map)126 .distMap(dist_map)127 .processedMap(processed_map)128 .heap(heap, heap_cross_ref);129 96 130 97 dijkstra_test.run(s); 131 98 dijkstra_test.run(s,t); 132 133 dijkstra_test.addSource(s);134 dijkstra_test.addSource(s, 1);135 n = dijkstra_test.processNextNode();136 n = dijkstra_test.nextNode();137 b = dijkstra_test.emptyQueue();138 i = dijkstra_test.queueSize();139 140 dijkstra_test.start();141 dijkstra_test.start(t);142 dijkstra_test.start(nm);143 99 144 100 l = dijkstra_test.dist(t); … … 146 102 s = dijkstra_test.predNode(t); 147 103 b = dijkstra_test.reached(t); 148 b = dijkstra_test.processed(t);149 104 pp = dijkstra_test.path(t); 150 l = dijkstra_test.currentDist(t);151 105 } 152 106 -
test/preflow_test.cc
r585 r440 85 85 FlowMap flow; 86 86 CutMap cut; 87 VType v; 88 bool b; 89 90 typedef Preflow<Digraph, CapMap> 91 ::SetFlowMap<FlowMap> 92 ::SetElevator<Elev> 93 ::SetStandardElevator<LinkedElev> 94 ::Create PreflowType; 95 PreflowType preflow_test(g, cap, n, n); 96 const PreflowType& const_preflow_test = preflow_test; 97 98 preflow_test 99 .capacityMap(cap) 100 .flowMap(flow) 101 .source(n) 102 .target(n); 87 88 Preflow<Digraph, CapMap> 89 ::SetFlowMap<FlowMap> 90 ::SetElevator<Elev> 91 ::SetStandardElevator<LinkedElev> 92 ::Create preflow_test(g,cap,n,n); 93 94 preflow_test.capacityMap(cap); 95 flow = preflow_test.flowMap(); 96 preflow_test.flowMap(flow); 97 preflow_test.source(n); 98 preflow_test.target(n); 103 99 104 100 preflow_test.init(); … … 109 105 preflow_test.runMinCut(); 110 106 111 v = const_preflow_test.flowValue(); 112 v = const_preflow_test.flow(e); 113 const FlowMap& fm = const_preflow_test.flowMap(); 114 b = const_preflow_test.minCut(n); 115 const_preflow_test.minCutMap(cut); 116 117 ignore_unused_variable_warning(fm); 107 preflow_test.flowValue(); 108 preflow_test.minCut(n); 109 preflow_test.minCutMap(cut); 110 preflow_test.flow(e); 111 118 112 } 119 113
Note: See TracChangeset
for help on using the changeset viewer.