Skip to content

Commit 1a10736

Browse files
committed
Fix map18 issue
1 parent e8b7876 commit 1a10736

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

highs/presolve/HPresolve.cpp

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,8 @@ bool HPresolve::isRedundant(HighsInt row) const {
251251
}
252252

253253
bool HPresolve::yieldsImpliedLowerBound(HighsInt row, double val) const {
254-
return ((val < 0 && model->row_upper_[row] != kHighsInf &&
255-
impliedRowBounds.getSumUpper(row) >
256-
model->row_upper_[row] + primal_feastol) ||
257-
(val > 0 && model->row_lower_[row] != -kHighsInf &&
258-
impliedRowBounds.getSumLower(row) <
259-
model->row_lower_[row] - primal_feastol));
254+
return ((val < 0 && model->row_upper_[row] != kHighsInf) ||
255+
(val > 0 && model->row_lower_[row] != -kHighsInf));
260256
}
261257

262258
bool HPresolve::yieldsImpliedUpperBound(HighsInt row, double val) const {
@@ -4557,10 +4553,6 @@ HPresolve::Result HPresolve::dualFixing(HighsPostsolveStack& postsolve_stack,
45574553
: -computeImpliedUpperBound(col, rowNz.index(),
45584554
model->col_upper_[rowNz.index()]);
45594555

4560-
// round bound
4561-
if (model->integrality_[col] != HighsVarType::kContinuous)
4562-
bestBound = std::ceil(bestBound - primal_feastol);
4563-
45644556
// check if lower / upper bound is implied
45654557
if (bestBound >= direction * colBound - primal_feastol) {
45664558
// substitute variable
@@ -4637,12 +4629,14 @@ HPresolve::Result HPresolve::dualFixing(HighsPostsolveStack& postsolve_stack,
46374629
HPRESOLVE_CHECKED_CALL(substituteCol(col, downLockRow, HighsInt{1},
46384630
model->col_upper_[col],
46394631
model->col_lower_[col]));
4640-
} else if (numUpLocks == 1 && upLockRow != -1) {
4632+
if (colDeleted[col]) return Result::kOk;
4633+
}
4634+
if (numUpLocks == 1 && upLockRow != -1) {
46414635
HPRESOLVE_CHECKED_CALL(substituteCol(col, upLockRow, HighsInt{-1},
46424636
model->col_lower_[col],
46434637
model->col_upper_[col]));
4638+
if (colDeleted[col]) return Result::kOk;
46444639
}
4645-
if (colDeleted[col]) return Result::kOk;
46464640
}
46474641
// try to strengthen bounds
46484642
double newBound = 0.0;
@@ -5199,14 +5193,22 @@ void HPresolve::computeColBounds(HighsInt col, HighsInt boundCol,
51995193
HighsCDouble residual;
52005194
if ((direction > 0 && !isWorstCaseBound) ||
52015195
(direction < 0 && isWorstCaseBound)) {
5202-
residual = impliedRowBounds.getResidualSumLower(
5203-
triplet.row, col, triplet.jval, boundCol, triplet.kval,
5204-
boundColValue);
5196+
residual = isWorstCaseBound
5197+
? impliedRowBounds.getResidualSumLower(
5198+
triplet.row, col, triplet.jval, boundCol,
5199+
triplet.kval, boundColValue)
5200+
: impliedRowBounds.getResidualSumLowerOrig(
5201+
triplet.row, col, triplet.jval, boundCol,
5202+
triplet.kval, boundColValue);
52055203
if (residual == -kHighsInf) return std::copysign(kHighsInf, val);
52065204
} else {
5207-
residual = impliedRowBounds.getResidualSumUpper(
5208-
triplet.row, col, triplet.jval, boundCol, triplet.kval,
5209-
boundColValue);
5205+
residual = isWorstCaseBound
5206+
? impliedRowBounds.getResidualSumUpper(
5207+
triplet.row, col, triplet.jval, boundCol,
5208+
triplet.kval, boundColValue)
5209+
: impliedRowBounds.getResidualSumUpperOrig(
5210+
triplet.row, col, triplet.jval, boundCol,
5211+
triplet.kval, boundColValue);
52105212
if (residual == kHighsInf) return -std::copysign(kHighsInf, val);
52115213
}
52125214
return static_cast<double>((static_cast<HighsCDouble>(rhs) - residual) /

0 commit comments

Comments
 (0)