-
Notifications
You must be signed in to change notification settings - Fork 92
Missing attribute ConstraintDual
for ZerosBridge
#1831
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
Comments
The problem is
I guess this now applies. |
There's another work-around that would require adding methods to JuMP: julia> using JuMP
julia> using ECOS
julia> remove_bridge(model::Model, B) = remove_bridge(backend(model), B)
remove_bridge (generic function with 3 methods)
julia> remove_bridge(model::MOI.Utilities.CachingOptimizer, B) = remove_bridge(model.optimizer, B)
remove_bridge (generic function with 3 methods)
julia> remove_bridge(model::MOI.Bridges.AbstractBridgeOptimizer, B) = MOI.Bridges.remove_bridge(model, B)
remove_bridge (generic function with 3 methods)
julia> model = Model(ECOS.Optimizer)
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: ECOS
julia> remove_bridge(model, MOI.Bridges.Variable.ZerosBridge{Float64})
julia> @variable(model, x[1:2])
2-element Vector{VariableRef}:
x[1]
x[2]
julia> @variable(model, t[1:2])
2-element Vector{VariableRef}:
t[1]
t[2]
julia> @variable(model, p == 1)
p
julia> @constraint(model, con1, [t[1], x[1] + p, x[1]] in SecondOrderCone())
con1 : [t[1], x[1] + p, x[1]] ∈ MathOptInterface.SecondOrderCone(3)
julia> @constraint(model, con2, [t[2], 2x[2] + p, x[2]] in SecondOrderCone())
con2 : [t[2], 2 x[2] + p, x[2]] ∈ MathOptInterface.SecondOrderCone(3)
julia> @objective(model, Min, sum(t))
t[1] + t[2]
julia> optimize!(model)
ECOS 2.0.8 - (C) embotech GmbH, Zurich Switzerland, 2012-15. Web: www.embotech.com/ECOS
It pcost dcost gap pres dres k/t mu step sigma IR | BT
0 +0.000e+00 -0.000e+00 +8e+00 5e-01 1e-03 1e+00 3e+00 --- --- 1 1 - | - -
1 +3.122e-01 +3.189e-01 +1e+00 9e-02 2e-04 1e-01 4e-01 0.8656 4e-03 2 2 2 | 0 0
2 +1.126e+00 +1.136e+00 +7e-02 7e-03 9e-06 2e-02 3e-02 0.9623 4e-02 2 2 2 | 0 0
3 +1.154e+00 +1.154e+00 +8e-04 8e-05 1e-07 2e-04 3e-04 0.9890 1e-04 1 1 1 | 0 0
4 +1.154e+00 +1.154e+00 +8e-06 8e-07 1e-09 2e-06 4e-06 0.9890 1e-04 1 1 1 | 0 0
5 +1.154e+00 +1.154e+00 +9e-08 9e-09 1e-11 3e-08 4e-08 0.9890 1e-04 2 1 1 | 0 0
6 +1.154e+00 +1.154e+00 +1e-09 1e-10 1e-13 3e-10 4e-10 0.9890 1e-04 1 1 1 | 0 0
OPTIMAL (within feastol=1.0e-10, reltol=8.9e-10, abstol=1.0e-09).
Runtime: 0.000114 seconds.
julia> dual(FixRef(p))
1.1543203763939147 But that requires the user to have some pretty deep understanding of bridges, and they could do it by calling on @guilhermebodin does the error improve things enough to close this issue? |
Hi @odow, in my opinion, the new error message is instructive enough to close the issue. 👍🏻 |
Uh oh!
There was an error while loading. Please reload this page.
This code gives the following error
I was testing querying duals of parameters in some conic sets.
The text was updated successfully, but these errors were encountered: