Changeset 2386:81b47fc5c444 in lemon0.x for lemon/bipartite_matching.h
 Timestamp:
 03/02/07 19:04:28 (16 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@3217
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/bipartite_matching.h
r2352 r2386 116 116 /// It initalizes the data structures with an initial matching. 117 117 template <typename MatchingMap> 118 void matchingInit(const MatchingMap& m atching) {118 void matchingInit(const MatchingMap& mm) { 119 119 for (ANodeIt it(*graph); it != INVALID; ++it) { 120 120 anode_matching[it] = INVALID; … … 125 125 matching_size = 0; 126 126 for (UEdgeIt it(*graph); it != INVALID; ++it) { 127 if (m atching[it]) {127 if (mm[it]) { 128 128 ++matching_size; 129 129 anode_matching[graph>aNode(it)] = it; … … 138 138 /// \return %True when the given map contains really a matching. 139 139 template <typename MatchingMap> 140 void checkedMatchingInit(const MatchingMap& m atching) {140 void checkedMatchingInit(const MatchingMap& mm) { 141 141 for (ANodeIt it(*graph); it != INVALID; ++it) { 142 142 anode_matching[it] = INVALID; … … 147 147 matching_size = 0; 148 148 for (UEdgeIt it(*graph); it != INVALID; ++it) { 149 if (m atching[it]) {149 if (mm[it]) { 150 150 ++matching_size; 151 151 if (anode_matching[graph>aNode(it)] != INVALID) { … … 188 188 while (!success && !queue.empty()) { 189 189 std::vector<Node> newqueue; 190 for (int i = 0; i < (int)queue.size(); ++i) {190 for (int i = 0; i < int(queue.size()); ++i) { 191 191 Node anode = queue[i]; 192 192 for (IncEdgeIt jt(*graph, anode); jt != INVALID; ++jt) { … … 214 214 typename Graph::template ANodeMap<bool> aused(*graph, false); 215 215 216 for (int i = 0; i < (int)bqueue.size(); ++i) {216 for (int i = 0; i < int(bqueue.size()); ++i) { 217 217 Node bnode = bqueue[i]; 218 218 … … 280 280 while (!queue.empty()) { 281 281 std::vector<Node> newqueue; 282 for (int i = 0; i < (int)queue.size(); ++i) {282 for (int i = 0; i < int(queue.size()); ++i) { 283 283 Node anode = queue[i]; 284 284 for (IncEdgeIt jt(*graph, anode); jt != INVALID; ++jt) { … … 364 364 while (!queue.empty()) { 365 365 std::vector<Node> newqueue; 366 for (int i = 0; i < (int)queue.size(); ++i) {366 for (int i = 0; i < int(queue.size()); ++i) { 367 367 Node anode = queue[i]; 368 368 for (IncEdgeIt jt(*graph, anode); jt != INVALID; ++jt) { … … 404 404 /// \return The number of the matching edges. 405 405 template <typename MatchingMap> 406 int quickMatching(MatchingMap& m atching) const {406 int quickMatching(MatchingMap& mm) const { 407 407 for (ANodeIt it(*graph); it != INVALID; ++it) { 408 408 if (anode_matching[it] != INVALID) { 409 m atching[anode_matching[it]] = true;409 mm[anode_matching[it]] = true; 410 410 } 411 411 } … … 418 418 /// \return The number of the matching edges. 419 419 template <typename MatchingMap> 420 int matching(MatchingMap& m atching) const {420 int matching(MatchingMap& mm) const { 421 421 for (UEdgeIt it(*graph); it != INVALID; ++it) { 422 m atching[it] = it == anode_matching[graph>aNode(it)];422 mm[it] = it == anode_matching[graph>aNode(it)]; 423 423 } 424 424 return matching_size; … … 684 684 /// automatically allocated map, of course. 685 685 /// \return \c (*this) 686 MaxWeightedBipartiteMatching& heap(Heap& h eap, HeapCrossRef &crossRef) {686 MaxWeightedBipartiteMatching& heap(Heap& hp, HeapCrossRef &cr) { 687 687 if(local_heap_cross_ref) { 688 688 delete _heap_cross_ref; 689 689 local_heap_cross_ref = false; 690 690 } 691 _heap_cross_ref = &cr ossRef;691 _heap_cross_ref = &cr; 692 692 if(local_heap) { 693 693 delete _heap; 694 694 local_heap = false; 695 695 } 696 _heap = &h eap;696 _heap = &hp; 697 697 return *this; 698 698 } … … 890 890 /// for each edges. 891 891 template <typename PotentialMap> 892 void potential(PotentialMap& p otential) const {893 for (ANodeIt it(*graph); it != INVALID; ++it) { 894 p otential[it] = anode_potential[it];892 void potential(PotentialMap& pt) const { 893 for (ANodeIt it(*graph); it != INVALID; ++it) { 894 pt[it] = anode_potential[it]; 895 895 } 896 896 for (BNodeIt it(*graph); it != INVALID; ++it) { 897 p otential[it] = bnode_potential[it];897 pt[it] = bnode_potential[it]; 898 898 } 899 899 } … … 905 905 /// \return The number of the matching edges. 906 906 template <typename MatchingMap> 907 int quickMatching(MatchingMap& m atching) const {907 int quickMatching(MatchingMap& mm) const { 908 908 for (ANodeIt it(*graph); it != INVALID; ++it) { 909 909 if (anode_matching[it] != INVALID) { 910 m atching[anode_matching[it]] = true;910 mm[anode_matching[it]] = true; 911 911 } 912 912 } … … 919 919 /// \return The number of the matching edges. 920 920 template <typename MatchingMap> 921 int matching(MatchingMap& m atching) const {921 int matching(MatchingMap& mm) const { 922 922 for (UEdgeIt it(*graph); it != INVALID; ++it) { 923 m atching[it] = it == anode_matching[graph>aNode(it)];923 mm[it] = it == anode_matching[graph>aNode(it)]; 924 924 } 925 925 return matching_size; … … 1255 1255 /// automatically allocated map, of course. 1256 1256 /// \return \c (*this) 1257 MinCostMaxBipartiteMatching& heap(Heap& h eap, HeapCrossRef &crossRef) {1257 MinCostMaxBipartiteMatching& heap(Heap& hp, HeapCrossRef &cr) { 1258 1258 if(local_heap_cross_ref) { 1259 1259 delete _heap_cross_ref; 1260 1260 local_heap_cross_ref = false; 1261 1261 } 1262 _heap_cross_ref = &cr ossRef;1262 _heap_cross_ref = &cr; 1263 1263 if(local_heap) { 1264 1264 delete _heap; 1265 1265 local_heap = false; 1266 1266 } 1267 _heap = &h eap;1267 _heap = &hp; 1268 1268 return *this; 1269 1269 } … … 1443 1443 /// for each edges. 1444 1444 template <typename PotentialMap> 1445 void potential(PotentialMap& p otential) const {1446 for (ANodeIt it(*graph); it != INVALID; ++it) { 1447 p otential[it] = anode_potential[it];1445 void potential(PotentialMap& pt) const { 1446 for (ANodeIt it(*graph); it != INVALID; ++it) { 1447 pt[it] = anode_potential[it]; 1448 1448 } 1449 1449 for (BNodeIt it(*graph); it != INVALID; ++it) { 1450 p otential[it] = bnode_potential[it];1450 pt[it] = bnode_potential[it]; 1451 1451 } 1452 1452 } … … 1458 1458 /// \return The number of the matching edges. 1459 1459 template <typename MatchingMap> 1460 int quickMatching(MatchingMap& m atching) const {1460 int quickMatching(MatchingMap& mm) const { 1461 1461 for (ANodeIt it(*graph); it != INVALID; ++it) { 1462 1462 if (anode_matching[it] != INVALID) { 1463 m atching[anode_matching[it]] = true;1463 mm[anode_matching[it]] = true; 1464 1464 } 1465 1465 } … … 1472 1472 /// \return The number of the matching edges. 1473 1473 template <typename MatchingMap> 1474 int matching(MatchingMap& m atching) const {1474 int matching(MatchingMap& mm) const { 1475 1475 for (UEdgeIt it(*graph); it != INVALID; ++it) { 1476 m atching[it] = it == anode_matching[graph>aNode(it)];1476 mm[it] = it == anode_matching[graph>aNode(it)]; 1477 1477 } 1478 1478 return matching_size;
Note: See TracChangeset
for help on using the changeset viewer.