Add MOI wrapper for CCOpt - #63
Conversation
|
Is this branch fully working? It would be great for a current project |
apozharski
left a comment
There was a problem hiding this comment.
Minor comments, and needs a rebase, but otherwise LGTM.
| end | ||
|
|
||
| function MOI.get(::Optimizer, ::MOI.DualStatus) | ||
| # TODO |
There was a problem hiding this comment.
I am not actually sure what this is supposed to return, but I should be return UNKNOWN_RESULT_STATUS?
| ind_x1 = getfield.(ind_cc1, :value) | ||
| ind_x2 = getfield.(ind_cc2, :value) | ||
|
|
||
| dest.mpcc = CCOpt.MPCCModelVarVar(nlp, ind_x1, ind_x2) |
There was a problem hiding this comment.
I guess this needs a rename.
| contypes = MOI.get(src, MOI.ListOfConstraintTypesPresent()) | ||
| cc_cons = MOI.get(src, MOI.ListOfConstraintIndices{MOI.VectorOfVariables, _CC_SETS}()) | ||
| if length(cc_cons) == 0 | ||
| error("The model does not have any complementarity constraints. Please switch to an appropriate solver.") |
|
@noahrhodes Hmmm I am not an MOI/JuMP expert 😅 (and I forgot that you actually asked for review on this, sorry @frapac ) but from what I can tell it seems like it should work, but the best way to know would be for someone to test it. |
|
We are almost done with the MO interface. It remains just to solve two issues in the upstream package NLPModelsJuMP:
Also, I observe that sometimes MathOptComplements is not bridging correctly the model to CCOpt (cc @blegat ). This can be addressed directly in MathOptComplements. I will open separate issues to address this. |
|
@apozharski what should we do with the MOI tests? They tend to take a significant time. Two options:
|
I suspect that the right answer is to figure out a way to do option 2 but do it at the "step" level rather than at the "job" level. https://github.com/dorny/paths-filter is one such way to do that it seems. The fact this isn't supported natively is one of those things about Github that astounds me. |
With this PR, we can solve a JuMP model with complementarity constraints using CCOpt:
The MOI wrapper is developed as a package extension. It requires MathOptComplements to reformulate automatically the mixed-complementarity constraints in MOI as strict complementarity.
cc @blegat