Skip to content

Commit 626618c

Browse files
committed
Update
1 parent ac50cb2 commit 626618c

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/MathOptIIS.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,9 @@ function _dual_certificate!(
10041004
)
10051005
for (F, S) in MOI.get(model, MOI.ListOfConstraintTypesPresent())
10061006
for ci in MOI.get(model, MOI.ListOfConstraintIndices{F,S}())
1007+
# This iszero check here is rather tight. We may want to consider
1008+
# relaxing it for solvers like SCS that have some tolerance for what
1009+
# is a certificate.
10071010
if !iszero(MOI.get(model, MOI.ConstraintDual(), ci))
10081011
push!(dual_certificate, ci)
10091012
end

test/runtests.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -570,15 +570,19 @@ function test_iis_spare_scs()
570570
solver = MathOptIIS.Optimizer()
571571
MOI.set(solver, MathOptIIS.InfeasibleModel(), backend(model))
572572
MOI.set(solver, MathOptIIS.InnerOptimizer(), SCS.Optimizer)
573+
MOI.set(solver, MOI.Silent(), false)
573574
MOI.compute_conflict!(solver)
574-
data = solver.results
575-
@test length(data) == 1
576-
@test data[1].metadata === nothing
577-
@test _isequal_unordered(data[].constraints, [index(c2), index(c1)])
575+
data = only(solver.results)
576+
@test data.metadata === nothing
577+
@test _isequal_unordered(data.constraints, [index(c2), index(c1)])
578578
result = Dict(c1 => MOI.IN_CONFLICT, c2 => MOI.IN_CONFLICT)
579579
for ci in all_constraints(model; include_variable_in_set_constraints = true)
580-
@test MOI.get(solver, MOI.ConstraintConflictStatus(), index(ci)) ==
581-
get(result, ci, MOI.NOT_IN_CONFLICT)
580+
stat = MOI.get(solver, MOI.ConstraintConflictStatus(), index(ci))
581+
if haskey(result, ci)
582+
@test stat == result[ci]
583+
else
584+
@test stat != MOI.IN_CONFLICT
585+
end
582586
end
583587
return
584588
end

0 commit comments

Comments
 (0)