-
-
Notifications
You must be signed in to change notification settings - Fork 399
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 Hermitian tag in variable macro #3293
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3293 +/- ##
=======================================
Coverage 98.12% 98.12%
=======================================
Files 34 34
Lines 4738 4750 +12
=======================================
+ Hits 4649 4661 +12
Misses 89 89
... and 3 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Just merge this into one PR? Doesn't need to be separate. |
Yes, but I was worried this one not reach consensus directly |
I think it should be possible to support the |
Thinking on this more, I understand arguments both for and against adding this. You could ask why You're right about the breaking stuff though. In JuMP 2.0, I'd make it |
Yes, Especially import JuMP
model = Model()
@variable(model, x[1:2, 1:2], Hermitian) won't work anymore, but using JuMP
model = Model()
h = Hermitian
@variable(model, x[1:2, 1:2], h) will work in JuMP v2. We would make it work in JuMP v1 but in a separate PR that does it for all of them |
4c21e70
to
74704d6
Compare
Agree. I'm ambivalent on adding this. How common are hermitians matrices? Not very? If so, asking for |
Besides introducing an inconsistency in the syntax, the problem with For comparison, YALMIP's syntax is |
Monthly call says go for this. |
74704d6
to
cb6077c
Compare
@blegat how's this? |
Looks good to me, we can merge |
Requires #3292 to be merged first.
Another option is to reexport the symbol of
LinearAlgebra.Hermitian
andLinearAlgebra.Symmetric
and to overloadbuild_variable
. I always felt it a bit annoying to ask to user to loadLinearAlgebra
intself to use theSymmetric
symbol which is part of the JuMP syntax.The issue is that it won't work if the user
import
JuMP because thenSymmetric
won't be in the scope so it would be breaking.Closes #3291