Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the row bound rounding rule to tolerance based when set up the LL/SL problem #126

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/MibSBilevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,8 @@ MibSBilevel::setUpModel(OsiSolverInterface * oSolver, bool newOsi,
/** Set the row bounds **/
for(i = 0; i < lRows; i++){
index1 = lRowIndices[i];
rowLb[i] = floor(origRowLb[index1] + 0.5);
rowUb[i] = floor(origRowUb[index1] + 0.5);
rowLb[i] = origRowLb[index1];
rowUb[i] = origRowUb[index1];
}

if (feasCheckSolver == "Cbc"){
Expand Down Expand Up @@ -1224,8 +1224,16 @@ MibSBilevel::setUpModel(OsiSolverInterface * oSolver, bool newOsi,
/** Correct the row bounds to account for fixed upper-level vars **/

for(i = 0; i < lRows; i++){
nSolver->setRowLower(i, floor(rowLb[i] - upComp[i] + 0.5));
nSolver->setRowUpper(i, floor(rowUb[i] - upComp[i] + 0.5));
if(fabs(rowLb[i] - upComp[i] - floor(rowLb[i] - upComp[i] + 0.5)) < etol){
nSolver->setRowLower(i, floor(rowLb[i] - upComp[i] + 0.5));
}else{
nSolver->setRowLower(i, rowLb[i] - upComp[i]);
}
if(fabs(rowUb[i] - upComp[i] - floor(rowUb[i] - upComp[i] + 0.5)) < etol){
nSolver->setRowUpper(i, floor(rowUb[i] - upComp[i] + 0.5));
}else{
nSolver->setRowUpper(i, rowUb[i] - upComp[i]);
}
}

delete [] upComp;
Expand Down