-
Notifications
You must be signed in to change notification settings - Fork 92
[Bridges] fix deleting variable in bridged objective #2150
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
Conversation
Some solvers error getting ObjectiveFunctionType if objective is not set.
c579d1d
to
495036c
Compare
@blegat can you take a look? This is fairly urgent because it broke tests for CPLEX and Gurobi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment is optional
::Vector{MOI.VariableIndex}, | ||
::Type{F}, | ||
) where {F} | ||
# Nothing to do here. The variables can be deleted without changing the type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppose the objective is a quadratic function that is bridged with Objective.Slack and then Constraint.QuadtoSOC, we should still update the function so that the corresponding SOC constraint is updated.
This can be done in a separate PR though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that happens automatically. This is just a special case where deleting a variable can unset the objective, rather than just modify the existing function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it does. I think the variable deletion API kind of assumes that all bridges are affine so since the deletion commutes with affine operations then it's fine to skip the bridges and delete the solver model directly but there is one notable exception which is the QuadtoSOC bridge. We should maybe check but it's best we open a separate issue
Some solvers error getting ObjectiveFunctionType if objective is not set. (x-ref jump-dev/CPLEX.jl#433)
I need to manually test this with CPLEX and Gurobi: