Skip to content

Commit

Permalink
Merge pull request ERGO-Code#1848 from fwesselm/presolveBugTransform
Browse files Browse the repository at this point in the history
Update substitutions if a column is transformed
  • Loading branch information
jajhall authored Aug 4, 2024
2 parents 4da5ad8 + c468ded commit 00d7273
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/mip/HighsImplications.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class HighsImplications {
double vlbconstant);

void columnTransformed(HighsInt col, double scale, double constant) {
// Update variable bounds affected by transformation
if (scale < 0) std::swap(vubs[col], vlbs[col]);

auto transformVbd = [&](HighsInt, VarBound& vbd) {
Expand All @@ -119,6 +120,15 @@ class HighsImplications {

vlbs[col].for_each(transformVbd);
vubs[col].for_each(transformVbd);

// Update substitutions affected by transformation
for (auto& substitution : substitutions) {
if (substitution.substcol == col) {
substitution.offset -= constant;
substitution.offset /= scale;
substitution.scale /= scale;
}
}
}

std::pair<HighsInt, VarBound> getBestVub(HighsInt col,
Expand Down

0 comments on commit 00d7273

Please sign in to comment.