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 can, except for the initial setup.

For newOSI, we need rowLb and rowUb to store the rearranged \llv\ row bounds and send them to loadProblem(*newMat, colLb, colUb, objCoeffs, rowLb, rowUb). After that, we can use additional condition checks, origRowLb and origRowLb when iterating over \llv\ rows. Some loops on \llv\ rows in setUpModel() can be further combined and cleaned up.

But since we have to use them once at the initial setup, we can also keep using them to make the code blocks easier(consistent?) 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