-
Notifications
You must be signed in to change notification settings - Fork 259
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
Add addExprNonlinear #760
Add addExprNonlinear #760
Conversation
I feel like I'm playing the opposition on these merge requests...... In what context does something like this come up @Joao-Dionisio ? I'm not against the change, but it feels incredibly niche. Couldn't you simply just remove the constraint and then re add it with the now modified expression? (Adding a linear term to the non-linear expression should work fine) |
No worries @Opt-Mucca, I think it was me who spammed PRs of dubious interest :) This came up with Issue #713, and it seems like it could be helpful, maybe for reoptimizations and such. I suppose it would serve the same purpose that it serves in SCIP. |
@Joao-Dionisio I'm convinced for this one after seeing the issue you commented. I still think you could simply keep track of the expression inside of the constraint, but that is actually duplicate work, and maybe not that intuitive. Suggestion: Do you need to add |
@Opt-Mucca yeah, you just need the expression, but I tried to keep the function as close to the SCIP function as I could, which does take |
Then I'm happy with this one! |
Co-authored-by: Mohammed Ghannam <[email protected]>
Co-authored-by: Mohammed Ghannam <[email protected]>
Oh man, what have I done... I just wanted to add a TODO :( Anyway, we talked about accepting this if we added a TODO. Since it seems a bit annoying to actually solve the problems, and they're not that big, then I say we do this. It also frees up an issue. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #760 +/- ##
==========================================
+ Coverage 52.69% 52.76% +0.07%
==========================================
Files 17 17
Lines 3809 3817 +8
==========================================
+ Hits 2007 2014 +7
- Misses 1802 1803 +1 ☔ View full report in Codecov by Sentry. |
This is not the best way to solve the issue, but I think it gets the work done.
scip.pxi
(x = self.addVar(lb=0,ub=0), self.addCons(linear expr + x**2 <= RHS)
). This would work with other methods.GenExpr
doesn't includeExpr
. Most likely it should.