-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
testing whether a JuMP expression == 0 #789
Comments
Whoever needs it is welcome to contribute a smarter definition of equality of |
@blegat is this what your PolyJuMP fix does at https://github.com/JuliaOpt/PolyJuMP.jl/pull/11/files#diff-ce657b38c7ecda6fbbcdcc558bf57b86? |
Yes, this what is done in the PolyJuMP tests. Since JuMP is dropping v0.5, we can define this as Base.iszero in JuMP. |
Great. Now that 0.5 support is dropped could you move this code to JuMP? |
Wrong package, still need a PR to drop 0.5 from JuMP. |
Woops. Karma for using github mobile during a lunch date. @mlubin can you drop 0.5 for jump too? |
|
I am iterating over JuMP
AffExpr
s and do not wish to add empty (0 == 0
) constraints to a MIP model.Can we have simple way to test whether an expression is just 0? i.e. for affine, the constant and all coefficients on variables are 0. It would be nice to be able to write
if AffExpr == 0
blah blah.The text was updated successfully, but these errors were encountered: