[DNMY] Add MOI wrapper for CCOpt#63
Open
frapac wants to merge 1 commit into
Open
Conversation
|
Is this branch fully working? It would be great for a current project |
apozharski
approved these changes
Jun 23, 2026
apozharski
left a comment
Member
There was a problem hiding this comment.
Minor comments, and needs a rebase, but otherwise LGTM.
| end | ||
|
|
||
| function MOI.get(::Optimizer, ::MOI.DualStatus) | ||
| # TODO |
Member
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) |
Member
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.") |
Member
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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