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

Conversation

yuxies
Copy link

@yuxies yuxies commented Oct 14, 2023

In the function `setUpModel()' in MibSBilevel:

  • remove the rounding on the original row bounds b^2;
  • add a tolerance check before rounding values b^2 - A^2 x.

@yuxies yuxies changed the title change row bnd rounding rule to tolerance based Change the row bound rounding rule to tolerance based when set up the LL/SL problem Oct 14, 2023
@yuxies yuxies marked this pull request as ready for review October 19, 2023 03:48
Copy link
Member

@tkralphs tkralphs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we even need rowLb and rowUb now. About all that happens is that we copy from one array to another, possibly negating the values. But then that new array is only used once after that and we could easily just have origRowSense[index1] == 'G' ? origRowLb[i] : - origRowLb[i] instead of rowLb[i]. What do you think?

@yuxies
Copy link
Author

yuxies commented Oct 24, 2023

We could do that, except for the initial setup.

For newOSI, we still need rowLb and rowUb to store the rearranged lower level row bounds and pass them to loadProblem(*newMat, colLb, colUb, objCoeffs, rowLb, rowUb). Once the Osi is initialized, we can switch to using condition checks on origRowLb and origRowUb when iterating over lower level rows. Some of the loops in setUpModel() that process lower level rows can also be consolidated and cleaned up.

But since we have to use rowLb and rowUb for the initial setup, it may be simpler to continue using them to keep the code more consistent and easier to read.

@tkralphs tkralphs merged commit ca1d6f4 into coin-or:stable/1.2 Oct 26, 2023
14 of 15 checks passed
@tkralphs
Copy link
Member

OK, I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants