-
-
Notifications
You must be signed in to change notification settings - Fork 398
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 start_value, lower_bound, and upper_bound support for GenericAffExpr #3551
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3551 +/- ##
==========================================
- Coverage 98.26% 98.19% -0.07%
==========================================
Files 37 37
Lines 5580 5599 +19
==========================================
+ Hits 5483 5498 +15
- Misses 97 101 +4
☔ View full report in Codecov by Sentry. |
Hmm. There are actually a bunch of edge cases once you dig in: model = Model()
@variable(model, x)
y = (1 - 2im) * x
@test !has_lower_bound(y)
set_lower_bound(y, 1 + 2im) What is |
My sense is that this might cause more confusion than it solves. Next we'll have a request to support |
Setting bounds should only be allowed with one term and real coefficient. If complex, the user can be explicit by doing |
Yeah. But it's currently causing confusion because some outputs from
This is reasonable. |
That's a fair compromise. |
How about this now |
Removed the method. How's the now |
Closes #3550
This PR is up for debate, but our problem is that some usages of
@variable
return expressions of variables, and then common operations likelower_bound
orset_start_value
do not work.In most common cases we can make this work, so we probably should. This would improve the user-experience, particularly for those using
Complex
number support.