@@ -1183,7 +1183,8 @@ namespace lp {
1183
1183
slack += coeff * (adj_sign < 0 ? get_upper_bound(j) : get_lower_bound(j));
1184
1184
}
1185
1185
1186
- bool is_pos = slack.is_pos();
1186
+ #define get_sign(_x_) (_x_.is_pos() ? 1 : (_x_.is_neg() ? -1 : 0))
1187
+ int sign = get_sign(slack);
1187
1188
#endif
1188
1189
1189
1190
for (auto & [coeff, j] : inf_row) {
@@ -1199,7 +1200,7 @@ namespace lp {
1199
1200
if (ul.previous_upper() != UINT_MAX) {
1200
1201
auto const& [_is_upper, _j, _bound, _column] = m_column_updates[ul.previous_upper()];
1201
1202
auto new_slack = slack + coeff * (_bound - get_upper_bound(j));
1202
- if (is_pos == new_slack.is_pos( )) {
1203
+ if (sign == get_sign(new_slack )) {
1203
1204
//verbose_stream() << "can weaken j" << j << " " << coeff << " " << get_upper_bound(j) << " " << _bound << "\n";
1204
1205
slack = new_slack;
1205
1206
bound_constr_i = _column.upper_bound_witness();
@@ -1210,7 +1211,7 @@ namespace lp {
1210
1211
if (ul.previous_lower() != UINT_MAX) {
1211
1212
auto const& [_is_upper, _j, _bound, _column] = m_column_updates[ul.previous_lower()];
1212
1213
auto new_slack = slack + coeff * (_bound - get_lower_bound(j));
1213
- if (is_pos == new_slack.is_pos( )) {
1214
+ if (sign == get_sign(new_slack )) {
1214
1215
//verbose_stream() << "can weaken j" << j << " " << coeff << " " << get_lower_bound(j) << " " << _bound << "\n";
1215
1216
slack = new_slack;
1216
1217
bound_constr_i = _column.lower_bound_witness();
0 commit comments