# HG changeset patch # User Alpar Juttner # Date 2009-04-15 08:13:30 # Node ID 630c4898c5480faa06857c9aec409042173b0bf7 # Parent 58f70400e13958b9369745dfd8c7211b3b0bf327 # Parent 65fbcf2f978ac926a336c18144f596f14c37d844 Merge diff --git a/test/bfs_test.cc b/test/bfs_test.cc --- a/test/bfs_test.cc +++ b/test/bfs_test.cc @@ -58,41 +58,80 @@ typedef Digraph::Arc Arc; Digraph G; - Node s, t; + Node s, t, n; Arc e; - int l; + int l, i; bool b; BType::DistMap d(G); BType::PredMap p(G); Path pp; + concepts::ReadMap nm; { BType bfs_test(G); + const BType& const_bfs_test = bfs_test; bfs_test.run(s); bfs_test.run(s,t); bfs_test.run(); - l = bfs_test.dist(t); - e = bfs_test.predArc(t); - s = bfs_test.predNode(t); - b = bfs_test.reached(t); - d = bfs_test.distMap(); - p = bfs_test.predMap(); - pp = bfs_test.path(t); + bfs_test.init(); + bfs_test.addSource(s); + n = bfs_test.processNextNode(); + n = bfs_test.processNextNode(t, b); + n = bfs_test.processNextNode(nm, n); + n = const_bfs_test.nextNode(); + b = const_bfs_test.emptyQueue(); + i = const_bfs_test.queueSize(); + + bfs_test.start(); + bfs_test.start(t); + bfs_test.start(nm); + + l = const_bfs_test.dist(t); + e = const_bfs_test.predArc(t); + s = const_bfs_test.predNode(t); + b = const_bfs_test.reached(t); + d = const_bfs_test.distMap(); + p = const_bfs_test.predMap(); + pp = const_bfs_test.path(t); } { BType ::SetPredMap > ::SetDistMap > ::SetReachedMap > + ::SetStandardProcessedMap ::SetProcessedMap > - ::SetStandardProcessedMap ::Create bfs_test(G); + + concepts::ReadWriteMap pred_map; + concepts::ReadWriteMap dist_map; + concepts::ReadWriteMap reached_map; + concepts::WriteMap processed_map; + + bfs_test + .predMap(pred_map) + .distMap(dist_map) + .reachedMap(reached_map) + .processedMap(processed_map); bfs_test.run(s); bfs_test.run(s,t); bfs_test.run(); + + bfs_test.init(); + bfs_test.addSource(s); + n = bfs_test.processNextNode(); + n = bfs_test.processNextNode(t, b); + n = bfs_test.processNextNode(nm, n); + n = bfs_test.nextNode(); + b = bfs_test.emptyQueue(); + i = bfs_test.queueSize(); + + bfs_test.start(); + bfs_test.start(t); + bfs_test.start(nm); l = bfs_test.dist(t); e = bfs_test.predArc(t); diff --git a/test/circulation_test.cc b/test/circulation_test.cc --- a/test/circulation_test.cc +++ b/test/circulation_test.cc @@ -71,27 +71,34 @@ DeltaMap delta; FlowMap flow; BarrierMap bar; + VType v; + bool b; - Circulation - ::SetFlowMap - ::SetElevator - ::SetStandardElevator - ::Create circ_test(g,lcap,ucap,delta); - - circ_test.lowerCapMap(lcap); - circ_test.upperCapMap(ucap); - circ_test.deltaMap(delta); - flow = circ_test.flowMap(); - circ_test.flowMap(flow); + typedef Circulation + ::SetFlowMap + ::SetElevator + ::SetStandardElevator + ::Create CirculationType; + CirculationType circ_test(g, lcap, ucap, delta); + const CirculationType& const_circ_test = circ_test; + + circ_test + .lowerCapMap(lcap) + .upperCapMap(ucap) + .deltaMap(delta) + .flowMap(flow); circ_test.init(); circ_test.greedyInit(); circ_test.start(); circ_test.run(); - circ_test.barrier(n); - circ_test.barrierMap(bar); - circ_test.flow(a); + v = const_circ_test.flow(a); + const FlowMap& fm = const_circ_test.flowMap(); + b = const_circ_test.barrier(n); + const_circ_test.barrierMap(bar); + + ignore_unused_variable_warning(fm); } template diff --git a/test/dfs_test.cc b/test/dfs_test.cc --- a/test/dfs_test.cc +++ b/test/dfs_test.cc @@ -62,39 +62,74 @@ Digraph G; Node s, t; Arc e; - int l; + int l, i; bool b; DType::DistMap d(G); DType::PredMap p(G); Path pp; + concepts::ReadMap am; { DType dfs_test(G); + const DType& const_dfs_test = dfs_test; dfs_test.run(s); dfs_test.run(s,t); dfs_test.run(); - l = dfs_test.dist(t); - e = dfs_test.predArc(t); - s = dfs_test.predNode(t); - b = dfs_test.reached(t); - d = dfs_test.distMap(); - p = dfs_test.predMap(); - pp = dfs_test.path(t); + dfs_test.init(); + dfs_test.addSource(s); + e = dfs_test.processNextArc(); + e = const_dfs_test.nextArc(); + b = const_dfs_test.emptyQueue(); + i = const_dfs_test.queueSize(); + + dfs_test.start(); + dfs_test.start(t); + dfs_test.start(am); + + l = const_dfs_test.dist(t); + e = const_dfs_test.predArc(t); + s = const_dfs_test.predNode(t); + b = const_dfs_test.reached(t); + d = const_dfs_test.distMap(); + p = const_dfs_test.predMap(); + pp = const_dfs_test.path(t); } { DType ::SetPredMap > ::SetDistMap > ::SetReachedMap > + ::SetStandardProcessedMap ::SetProcessedMap > - ::SetStandardProcessedMap ::Create dfs_test(G); + concepts::ReadWriteMap pred_map; + concepts::ReadWriteMap dist_map; + concepts::ReadWriteMap reached_map; + concepts::WriteMap processed_map; + + dfs_test + .predMap(pred_map) + .distMap(dist_map) + .reachedMap(reached_map) + .processedMap(processed_map); + dfs_test.run(s); dfs_test.run(s,t); dfs_test.run(); + dfs_test.init(); + + dfs_test.addSource(s); + e = dfs_test.processNextArc(); + e = dfs_test.nextArc(); + b = dfs_test.emptyQueue(); + i = dfs_test.queueSize(); + + dfs_test.start(); + dfs_test.start(t); + dfs_test.start(am); l = dfs_test.dist(t); e = dfs_test.predArc(t); diff --git a/test/dijkstra_test.cc b/test/dijkstra_test.cc --- a/test/dijkstra_test.cc +++ b/test/dijkstra_test.cc @@ -60,48 +60,94 @@ typedef Digraph::Arc Arc; Digraph G; - Node s, t; + Node s, t, n; Arc e; VType l; + int i; bool b; DType::DistMap d(G); DType::PredMap p(G); LengthMap length; Path pp; + concepts::ReadMap nm; { DType dijkstra_test(G,length); + const DType& const_dijkstra_test = dijkstra_test; dijkstra_test.run(s); dijkstra_test.run(s,t); + dijkstra_test.init(); + dijkstra_test.addSource(s); + dijkstra_test.addSource(s, 1); + n = dijkstra_test.processNextNode(); + n = const_dijkstra_test.nextNode(); + b = const_dijkstra_test.emptyQueue(); + i = const_dijkstra_test.queueSize(); + + dijkstra_test.start(); + dijkstra_test.start(t); + dijkstra_test.start(nm); + + l = const_dijkstra_test.dist(t); + e = const_dijkstra_test.predArc(t); + s = const_dijkstra_test.predNode(t); + b = const_dijkstra_test.reached(t); + b = const_dijkstra_test.processed(t); + d = const_dijkstra_test.distMap(); + p = const_dijkstra_test.predMap(); + pp = const_dijkstra_test.path(t); + l = const_dijkstra_test.currentDist(t); + } + { + DType + ::SetPredMap > + ::SetDistMap > + ::SetStandardProcessedMap + ::SetProcessedMap > + ::SetOperationTraits > + ::SetHeap > > + ::SetStandardHeap > > + ::SetHeap >, + concepts::ReadWriteMap > + ::Create dijkstra_test(G,length); + + LengthMap length_map; + concepts::ReadWriteMap pred_map; + concepts::ReadWriteMap dist_map; + concepts::WriteMap processed_map; + concepts::ReadWriteMap heap_cross_ref; + BinHeap > heap(heap_cross_ref); + + dijkstra_test + .lengthMap(length_map) + .predMap(pred_map) + .distMap(dist_map) + .processedMap(processed_map) + .heap(heap, heap_cross_ref); + + dijkstra_test.run(s); + dijkstra_test.run(s,t); + + dijkstra_test.addSource(s); + dijkstra_test.addSource(s, 1); + n = dijkstra_test.processNextNode(); + n = dijkstra_test.nextNode(); + b = dijkstra_test.emptyQueue(); + i = dijkstra_test.queueSize(); + + dijkstra_test.start(); + dijkstra_test.start(t); + dijkstra_test.start(nm); + l = dijkstra_test.dist(t); e = dijkstra_test.predArc(t); s = dijkstra_test.predNode(t); b = dijkstra_test.reached(t); - d = dijkstra_test.distMap(); - p = dijkstra_test.predMap(); + b = dijkstra_test.processed(t); pp = dijkstra_test.path(t); - } - { - DType - ::SetPredMap > - ::SetDistMap > - ::SetProcessedMap > - ::SetStandardProcessedMap - ::SetOperationTraits > - ::SetHeap > > - ::SetStandardHeap > > - ::Create dijkstra_test(G,length); - - dijkstra_test.run(s); - dijkstra_test.run(s,t); - - l = dijkstra_test.dist(t); - e = dijkstra_test.predArc(t); - s = dijkstra_test.predNode(t); - b = dijkstra_test.reached(t); - pp = dijkstra_test.path(t); + l = dijkstra_test.currentDist(t); } } diff --git a/test/preflow_test.cc b/test/preflow_test.cc --- a/test/preflow_test.cc +++ b/test/preflow_test.cc @@ -84,18 +84,22 @@ CapMap cap; FlowMap flow; CutMap cut; + VType v; + bool b; - Preflow - ::SetFlowMap - ::SetElevator - ::SetStandardElevator - ::Create preflow_test(g,cap,n,n); + typedef Preflow + ::SetFlowMap + ::SetElevator + ::SetStandardElevator + ::Create PreflowType; + PreflowType preflow_test(g, cap, n, n); + const PreflowType& const_preflow_test = preflow_test; - preflow_test.capacityMap(cap); - flow = preflow_test.flowMap(); - preflow_test.flowMap(flow); - preflow_test.source(n); - preflow_test.target(n); + preflow_test + .capacityMap(cap) + .flowMap(flow) + .source(n) + .target(n); preflow_test.init(); preflow_test.init(cap); @@ -104,11 +108,13 @@ preflow_test.run(); preflow_test.runMinCut(); - preflow_test.flowValue(); - preflow_test.minCut(n); - preflow_test.minCutMap(cut); - preflow_test.flow(e); - + v = const_preflow_test.flowValue(); + v = const_preflow_test.flow(e); + const FlowMap& fm = const_preflow_test.flowMap(); + b = const_preflow_test.minCut(n); + const_preflow_test.minCutMap(cut); + + ignore_unused_variable_warning(fm); } int cutValue (const SmartDigraph& g,