-
Notifications
You must be signed in to change notification settings - Fork 41
Fix slow MOI merging step #129
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
- The current way I merge k COSMO.Nonnegatives(1) into one COSMO.Nonnegatives(k) is extremly slow - This fix also removes constraint support for the scalar sets as that should be handled by MOI.Bridges - 1 MOI unit tests still errors
@blegat One of the MOI unit tests errors. But I don't understand what's going on. It seems to happen when the constraint in
I guess it's related to the fact that I removed direct support for some constraints: Lines 788 to 789 in 142fcfd
|
I would go though the test line by line: https://github.com/jump-dev/MathOptInterface.jl/blob/8d8beb387551d45138857bd472328718ba98ca8e/src/Test/contlinear.jl#L2313-L2476 The error occurs when multiple variables are deleted: https://github.com/jump-dev/MathOptInterface.jl/blob/162049e15415b47a40c29d9a0aa9d6acf58a2d72/src/Test/contlinear.jl#L1653 |
So COSMO supports |
- Prevent error in linear14 due to the fact that only ScalarAffine-in-Intervall was supported but not ScalarAffine-in-LessThan
Would the box constraint support infinite bounds (related to jump-dev/MathOptInterface.jl#1228) ? I'm also in favor of having one
I don't think that's possible, each of them are bridged to a separate
You can check what happens with |
Infinite bounds wouldn't be a problem for us. The box would effectively be a Nonnegatives/Nonpositives. This is before
This is before
|
I can reduce it to model = MOI.instantiate(COSMO.Optimizer, with_bridge_type=Float64)
MOI.empty!(model)
x = MOI.add_variable(model)
c = MOI.add_constraint(model, MOI.SingleVariable(x), MOI.LessThan(1.0))
MOI.delete(model, x) and with debug model = MOI.instantiate(COSMO.Optimizer, with_bridge_type=Float64)
MOI.empty!(model)
x = MOI.add_variable(model)
c = MOI.add_constraint(model, MOI.SingleVariable(x), MOI.LessThan(1.0))
b = MOI.Bridges.bridge(model, c)
@show typeof(b)
@show b.constraint
b2 = MOI.Bridges.bridge(model, b.constraint)
@show typeof(b2)
@show b2.constraint
@show MOI.Bridges.is_bridged(model, b2.constraint)
MOI.delete(model, x) which gives
|
This is an MOI bug, I've opened an issue there. |
is extremely slow
be handled by MOI.Bridges