Skip to content

Commit 80e9b89

Browse files
committed
Simplify if statement logic. Remove auto
1 parent 614721a commit 80e9b89

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

highs/mip/HighsRedcostFixing.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,10 @@ void HighsRedcostFixing::addRootRedcost(const HighsMipSolver& mipsolver,
206206
// This is to avoid doing 2**10 steps when there's many unbounded columns
207207
HighsInt numRedcostLargeDomainCols = 0;
208208
for (HighsInt col : mipsolver.mipdata_->integral_cols) {
209-
if (mipsolver.mipdata_->domain.col_upper_[col] -
210-
mipsolver.mipdata_->domain.col_lower_[col] >=
211-
512) {
212-
if (lpredcost[col] > mipsolver.mipdata_->feastol) {
213-
numRedcostLargeDomainCols++;
214-
} else if (lpredcost[col] < -mipsolver.mipdata_->feastol) {
215-
numRedcostLargeDomainCols++;
216-
}
209+
if ((mipsolver.mipdata_->domain.col_upper_[col] -
210+
mipsolver.mipdata_->domain.col_lower_[col]) >= 512 &&
211+
std::abs(lpredcost[col]) > mipsolver.mipdata_->feastol) {
212+
numRedcostLargeDomainCols++;
217213
}
218214
}
219215
HighsInt maxNumStepsExp = 10;
@@ -223,7 +219,7 @@ void HighsRedcostFixing::addRootRedcost(const HighsMipSolver& mipsolver,
223219
expshift = std::min(expshift, static_cast<int>(maxNumStepsExp));
224220
maxNumStepsExp = maxNumStepsExp - expshift + 5;
225221
}
226-
auto maxNumSteps = static_cast<HighsInt>(1ULL << maxNumStepsExp);
222+
HighsInt maxNumSteps = static_cast<HighsInt>(1ULL << maxNumStepsExp);
227223

228224
for (HighsInt col : mipsolver.mipdata_->integral_cols) {
229225
if (lpredcost[col] > mipsolver.mipdata_->feastol) {

0 commit comments

Comments
 (0)