Changeset 2571:f5c6e63f51d1 in lemon-0.x for test/bipartite_matching_test.cc
- Timestamp:
- 02/08/08 12:04:37 (16 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3452
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/bipartite_matching_test.cc
r2553 r2571 39 39 BPUGRAPH_TYPEDEFS(Graph); 40 40 41 const int N = 10;42 const int M = 10;43 const int E = 52;44 const int C = 100;45 46 const int sa[E ] = { 6, 5, 6, 4, 1, 0, 9, 5, 2, 4, 4, 3, 5,41 const int NN = 10; 42 const int MM = 10; 43 const int EE = 52; 44 const int CC = 100; 45 46 const int sa[EE] = { 6, 5, 6, 4, 1, 0, 9, 5, 2, 4, 4, 3, 5, 47 47 2, 3, 8, 3, 4, 9, 6, 9, 4, 3, 1, 5, 8, 48 48 4, 8, 9, 2, 2, 3, 0, 5, 2, 3, 6, 3, 8, 49 49 8, 4, 0, 9, 9, 6, 2, 1, 2, 7, 1, 9, 4}; 50 50 51 const int ta[E ] = { 2, 7, 4, 8, 6, 3, 4, 1, 7, 7, 0, 1, 6,51 const int ta[EE] = { 2, 7, 4, 8, 6, 3, 4, 1, 7, 7, 0, 1, 6, 52 52 3, 2, 6, 8, 3, 5, 6, 3, 1, 8, 7, 2, 0, 53 53 6, 9, 6, 7, 8, 3, 3, 4, 5, 8, 6, 4, 1, 54 54 4, 3, 3, 8, 7, 7, 3, 7, 7, 3, 5, 1, 6}; 55 55 56 const int wa[E ] = { 3, 99, 85, 16, 79, 52, 83, 99, 62, 6, 42, 6, 95,56 const int wa[EE] = { 3, 99, 85, 16, 79, 52, 83, 99, 62, 6, 42, 6, 95, 57 57 13, 34, 9, 5, 38, 39, 75, 99, 12, 73, 35, 93, 43, 58 58 54, 91, 45, 26, 77, 47, 11, 22, 50, 74, 37, 64, 91, … … 72 72 int min_cost_matching; 73 73 74 for (int i = 0; i < N ; ++i) {74 for (int i = 0; i < NN; ++i) { 75 75 Node node = graph.addANode(); 76 76 aNodes.push_back(node); 77 77 } 78 for (int i = 0; i < M ; ++i) {78 for (int i = 0; i < MM; ++i) { 79 79 Node node = graph.addBNode(); 80 80 bNodes.push_back(node); 81 81 } 82 for (int i = 0; i < E ; ++i) {82 for (int i = 0; i < EE; ++i) { 83 83 Node aNode = aNodes[sa[i]]; 84 84 Node bNode = bNodes[ta[i]]; … … 349 349 350 350 Graph::UEdgeMap<int> cost(graph); 351 cost = subMap(constMap<UEdge>(C ), weight);351 cost = subMap(constMap<UEdge>(CC), weight); 352 352 { 353 353 … … 364 364 min_cost_matching = bpmatch.matchingCost(); 365 365 check(max_cardinality == bpmatch.matchingSize(), "WRONG SIZE"); 366 check(max_cardinality * C - max_cardinality_max_weight366 check(max_cardinality * CC - max_cardinality_max_weight 367 367 == bpmatch.matchingCost(), "WRONG SIZE"); 368 368 … … 387 387 min_cost_matching = bpmatch.matchingCost(); 388 388 check(max_cardinality == bpmatch.matchingSize(), "WRONG SIZE"); 389 check(max_cardinality * C - max_cardinality_max_weight389 check(max_cardinality * CC - max_cardinality_max_weight 390 390 == bpmatch.matchingCost(), "WRONG SIZE"); 391 391
Note: See TracChangeset
for help on using the changeset viewer.