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

[Bridges] bug with multiple variable bounds #2375

Closed
odow opened this issue Dec 22, 2023 · 2 comments · Fixed by #2357
Closed

[Bridges] bug with multiple variable bounds #2375

odow opened this issue Dec 22, 2023 · 2 comments · Fixed by #2357
Labels
Submodule: Bridges About the Bridges submodule Type: Bug

Comments

@odow
Copy link
Member

odow commented Dec 22, 2023

x-ref #2357

julia> import MathOptInterface as MOI

julia> include("test/Bridges/sdpa_models.jl")

julia> model =
           MOI.instantiate(GeometricSDPAModel{Float64}; with_bridge_type = Float64);

julia> x = MOI.add_variable(model)
MOI.VariableIndex(1)

julia> set2 = MOI.GreaterThan(0.0)
MathOptInterface.GreaterThan{Float64}(0.0)

julia> set1  = MOI.EqualTo(0.0)
MathOptInterface.EqualTo{Float64}(0.0)

julia> ci = MOI.add_constraint(model, x, set1)
MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}(1)

julia> print(model)
Feasibility

Subject to:

VariableIndex-in-EqualTo{Float64}
 v[1] == 0.0

julia> ci = MOI.add_constraint(model, x, set1)
MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}(1)

julia> print(model)
Feasibility

Subject to:

VectorAffineFunction{Float64}-in-Zeros
 ┌               ┐
 │-0.0 + 1.0 v[1]│
 └               ┘  Zeros(1)

VariableIndex-in-EqualTo{Float64}
 v[1] == 0.0

julia> MOI.delete(model, ci)
Dict{MathOptInterface.ConstraintIndex, String}()

julia> print(model)
Feasibility

Subject to:

VectorAffineFunction{Float64}-in-Zeros
 ┌               ┐
 │-0.0 + 1.0 v[1]│
 └               ┘  Zeros(1)
@odow odow added Type: Bug Submodule: Bridges About the Bridges submodule labels Dec 22, 2023
@blegat
Copy link
Member

blegat commented Dec 22, 2023

Also, MOI.delete shouldn't return a Dict, it should return nothing

@odow
Copy link
Member Author

odow commented Dec 22, 2023

Yip. Fixed in #2357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Submodule: Bridges About the Bridges submodule Type: Bug
Development

Successfully merging a pull request may close this issue.

2 participants