Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions src/Test/test_infeasibility_certificates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ for sense in (MOI.MIN_SENSE, MOI.MAX_SENSE), offset in (0, 6 // 5)
@test obj > config.atol
end
@test isapprox(T(11 // 5) * d, obj, config)
Ad = MOI.get(model, MOI.ConstraintPrimal(), c)
@test isapprox(T(13 // 10) * d, Ad, config)
if _supports(config, MOI.ConstraintPrimal)
Ad = MOI.get(model, MOI.ConstraintPrimal(), c)
@test isapprox(T(13 // 10) * d, Ad, config)
end
return
end
version_added(::typeof($(f_unbd_name))) = v"0.10.6"
Expand Down Expand Up @@ -99,17 +101,20 @@ for sense in (MOI.MIN_SENSE, MOI.MAX_SENSE), offset in (0, 6 // 5)
)
dl = MOI.get(model, MOI.ConstraintDual(), cl)
du = MOI.get(model, MOI.ConstraintDual(), cu)
obj = MOI.get(model, MOI.DualObjectiveValue())
if $sense == MOI.MIN_SENSE
@test obj > config.atol
@test isapprox(-(T(7 // 5) * dl + T(5 // 2) * du), obj, config)
else
@test obj < -config.atol
@test isapprox(T(7 // 5) * dl + T(5 // 2) * du, obj, config)
end
@test dl > config.atol
@test du < -config.atol
@test isapprox(dl + du, T(0), config)
if _supports(config, MOI.DualObjectiveValue)
obj = MOI.get(model, MOI.DualObjectiveValue())
target = T(7 // 5) * dl + T(5 // 2) * du
if $sense == MOI.MIN_SENSE
@test obj > config.atol
@test isapprox(-target, obj, config)
else
@test obj < -config.atol
@test isapprox(target, obj, config)
end
end
return
end
version_added(::typeof($(f_infeas_name))) = v"0.10.6"
Expand Down Expand Up @@ -161,17 +166,20 @@ for sense in (MOI.MIN_SENSE, MOI.MAX_SENSE), offset in (0, 6 // 5)
)
dl = MOI.get(model, MOI.ConstraintDual(), cl)
du = MOI.get(model, MOI.ConstraintDual(), cu)
obj = MOI.get(model, MOI.DualObjectiveValue())
if $sense == MOI.MIN_SENSE
@test obj > config.atol
@test isapprox(-(T(7 // 5) * dl + T(5 // 2) * du), obj, config)
else
@test obj < -config.atol
@test isapprox(T(7 // 5) * dl + T(5 // 2) * du, obj, config)
end
@test dl > config.atol
@test du < -config.atol
@test isapprox(dl + du, T(0), config)
if _supports(config, MOI.DualObjectiveValue)
obj = MOI.get(model, MOI.DualObjectiveValue())
target = T(7 // 5) * dl + T(5 // 2) * du
if $sense == MOI.MIN_SENSE
@test obj > config.atol
@test isapprox(-target, obj, config)
else
@test obj < -config.atol
@test isapprox(target, obj, config)
end
end
return
end
version_added(::typeof($(f_infeas_affine_name))) = v"0.10.6"
Expand Down