Changeset 880:b89e46862dc2 in lemonmain for test/bellman_ford_test.cc
 Timestamp:
 03/18/10 14:17:03 (14 years ago)
 Branch:
 default
 Parents:
 879:38213abd2911 (diff), 878:d6052a9c4e8d (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/bellman_ford_test.cc
r878 r880 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 200320 095 * Copyright (C) 20032010 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 98 98 pp = const_bf_test.path(t); 99 99 pp = const_bf_test.negativeCycle(); 100 100 101 101 for (BF::ActiveIt it(const_bf_test); it != INVALID; ++it) {} 102 102 } … … 110 110 concepts::ReadWriteMap<Node,Arc> pred_map; 111 111 concepts::ReadWriteMap<Node,Value> dist_map; 112 112 113 113 bf_test 114 114 .lengthMap(length_map) … … 189 189 check(pathSource(gr, p) == s, "path() found a wrong path."); 190 190 check(pathTarget(gr, p) == t, "path() found a wrong path."); 191 191 192 192 ListPath<Digraph> path; 193 193 Value dist; … … 228 228 SmartDigraph gr; 229 229 IntArcMap length(gr); 230 230 231 231 Node n1 = gr.addNode(); 232 232 Node n2 = gr.addNode(); 233 233 Node n3 = gr.addNode(); 234 234 Node n4 = gr.addNode(); 235 235 236 236 Arc a1 = gr.addArc(n1, n2); 237 237 Arc a2 = gr.addArc(n2, n2); 238 238 239 239 length[a1] = 2; 240 240 length[a2] = 1; 241 241 242 242 { 243 243 BellmanFord<SmartDigraph, IntArcMap> bf(gr, length); … … 247 247 "Wrong negative cycle."); 248 248 } 249 249 250 250 length[a2] = 0; 251 251 252 252 { 253 253 BellmanFord<SmartDigraph, IntArcMap> bf(gr, length); … … 256 256 "Negative cycle should not be found."); 257 257 } 258 258 259 259 length[gr.addArc(n1, n3)] = 5; 260 260 length[gr.addArc(n4, n3)] = 1; 261 261 length[gr.addArc(n2, n4)] = 2; 262 262 length[gr.addArc(n3, n2)] = 4; 263 263 264 264 { 265 265 BellmanFord<SmartDigraph, IntArcMap> bf(gr, length); 
test/bellman_ford_test.cc
r877 r880 105 105 ::SetDistMap<concepts::ReadWriteMap<Node,Value> > 106 106 ::SetOperationTraits<BellmanFordDefaultOperationTraits<Value> > 107 ::SetOperationTraits<BellmanFordToleranceOperationTraits<Value, 0> >108 107 ::Create bf_test(gr,length); 109 108
Note: See TracChangeset
for help on using the changeset viewer.