equal
deleted
inserted
replaced
1065 _sum_supply += _supply[i]; |
1065 _sum_supply += _supply[i]; |
1066 } |
1066 } |
1067 if ( !((_stype == GEQ && _sum_supply <= 0) || |
1067 if ( !((_stype == GEQ && _sum_supply <= 0) || |
1068 (_stype == LEQ && _sum_supply >= 0)) ) return false; |
1068 (_stype == LEQ && _sum_supply >= 0)) ) return false; |
1069 |
1069 |
|
1070 // Check lower and upper bounds |
|
1071 LEMON_DEBUG(checkBoundMaps(), |
|
1072 "Upper bounds must be greater or equal to the lower bounds"); |
|
1073 |
1070 // Remove non-zero lower bounds |
1074 // Remove non-zero lower bounds |
1071 if (_have_lower) { |
1075 if (_have_lower) { |
1072 for (int i = 0; i != _arc_num; ++i) { |
1076 for (int i = 0; i != _arc_num; ++i) { |
1073 Value c = _lower[i]; |
1077 Value c = _lower[i]; |
1074 if (c >= 0) { |
1078 if (c >= 0) { |
1228 _all_arc_num = f; |
1232 _all_arc_num = f; |
1229 } |
1233 } |
1230 |
1234 |
1231 return true; |
1235 return true; |
1232 } |
1236 } |
|
1237 |
|
1238 // Check if the upper bound is greater or equal to the lower bound |
|
1239 // on each arc. |
|
1240 bool checkBoundMaps() { |
|
1241 for (int j = 0; j != _arc_num; ++j) { |
|
1242 if (_upper[j] < _lower[j]) return false; |
|
1243 } |
|
1244 return true; |
|
1245 } |
1233 |
1246 |
1234 // Find the join node |
1247 // Find the join node |
1235 void findJoinNode() { |
1248 void findJoinNode() { |
1236 int u = _source[in_arc]; |
1249 int u = _source[in_arc]; |
1237 int v = _target[in_arc]; |
1250 int v = _target[in_arc]; |