Changes in / [1295:f70d8f5a1a5d:1299:b6bad215bccd] in lemon
- Location:
- lemon
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/capacity_scaling.h
r1270 r1298 164 164 165 165 // Parameters of the problem 166 bool _ha ve_lower;166 bool _has_lower; 167 167 Value _sum_supply; 168 168 … … 357 357 template <typename LowerMap> 358 358 CapacityScaling& lowerMap(const LowerMap& map) { 359 _ha ve_lower = true;359 _has_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];363 362 } 364 363 return *this; … … 544 543 _cost[j] = _forward[j] ? 1 : -1; 545 544 } 546 _ha ve_lower = false;545 _has_lower = false; 547 546 return *this; 548 547 } … … 755 754 const Value MAX = std::numeric_limits<Value>::max(); 756 755 int last_out; 757 if (_ha ve_lower) {756 if (_has_lower) { 758 757 for (int i = 0; i != _root; ++i) { 759 758 last_out = _first_out[i+1]; … … 840 839 } 841 840 842 // Check if the upper bound is greater or equal to the lower bound843 // on each arc.841 // Check if the upper bound is greater than or equal to the lower bound 842 // on each forward arc. 844 843 bool checkBoundMaps() { 845 844 for (int j = 0; j != _res_arc_num; ++j) { 846 if (_ upper[j] < _lower[j]) return false;845 if (_forward[j] && _upper[j] < _lower[j]) return false; 847 846 } 848 847 return true; … … 858 857 859 858 // Handle non-zero lower bounds 860 if (_ha ve_lower) {859 if (_has_lower) { 861 860 int limit = _first_out[_root]; 862 861 for (int j = 0; j != limit; ++j) { 863 if ( !_forward[j]) _res_cap[j] += _lower[j];862 if (_forward[j]) _res_cap[_reverse[j]] += _lower[j]; 864 863 } 865 864 } -
lemon/cost_scaling.h
r1271 r1298 257 257 258 258 // Parameters of the problem 259 bool _ha ve_lower;259 bool _has_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 ve_lower = true;375 _has_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];379 378 } 380 379 return *this; … … 569 568 _scost[_reverse[j]] = 0; 570 569 } 571 _ha ve_lower = false;570 _has_lower = false; 572 571 return *this; 573 572 } … … 781 780 const Value MAX = std::numeric_limits<Value>::max(); 782 781 int last_out; 783 if (_ha ve_lower) {782 if (_has_lower) { 784 783 for (int i = 0; i != _root; ++i) { 785 784 last_out = _first_out[i+1]; … … 838 837 sup[n] = _supply[_node_id[n]]; 839 838 } 840 if (_ha ve_lower) {839 if (_has_lower) { 841 840 for (ArcIt a(_graph); a != INVALID; ++a) { 842 841 int j = _arc_idf[a]; … … 908 907 } 909 908 910 // Check if the upper bound is greater or equal to the lower bound911 // on each arc.909 // Check if the upper bound is greater than or equal to the lower bound 910 // on each forward arc. 912 911 bool checkBoundMaps() { 913 912 for (int j = 0; j != _res_arc_num; ++j) { 914 if (_ upper[j] < _lower[j]) return false;913 if (_forward[j] && _upper[j] < _lower[j]) return false; 915 914 } 916 915 return true; … … 992 991 993 992 // Handle non-zero lower bounds 994 if (_ha ve_lower) {993 if (_has_lower) { 995 994 int limit = _first_out[_root]; 996 995 for (int j = 0; j != limit; ++j) { 997 if ( !_forward[j]) _res_cap[j] += _lower[j];996 if (_forward[j]) _res_cap[_reverse[j]] += _lower[j]; 998 997 } 999 998 } -
lemon/cycle_canceling.h
r1270 r1298 196 196 197 197 // Parameters of the problem 198 bool _ha ve_lower;198 bool _has_lower; 199 199 Value _sum_supply; 200 200 … … 279 279 template <typename LowerMap> 280 280 CycleCanceling& lowerMap(const LowerMap& map) { 281 _ha ve_lower = true;281 _has_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];285 284 } 286 285 return *this; … … 472 471 _cost[_reverse[j]] = 0; 473 472 } 474 _ha ve_lower = false;473 _has_lower = false; 475 474 return *this; 476 475 } … … 685 684 const Value MAX = std::numeric_limits<Value>::max(); 686 685 int last_out; 687 if (_ha ve_lower) {686 if (_has_lower) { 688 687 for (int i = 0; i != _root; ++i) { 689 688 last_out = _first_out[i+1]; … … 728 727 sup[n] = _supply[_node_id[n]]; 729 728 } 730 if (_ha ve_lower) {729 if (_has_lower) { 731 730 for (ArcIt a(_graph); a != INVALID; ++a) { 732 731 int j = _arc_idf[a]; … … 785 784 } 786 785 787 // Check if the upper bound is greater or equal to the lower bound788 // on each arc.786 // Check if the upper bound is greater than or equal to the lower bound 787 // on each forward arc. 789 788 bool checkBoundMaps() { 790 789 for (int j = 0; j != _res_arc_num; ++j) { 791 if (_ upper[j] < _lower[j]) return false;790 if (_forward[j] && _upper[j] < _lower[j]) return false; 792 791 } 793 792 return true; … … 836 835 837 836 // Handle non-zero lower bounds 838 if (_ha ve_lower) {837 if (_has_lower) { 839 838 int limit = _first_out[_root]; 840 839 for (int j = 0; j != limit; ++j) { 841 if ( !_forward[j]) _res_cap[j] += _lower[j];840 if (_forward[j]) _res_cap[_reverse[j]] += _lower[j]; 842 841 } 843 842 } -
lemon/network_simplex.h
r1270 r1298 199 199 200 200 // Parameters of the problem 201 bool _ha ve_lower;201 bool _has_lower; 202 202 SupplyType _stype; 203 203 Value _sum_supply; … … 683 683 template <typename LowerMap> 684 684 NetworkSimplex& lowerMap(const LowerMap& map) { 685 _ha ve_lower = true;685 _has_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 ve_lower = false;882 _has_lower = false; 883 883 _stype = GEQ; 884 884 return *this; … … 1073 1073 1074 1074 // Remove non-zero lower bounds 1075 if (_ha ve_lower) {1075 if (_has_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 or equal to the lower bound1238 // Check if the upper bound is greater than 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 ve_lower) {1615 if (_has_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.