Skip to content

Commit 3323c68

Browse files
committed
Add a test that failed in MathOptAnalyzer
1 parent 92cfb71 commit 3323c68

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

test/runtests.jl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,34 @@ function test_iis_spare()
555555
return
556556
end
557557

558+
function test_iis_spare_scs()
559+
model = Model(SCS.Optimizer)
560+
set_silent(model)
561+
@variable(model, 0 <= x <= 10)
562+
@variable(model, 0 <= y <= 20)
563+
@variable(model, 0 <= z <= 20)
564+
@constraint(model, c0, 2z <= 1)
565+
@constraint(model, c00, 3z <= 1)
566+
@constraint(model, c1, x + y <= 1)
567+
@constraint(model, c2, x + y >= 2)
568+
@objective(model, Max, x + y)
569+
optimize!(model)
570+
solver = MathOptIIS.Optimizer()
571+
MOI.set(solver, MathOptIIS.InfeasibleModel(), backend(model))
572+
MOI.set(solver, MathOptIIS.InnerOptimizer(), HiGHS.Optimizer)
573+
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)])
578+
result = Dict(c1 => MOI.IN_CONFLICT, c2 => MOI.IN_CONFLICT)
579+
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)
582+
end
583+
return
584+
end
585+
558586
function test_iis_binary()
559587
model = Model(HiGHS.Optimizer)
560588
set_silent(model)

0 commit comments

Comments
 (0)