Changes in / [1104:a78e5b779b69:1101:15e233f588da] in lemon-main
- Location:
- lemon
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/capacity_scaling.h
r1104 r1092 164 164 165 165 // Parameters of the problem 166 bool _ha s_lower;166 bool _have_lower; 167 167 Value _sum_supply; 168 168 … … 357 357 template <typename LowerMap> 358 358 CapacityScaling& lowerMap(const LowerMap& map) { 359 _ha s_lower = true;359 _have_lower = true; 360 360 for (ArcIt a(_graph); a != INVALID; ++a) { 361 361 _lower[_arc_idf[a]] = map[a]; 362 _lower[_arc_idb[a]] = map[a]; 362 363 } 363 364 return *this; … … 543 544 _cost[j] = _forward[j] ? 1 : -1; 544 545 } 545 _ha s_lower = false;546 _have_lower = false; 546 547 return *this; 547 548 } … … 754 755 const Value MAX = std::numeric_limits<Value>::max(); 755 756 int last_out; 756 if (_ha s_lower) {757 if (_have_lower) { 757 758 for (int i = 0; i != _root; ++i) { 758 759 last_out = _first_out[i+1]; … … 839 840 } 840 841 841 // Check if the upper bound is greater thanor equal to the lower bound842 // on each forwardarc.842 // Check if the upper bound is greater or equal to the lower bound 843 // on each arc. 843 844 bool checkBoundMaps() { 844 845 for (int j = 0; j != _res_arc_num; ++j) { 845 if (_ forward[j] && _upper[j] < _lower[j]) return false;846 if (_upper[j] < _lower[j]) return false; 846 847 } 847 848 return true; … … 857 858 858 859 // Handle non-zero lower bounds 859 if (_ha s_lower) {860 if (_have_lower) { 860 861 int limit = _first_out[_root]; 861 862 for (int j = 0; j != limit; ++j) { 862 if ( _forward[j]) _res_cap[_reverse[j]] += _lower[j];863 if (!_forward[j]) _res_cap[j] += _lower[j]; 863 864 } 864 865 } -
lemon/cost_scaling.h
r1104 r1093 257 257 258 258 // Parameters of the problem 259 bool _ha s_lower;259 bool _have_lower; 260 260 Value _sum_supply; 261 261 int _sup_node_num; … … 373 373 template <typename LowerMap> 374 374 CostScaling& lowerMap(const LowerMap& map) { 375 _ha s_lower = true;375 _have_lower = true; 376 376 for (ArcIt a(_graph); a != INVALID; ++a) { 377 377 _lower[_arc_idf[a]] = map[a]; 378 _lower[_arc_idb[a]] = map[a]; 378 379 } 379 380 return *this; … … 568 569 _scost[_reverse[j]] = 0; 569 570 } 570 _ha s_lower = false;571 _have_lower = false; 571 572 return *this; 572 573 } … … 780 781 const Value MAX = std::numeric_limits<Value>::max(); 781 782 int last_out; 782 if (_ha s_lower) {783 if (_have_lower) { 783 784 for (int i = 0; i != _root; ++i) { 784 785 last_out = _first_out[i+1]; … … 837 838 sup[n] = _supply[_node_id[n]]; 838 839 } 839 if (_ha s_lower) {840 if (_have_lower) { 840 841 for (ArcIt a(_graph); a != INVALID; ++a) { 841 842 int j = _arc_idf[a]; … … 907 908 } 908 909 909 // Check if the upper bound is greater thanor equal to the lower bound910 // on each forwardarc.910 // Check if the upper bound is greater or equal to the lower bound 911 // on each arc. 911 912 bool checkBoundMaps() { 912 913 for (int j = 0; j != _res_arc_num; ++j) { 913 if (_ forward[j] && _upper[j] < _lower[j]) return false;914 if (_upper[j] < _lower[j]) return false; 914 915 } 915 916 return true; … … 991 992 992 993 // Handle non-zero lower bounds 993 if (_ha s_lower) {994 if (_have_lower) { 994 995 int limit = _first_out[_root]; 995 996 for (int j = 0; j != limit; ++j) { 996 if ( _forward[j]) _res_cap[_reverse[j]] += _lower[j];997 if (!_forward[j]) _res_cap[j] += _lower[j]; 997 998 } 998 999 } -
lemon/cycle_canceling.h
r1104 r1092 196 196 197 197 // Parameters of the problem 198 bool _ha s_lower;198 bool _have_lower; 199 199 Value _sum_supply; 200 200 … … 279 279 template <typename LowerMap> 280 280 CycleCanceling& lowerMap(const LowerMap& map) { 281 _ha s_lower = true;281 _have_lower = true; 282 282 for (ArcIt a(_graph); a != INVALID; ++a) { 283 283 _lower[_arc_idf[a]] = map[a]; 284 _lower[_arc_idb[a]] = map[a]; 284 285 } 285 286 return *this; … … 471 472 _cost[_reverse[j]] = 0; 472 473 } 473 _ha s_lower = false;474 _have_lower = false; 474 475 return *this; 475 476 } … … 684 685 const Value MAX = std::numeric_limits<Value>::max(); 685 686 int last_out; 686 if (_ha s_lower) {687 if (_have_lower) { 687 688 for (int i = 0; i != _root; ++i) { 688 689 last_out = _first_out[i+1]; … … 727 728 sup[n] = _supply[_node_id[n]]; 728 729 } 729 if (_ha s_lower) {730 if (_have_lower) { 730 731 for (ArcIt a(_graph); a != INVALID; ++a) { 731 732 int j = _arc_idf[a]; … … 784 785 } 785 786 786 // Check if the upper bound is greater thanor equal to the lower bound787 // on each forwardarc.787 // Check if the upper bound is greater or equal to the lower bound 788 // on each arc. 788 789 bool checkBoundMaps() { 789 790 for (int j = 0; j != _res_arc_num; ++j) { 790 if (_ forward[j] && _upper[j] < _lower[j]) return false;791 if (_upper[j] < _lower[j]) return false; 791 792 } 792 793 return true; … … 835 836 836 837 // Handle non-zero lower bounds 837 if (_ha s_lower) {838 if (_have_lower) { 838 839 int limit = _first_out[_root]; 839 840 for (int j = 0; j != limit; ++j) { 840 if ( _forward[j]) _res_cap[_reverse[j]] += _lower[j];841 if (!_forward[j]) _res_cap[j] += _lower[j]; 841 842 } 842 843 } -
lemon/network_simplex.h
r1104 r1092 199 199 200 200 // Parameters of the problem 201 bool _ha s_lower;201 bool _have_lower; 202 202 SupplyType _stype; 203 203 Value _sum_supply; … … 683 683 template <typename LowerMap> 684 684 NetworkSimplex& lowerMap(const LowerMap& map) { 685 _ha s_lower = true;685 _have_lower = true; 686 686 for (ArcIt a(_graph); a != INVALID; ++a) { 687 687 _lower[_arc_id[a]] = map[a]; … … 880 880 _cost[i] = 1; 881 881 } 882 _ha s_lower = false;882 _have_lower = false; 883 883 _stype = GEQ; 884 884 return *this; … … 1073 1073 1074 1074 // Remove non-zero lower bounds 1075 if (_ha s_lower) {1075 if (_have_lower) { 1076 1076 for (int i = 0; i != _arc_num; ++i) { 1077 1077 Value c = _lower[i]; … … 1236 1236 } 1237 1237 1238 // Check if the upper bound is greater thanor equal to the lower bound1238 // Check if the upper bound is greater or equal to the lower bound 1239 1239 // on each arc. 1240 1240 bool checkBoundMaps() { … … 1613 1613 1614 1614 // Transform the solution and the supply map to the original form 1615 if (_ha s_lower) {1615 if (_have_lower) { 1616 1616 for (int i = 0; i != _arc_num; ++i) { 1617 1617 Value c = _lower[i];
Note: See TracChangeset
for help on using the changeset viewer.