Skip to content
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

Implement constrained variables #167

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Implement constrained variables #167

wants to merge 6 commits into from

Conversation

blegat
Copy link
Member

@blegat blegat commented Jan 21, 2025

When using Mosek after a POI layer without any bridge in-between, the performance was catastrophic because the PSD variable where bridged to affine constraints as the bridges didn't see through the POI layers that PSD variables were supported.

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.85%. Comparing base (b853398) to head (ce4ce34).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
+ Coverage   95.80%   95.85%   +0.04%     
==========================================
  Files           5        5              
  Lines        1097     1109      +12     
==========================================
+ Hits         1051     1063      +12     
  Misses         46       46              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joaquimg
Copy link
Member

Nice! can you just add tests for constrained variable(s)?

src/ParametricOptInterface.jl Outdated Show resolved Hide resolved
@blegat blegat requested a review from joaquimg January 22, 2025 19:49
Copy link
Member

@joaquimg joaquimg left a comment

Choose a reason for hiding this comment

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

Only thing pending it the constraint index issue, or you plan to solve it in a follow up PR?

set::MOI.AbstractScalarSet,
)
inner_vi, inner_ci = MOI.add_constrained_variable(model.optimizer, set)
return _add_variable(model, inner_vi), inner_ci # FIXME map inner_ci
Copy link
Member

Choose a reason for hiding this comment

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

This still needs a fix, right? Otherwise, vi and ci wont actually match

set::MOI.AbstractVectorSet,
)
inner_vis, inner_ci = MOI.add_constrained_variables(model.optimizer, set)
return _add_variable.(Ref(model), inner_vis), inner_ci # FIXME map inner_ci
Copy link
Member

Choose a reason for hiding this comment

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

same as above

optimizer = POI.Optimizer(NoFreeVariablesModel{Float64}())
set = MOI.LessThan(1.0)
@test MOI.supports_add_constrained_variable(optimizer, typeof(set))
x, c = MOI.add_constrained_variable(optimizer, set)
Copy link
Member

Choose a reason for hiding this comment

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

we should probably add a test to check the match between ci and vi.

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