Changeset 797:c18ed26f016c in lemon-1.1 for test
- Timestamp:
- 11/28/12 11:42:38 (12 years ago)
- Branch:
- 1.1
- Parents:
- 795:b78a46fe8002 (diff), 796:7e368d9b67f7 (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
- Location:
- test
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
test/bfs_test.cc
r761 r797 62 62 Arc e; 63 63 int l, i; 64 ignore_unused_variable_warning(l,i); 64 65 bool b; 65 66 BType::DistMap d(G); … … 151 152 Digraph g; 152 153 bool b; 154 ignore_unused_variable_warning(b); 155 153 156 bfs(g).run(Node()); 154 157 b=bfs(g).run(Node(),Node()); -
test/bfs_test.cc
r796 r797 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 85 85 b = const_bfs_test.emptyQueue(); 86 86 i = const_bfs_test.queueSize(); 87 87 88 88 bfs_test.start(); 89 89 bfs_test.start(t); … … 106 106 ::SetProcessedMap<concepts::WriteMap<Node,bool> > 107 107 ::Create bfs_test(G); 108 108 109 109 concepts::ReadWriteMap<Node,Arc> pred_map; 110 110 concepts::ReadWriteMap<Node,int> dist_map; 111 111 concepts::ReadWriteMap<Node,bool> reached_map; 112 112 concepts::WriteMap<Node,bool> processed_map; 113 113 114 114 bfs_test 115 115 .predMap(pred_map) … … 121 121 bfs_test.run(s,t); 122 122 bfs_test.run(); 123 123 124 124 bfs_test.init(); 125 125 bfs_test.addSource(s); … … 130 130 b = bfs_test.emptyQueue(); 131 131 i = bfs_test.queueSize(); 132 132 133 133 bfs_test.start(); 134 134 bfs_test.start(t); -
test/circulation_test.cc
r761 r797 74 74 VType v; 75 75 bool b; 76 ignore_unused_variable_warning(v,b); 76 77 77 78 typedef Circulation<Digraph, CapMap, CapMap, SupplyMap> -
test/circulation_test.cc
r796 r797 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 83 83 CirculationType circ_test(g, lcap, ucap, supply); 84 84 const CirculationType& const_circ_test = circ_test; 85 85 86 86 circ_test 87 87 .lowerMap(lcap) … … 99 99 b = const_circ_test.barrier(n); 100 100 const_circ_test.barrierMap(bar); 101 101 102 102 ignore_unused_variable_warning(fm); 103 103 } -
test/dfs_test.cc
r761 r797 68 68 int l, i; 69 69 bool b; 70 ignore_unused_variable_warning(l,i,b); 71 70 72 DType::DistMap d(G); 71 73 DType::PredMap p(G); … … 152 154 Digraph g; 153 155 bool b; 156 ignore_unused_variable_warning(b); 157 154 158 dfs(g).run(Node()); 155 159 b=dfs(g).run(Node(),Node()); -
test/dfs_test.cc
r796 r797 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 89 89 b = const_dfs_test.emptyQueue(); 90 90 i = const_dfs_test.queueSize(); 91 91 92 92 dfs_test.start(); 93 93 dfs_test.start(t); … … 115 115 concepts::ReadWriteMap<Node,bool> reached_map; 116 116 concepts::WriteMap<Node,bool> processed_map; 117 117 118 118 dfs_test 119 119 .predMap(pred_map) … … 132 132 b = dfs_test.emptyQueue(); 133 133 i = dfs_test.queueSize(); 134 134 135 135 dfs_test.start(); 136 136 dfs_test.start(t); … … 224 224 check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6."); 225 225 } 226 226 227 227 { 228 228 NullMap<Node,Arc> myPredMap; -
test/dijkstra_test.cc
r761 r797 66 66 int i; 67 67 bool b; 68 ignore_unused_variable_warning(l,i,b); 69 68 70 DType::DistMap d(G); 69 71 DType::PredMap p(G); … … 163 165 Digraph g; 164 166 bool b; 167 ignore_unused_variable_warning(b); 168 165 169 dijkstra(g,LengthMap()).run(Node()); 166 170 b=dijkstra(g,LengthMap()).run(Node(),Node()); -
test/dijkstra_test.cc
r796 r797 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 88 88 b = const_dijkstra_test.emptyQueue(); 89 89 i = const_dijkstra_test.queueSize(); 90 90 91 91 dijkstra_test.start(); 92 92 dijkstra_test.start(t); … … 112 112 ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > > 113 113 ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > > 114 ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >, 114 ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >, 115 115 concepts::ReadWriteMap<Node,int> > 116 116 ::Create dijkstra_test(G,length); … … 122 122 concepts::ReadWriteMap<Node,int> heap_cross_ref; 123 123 BinHeap<VType, concepts::ReadWriteMap<Node,int> > heap(heap_cross_ref); 124 124 125 125 dijkstra_test 126 126 .lengthMap(length_map) … … 139 139 b = dijkstra_test.emptyQueue(); 140 140 i = dijkstra_test.queueSize(); 141 141 142 142 dijkstra_test.start(); 143 143 dijkstra_test.start(t); -
test/gomory_hu_test.cc
r761 r797 69 69 Value v; 70 70 int d; 71 ignore_unused_variable_warning(v,d); 71 72 72 73 GomoryHu<Graph, CapMap> gh_test(g, cap); -
test/gomory_hu_test.cc
r796 r797 1 /* -*- mode: C++; indent-tabs-mode: nil; -*- 2 * 3 * This file is a part of LEMON, a generic C++ optimization library. 4 * 5 * Copyright (C) 2003-2011 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). 8 * 9 * Permission to use, modify and distribute this software is granted 10 * provided that this copyright notice appears in all copies. For 11 * precise terms see the accompanying LICENSE file. 12 * 13 * This software is provided "AS IS" with no warranty of any kind, 14 * express or implied, and with no claim as to its suitability for any 15 * purpose. 16 * 17 */ 18 1 19 #include <iostream> 2 20 … … 34 52 "source 0\n" 35 53 "target 3\n"; 36 54 37 55 void checkGomoryHuCompile() 38 56 { … … 71 89 72 90 int cutValue(const Graph& graph, const BoolNodeMap& cut, 73 91 const IntEdgeMap& capacity) { 74 92 75 93 int sum = 0; … … 109 127 int sum=0; 110 128 for(GomoryHu<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a) 111 sum+=capacity[a]; 129 sum+=capacity[a]; 112 130 check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt"); 113 131 … … 120 138 } 121 139 } 122 140 123 141 return 0; 124 142 } -
test/hao_orlin_test.cc
r761 r797 67 67 CutMap cut; 68 68 Value v; 69 ignore_unused_variable_warning(v); 69 70 70 71 HaoOrlin<Digraph, CapMap> ho_test(g, cap); -
test/hao_orlin_test.cc
r796 r797 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 85 85 86 86 template <typename Graph, typename CapMap, typename CutMap> 87 typename CapMap::Value 87 typename CapMap::Value 88 88 cutValue(const Graph& graph, const CapMap& cap, const CutMap& cut) 89 89 { … … 112 112 ho.run(); 113 113 ho.minCutMap(cut); 114 114 115 115 check(ho.minCutValue() == 1, "Wrong cut value"); 116 116 check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value"); … … 128 128 ho.run(); 129 129 ho.minCutMap(cut); 130 130 131 131 check(ho.minCutValue() == 1, "Wrong cut value"); 132 132 check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value"); 133 133 } 134 134 135 135 typedef Undirector<SmartDigraph> UGraph; 136 136 UGraph ugraph(graph); 137 137 138 138 { 139 139 HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap1); 140 140 ho.run(); 141 141 ho.minCutMap(cut); 142 142 143 143 check(ho.minCutValue() == 2, "Wrong cut value"); 144 144 check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value"); … … 148 148 ho.run(); 149 149 ho.minCutMap(cut); 150 150 151 151 check(ho.minCutValue() == 5, "Wrong cut value"); 152 152 check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value"); … … 156 156 ho.run(); 157 157 ho.minCutMap(cut); 158 158 159 159 check(ho.minCutValue() == 5, "Wrong cut value"); 160 160 check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value"); -
test/matching_test.cc
r761 r797 146 146 MaxMatching<Graph>::Status stat = 147 147 const_mat_test.status(n); 148 ignore_unused_variable_warning(stat); 148 149 const MaxMatching<Graph>::StatusMap& smap = 149 150 const_mat_test.statusMap(); -
test/matching_test.cc
r796 r797 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 135 135 mat_test.startDense(); 136 136 mat_test.run(); 137 137 138 138 const_mat_test.matchingSize(); 139 139 const_mat_test.matching(e); … … 144 144 const_mat_test.mate(n); 145 145 146 MaxMatching<Graph>::Status stat = 146 MaxMatching<Graph>::Status stat = 147 147 const_mat_test.status(n); 148 148 ignore_unused_variable_warning(stat); … … 172 172 mat_test.start(); 173 173 mat_test.run(); 174 174 175 175 const_mat_test.matchingWeight(); 176 176 const_mat_test.matchingSize(); … … 181 181 e = mmap[n]; 182 182 const_mat_test.mate(n); 183 183 184 184 int k = 0; 185 185 const_mat_test.dualValue(); … … 209 209 mat_test.start(); 210 210 mat_test.run(); 211 211 212 212 const_mat_test.matchingWeight(); 213 213 const_mat_test.matching(e); … … 217 217 e = mmap[n]; 218 218 const_mat_test.mate(n); 219 219 220 220 int k = 0; 221 221 const_mat_test.dualValue(); -
test/min_cost_arborescence_test.cc
r761 r797 92 92 VType c; 93 93 bool b; 94 ignore_unused_variable_warning(c,b); 94 95 int i; 95 96 CostMap cost; -
test/min_cost_arborescence_test.cc
r796 r797 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-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 112 112 b = const_mcarb_test.emptyQueue(); 113 113 i = const_mcarb_test.queueSize(); 114 114 115 115 c = const_mcarb_test.arborescenceCost(); 116 116 b = const_mcarb_test.arborescence(e); … … 122 122 b = const_mcarb_test.reached(n); 123 123 b = const_mcarb_test.processed(n); 124 124 125 125 i = const_mcarb_test.dualNum(); 126 126 c = const_mcarb_test.dualValue(); 127 127 i = const_mcarb_test.dualSize(i); 128 128 c = const_mcarb_test.dualValue(i); 129 129 130 130 ignore_unused_variable_warning(am); 131 131 ignore_unused_variable_warning(pm); -
test/preflow_test.cc
r761 r797 87 87 VType v; 88 88 bool b; 89 ignore_unused_variable_warning(v,b); 89 90 90 91 typedef Preflow<Digraph, CapMap> -
test/preflow_test.cc
r796 r797 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 115 115 b = const_preflow_test.minCut(n); 116 116 const_preflow_test.minCutMap(cut); 117 117 118 118 ignore_unused_variable_warning(fm); 119 119 } … … 156 156 { 157 157 DIGRAPH_TYPEDEFS(SmartDigraph); 158 158 159 159 SmartDigraph g; 160 160 SmartDigraph::ArcMap<int> cap(g),iflow(g); … … 268 268 269 269 initFlowTest(); 270 270 271 271 return 0; 272 272 } -
test/suurballe_test.cc
r761 r797 108 108 int f; 109 109 VType c; 110 ignore_unused_variable_warning(f,c); 111 110 112 c = const_suurb_test.totalLength(); 111 113 f = const_suurb_test.flow(e); -
test/suurballe_test.cc
r796 r797 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 81 81 typedef Digraph::Arc Arc; 82 82 typedef concepts::ReadMap<Arc, VType> LengthMap; 83 83 84 84 typedef Suurballe<Digraph, LengthMap> SuurballeType; 85 85 … … 105 105 k = suurb_test.findFlow(n, k); 106 106 suurb_test.findPaths(); 107 107 108 108 int f; 109 109 VType c; … … 119 119 k = const_suurb_test.pathNum(); 120 120 Path<Digraph> p = const_suurb_test.path(k); 121 121 122 122 ignore_unused_variable_warning(fm); 123 123 ignore_unused_variable_warning(pm);
Note: See TracChangeset
for help on using the changeset viewer.