Skip to content

Commit e79171f

Browse files
committed
Minor things
1 parent d8dbbbb commit e79171f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

highs/mip/HighsPrimalHeuristics.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ void HighsPrimalHeuristics::rootReducedCost() {
323323
12);
324324
}
325325

326-
static double computeFixValue(double rootchange, double fracval, double cost) {
326+
constexpr static double calcFixVal(double rootchange, double fracval,
327+
double cost) {
327328
// reinforce direction of this solution away from root
328329
// solution if the change is at least 0.4
329330
// otherwise take the direction where the objective gets worse
@@ -457,10 +458,10 @@ void HighsPrimalHeuristics::RENS(const std::vector<double>& tmp) {
457458
// otherwise take the direction where the objective gets worse
458459
// if objective is zero round to nearest integer
459460
double fixval =
460-
computeFixValue(mipsolver.mipdata_->rootlpsol.empty()
461-
? 0.0
462-
: fracval - mipsolver.mipdata_->rootlpsol[col],
463-
fracval, mipsolver.model_->col_cost_[col]);
461+
calcFixVal(mipsolver.mipdata_->rootlpsol.empty()
462+
? 0.0
463+
: fracval - mipsolver.mipdata_->rootlpsol[col],
464+
fracval, mipsolver.model_->col_cost_[col]);
464465
// make sure we do not set an infeasible domain
465466
fixval = std::min(localdom.col_upper_[col], fixval);
466467
fixval = std::max(localdom.col_lower_[col], fixval);
@@ -679,8 +680,8 @@ void HighsPrimalHeuristics::RINS(const std::vector<double>& relaxationsol) {
679680
// solution if the change is at least 0.4
680681
// otherwise take the direction where the objective gets worse
681682
// if objective is zero round to nearest integer
682-
fixval = computeFixValue(fracval - mipsolver.mipdata_->rootlpsol[col],
683-
fracval, mipsolver.model_->col_cost_[col]);
683+
fixval = calcFixVal(fracval - mipsolver.mipdata_->rootlpsol[col],
684+
fracval, mipsolver.model_->col_cost_[col]);
684685
}
685686
// make sure we do not set an infeasible domain
686687
fixval = std::min(localdom.col_upper_[col], fixval);

0 commit comments

Comments
 (0)