-
Notifications
You must be signed in to change notification settings - Fork 34
Fix handling of setting variable bounds. #81
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
Conversation
collect upper and lower terms, otherwise we can end up trying to set variable bounds with lower > upper.
Codecov Report
@@ Coverage Diff @@
## master #81 +/- ##
=====================================
Coverage 0% 0%
=====================================
Files 4 4
Lines 1602 1619 +17
=====================================
- Misses 1602 1619 +17
Continue to review full report at Codecov.
|
What do you do in case with lower > upper ? |
Good point, we should throw an error, although probably at the MOI level |
In MathProgBase, we had a special treatment that was added here |
Okay so we have two options:
Currently, this PR does option 1. For simplicity, the current check is O(n+m) where n is the number of variables and m is the number of constraints. We could do better by recording invalid bounds at the creation and modification steps. I haven't gone that route as the bigger question is whether this check is worth it. |
src/MOIWrapper.jl
Outdated
binaries::Vector{Int} | ||
# Add a check prior to solve to see if there are infeasible column or row | ||
# bounds. We perform this check manually because otherwise GLPK will fail | ||
# with TerminationStatus OtherError due to invalid bounds. For reference see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InvalidModel
instead of OtherError
, no?
…it that the problem is infeasible.
Okay, now we just disable the preemptive check (maybe it should be off by default???) and then handle the status properly. |
Bump on the reviews. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
We need to loop through and collect upper and lower terms, otherwise we can end up trying to set
variable bounds with lower > upper.
See also JuliaOpt/LinQuadOptInterface.jl#66