Skip to content

Commit 59a819f

Browse files
committed
Format. Add epsilon check for score
1 parent 16b1c97 commit 59a819f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

highs/mip/HighsPathSeparator.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,17 @@ void HighsPathSeparator::separateLpSolution(HighsLpRelaxation& lpRelaxation,
115115
for (HighsInt i = lp.a_matrix_.start_[col];
116116
i != lp.a_matrix_.start_[col + 1]; ++i) {
117117
HighsInt row = lp.a_matrix_.index_[i];
118+
if (rowtype[row] == RowType::kUnusuable) continue;
118119
double val = lp.a_matrix_.value_[i];
119120
rowscore[row].first += std::abs(val * transLp.getColFractionality(col));
120121
rowscore[row].second += std::abs(val);
121122
}
122123
}
123124
for (HighsInt row = 0; row != lp.num_row_; ++row) {
124-
if (rowscore[row].second > 0) {
125+
if (rowscore[row].second > mip.mipdata_->feastol) {
125126
rowscore[row].first /= rowscore[row].second;
126-
rowscore[row].second = 1;
127+
} else {
128+
rowscore[row].first = 0.0;
127129
}
128130
}
129131

@@ -293,7 +295,8 @@ void HighsPathSeparator::separateLpSolution(HighsLpRelaxation& lpRelaxation,
293295
const std::vector<std::pair<HighsInt, HighsInt>>& colArcs,
294296
const std::vector<std::pair<HighsInt, double>>& arcRows,
295297
HighsInt& row, double& weight) {
296-
for (HighsInt arcRow = colArcs[bestArcCol].first; arcRow != colArcs[bestArcCol].second; ++arcRow) {
298+
for (HighsInt arcRow = colArcs[bestArcCol].first;
299+
arcRow != colArcs[bestArcCol].second; ++arcRow) {
297300
HighsInt r = arcRows[arcRow].first;
298301
double w = -val / arcRows[arcRow].second;
299302
if (!isRowInCurrentPath(r) && checkWeight(w)) {

0 commit comments

Comments
 (0)