-
Notifications
You must be signed in to change notification settings - Fork 92
Add fallback for ListOfConstraintIndices and NumberOfConstraints #2021
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
No issues identified by SolverTests, jump-dev/SolverTests#19, so I'd say this is okay. |
Since all MOI wrappers tested by SolverTests are correctly implemented, this is not different from #2011. |
Added a |
|
Done. |
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.
Looks good, maybe add a comment in the code since it is not so obvious why we are doing what we are doing ?
This PR adds a fallback for
ListOfConstraintIndices
andNumberOfConstraints
to return default values in the case that the solver does't support the particular function-set combination.This has come up a few times:
Closes #2011
Closes #2010
Follow-up to #2008
We already had something similar in two places:
MathOptInterface.jl/src/Utilities/struct_of_constraints.jl
Lines 142 to 150 in 71defad
MathOptInterface.jl/src/Utilities/struct_of_constraints.jl
Lines 132 to 140 in 71defad
#2008 added it to two more:
MathOptInterface.jl/src/Utilities/model.jl
Lines 416 to 424 in 71defad
MathOptInterface.jl/src/Utilities/model.jl
Lines 443 to 451 in 71defad
So this PR is essentially just making some implied behavior concrete.
I've tested with Gurobi:
But once this PR is open, I'll run SolverTests to see the damage: jump-dev/SolverTests#19