Skip to content

Conversation

blegat
Copy link
Member

@blegat blegat commented Jun 15, 2021

Various improvements to MatrixOfConstraints. It can now pass the relevant tests in Test/modellike.jl.

  • Add macros to create subtypes of StructOfConstraints and improve StructOfConstraints so that sub-fields can be MatrixOfConstraintss.
  • [breaking] Use Box in MOIU.Model for storing variable bounds.
  • Implement some of the getters for MOI attributes.

@blegat blegat added this to the v0.10 milestone Jun 15, 2021
@blegat blegat changed the title Various improvements to MatrixOfConstraints [WIP] Various improvements to MatrixOfConstraints Jun 15, 2021
@odow
Copy link
Member

odow commented Jun 15, 2021

What is the motivation for this?

@blegat blegat force-pushed the bl/mat_of_cons branch 2 times, most recently from 6699029 to 3179f4f Compare June 18, 2021 14:58
@blegat blegat changed the title [WIP] Various improvements to MatrixOfConstraints Various improvements to MatrixOfConstraints Jun 18, 2021
@blegat
Copy link
Member Author

blegat commented Jun 18, 2021

What is the motivation for this?

The StructOfConstraints macro is needed, e.g. for solvers that have a separate matrix for equality constraints and conic constraints, e.g., ECOS.
Using Box in MOIU.Model allows to share code between MatrixOfConstraints and AbstractModel, notably the getter for AbstractSet which has a few methods.
For the getters, I get we could choose not to implement them but they are quite straightforward and if they are not supported, then the hacks we will need in the tests of the solver wrappers using a MatrixOfConstraints as cache would be more work than this PR (and maintaining these features). Moreover, having them allows to use more modellike tests like the one added in this PR which is quite useful to ensure that MatrixOfConstraints behaves consistenctly with how a good ModelLike should behave.

Copy link
Member

@odow odow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes make sense, modulo some more documentation and testing.

@blegat blegat merged commit 9fb8da1 into master Jun 22, 2021
@blegat blegat deleted the bl/mat_of_cons branch June 22, 2021 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants