Changeset 2386:81b47fc5c444 in lemon-0.x for test/bipartite_matching_test.cc
- Timestamp:
- 03/02/07 19:04:28 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3217
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/bipartite_matching_test.cc
r2137 r2386 20 20 BPUGRAPH_TYPEDEFS(Graph); 21 21 22 const int n= 10;23 const int m= 10;24 const int e= 52;25 const int c= 100;26 27 const int sa[ e] = { 6, 5, 6, 4, 1, 0, 9, 5, 2, 4, 4, 3, 5,22 const int N = 10; 23 const int M = 10; 24 const int E = 52; 25 const int C = 100; 26 27 const int sa[E] = { 6, 5, 6, 4, 1, 0, 9, 5, 2, 4, 4, 3, 5, 28 28 2, 3, 8, 3, 4, 9, 6, 9, 4, 3, 1, 5, 8, 29 29 4, 8, 9, 2, 2, 3, 0, 5, 2, 3, 6, 3, 8, 30 30 8, 4, 0, 9, 9, 6, 2, 1, 2, 7, 1, 9, 4}; 31 31 32 const int ta[ e] = { 2, 7, 4, 8, 6, 3, 4, 1, 7, 7, 0, 1, 6,32 const int ta[E] = { 2, 7, 4, 8, 6, 3, 4, 1, 7, 7, 0, 1, 6, 33 33 3, 2, 6, 8, 3, 5, 6, 3, 1, 8, 7, 2, 0, 34 34 6, 9, 6, 7, 8, 3, 3, 4, 5, 8, 6, 4, 1, 35 35 4, 3, 3, 8, 7, 7, 3, 7, 7, 3, 5, 1, 6}; 36 36 37 const int wa[ e] = { 3, 99, 85, 16, 79, 52, 83, 99, 62, 6, 42, 6, 95,37 const int wa[E] = { 3, 99, 85, 16, 79, 52, 83, 99, 62, 6, 42, 6, 95, 38 38 13, 34, 9, 5, 38, 39, 75, 99, 12, 73, 35, 93, 43, 39 39 54, 91, 45, 26, 77, 47, 11, 22, 50, 74, 37, 64, 91, … … 53 53 int min_cost_matching; 54 54 55 for (int i = 0; i < n; ++i) {55 for (int i = 0; i < N; ++i) { 56 56 Node node = graph.addANode(); 57 57 aNodes.push_back(node); 58 58 } 59 for (int i = 0; i < m; ++i) {59 for (int i = 0; i < M; ++i) { 60 60 Node node = graph.addBNode(); 61 61 bNodes.push_back(node); 62 62 } 63 for (int i = 0; i < e; ++i) {63 for (int i = 0; i < E; ++i) { 64 64 Node aNode = aNodes[sa[i]]; 65 65 Node bNode = bNodes[ta[i]]; … … 289 289 290 290 Graph::UEdgeMap<int> cost(graph); 291 cost = subMap(constMap<UEdge>( c), weight);291 cost = subMap(constMap<UEdge>(C), weight); 292 292 { 293 293 … … 304 304 min_cost_matching = bpmatch.matchingCost(); 305 305 check(max_cardinality == bpmatch.matchingSize(), "WRONG SIZE"); 306 check(max_cardinality * c- max_cardinality_max_weight306 check(max_cardinality * C - max_cardinality_max_weight 307 307 == bpmatch.matchingCost(), "WRONG SIZE"); 308 308 … … 327 327 min_cost_matching = bpmatch.matchingCost(); 328 328 check(max_cardinality == bpmatch.matchingSize(), "WRONG SIZE"); 329 check(max_cardinality * c- max_cardinality_max_weight329 check(max_cardinality * C - max_cardinality_max_weight 330 330 == bpmatch.matchingCost(), "WRONG SIZE"); 331 331
Note: See TracChangeset
for help on using the changeset viewer.