-
Notifications
You must be signed in to change notification settings - Fork 87
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
Should we extend Base.zero for ScalarAffineFunction and ScalarQuadraticFunction #636
Comments
No, we shouldn't. This is a mistake in JuMP that can lead to hard to find bugs (jump-dev/JuMP.jl#1151 (comment)). |
I would argue that the case is a bit different from JuMP where JuMP expressions are meant to be userfriendly and the user should be able to manipulate just like numbers. The reason I would like |
That's exactly the issue. Code that doesn't know anything about MOI probably wasn't written with mutable number types in mind and isn't tested with them. We shouldn't implement the I don't know if implementing |
If the code is written with only generic operations, it won't do any mutated operation so there won't be any issue. The issue arises if the user uses
That would require MOI to have MultivariatePolynomials in its dependencies which is weird. |
Ok, since this shouldn't cause issues with code that doesn't try to mutate the numbers, let's drop this from the 0.8.2 milestone.
Not necessarily. Couldn't SumOfSquares implement the mutating interface for MOI when it calls MultivariatePolynomials? It might need a wrapper type around MOI to avoid type piracy. |
Can this be closed? We seem to be getting along fine without defining it... |
Closing. We can re-open in future if we ever have a good reason for it. |
See #634 (comment)
The text was updated successfully, but these errors were encountered: