Skip to content

Commit 3bde4df

Browse files
committed
Remove custom instantiate, this is now handled in MathOptIIS
1 parent 415b0d0 commit 3bde4df

3 files changed

Lines changed: 8 additions & 28 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ MathOptAnalyzerJuMPExt = "JuMP"
1818
[compat]
1919
Dualization = "0.6"
2020
JuMP = "1.24"
21-
MathOptIIS = "0.1.1, 0.2"
21+
MathOptIIS = "0.2"
2222
MathOptInterface = "1.37"
2323
julia = "1.10"

src/Infeasibility/Infeasibility.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
module Infeasibility
77

88
import MathOptAnalyzer
9-
import MathOptIIS as MOIIS
9+
import MathOptIIS
1010
import MathOptInterface as MOI
1111

1212
include("structs.jl")

src/Infeasibility/analyze.jl

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Use of this source code is governed by an MIT-style license that can be found
44
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
55

6-
function _add_result(out::Data, model, iis, meta::MOIIS.BoundsData)
6+
function _add_result(out::Data, model, iis, meta::MathOptIIS.BoundsData)
77
@assert length(iis.constraints) == 2
88
err = InfeasibleBounds{Float64}(
99
MOI.get(model, MOI.ConstraintFunction(), iis.constraints[1]),
@@ -14,7 +14,7 @@ function _add_result(out::Data, model, iis, meta::MOIIS.BoundsData)
1414
return
1515
end
1616

17-
function _add_result(out::Data, model, iis, meta::MOIIS.IntegralityData)
17+
function _add_result(out::Data, model, iis, meta::MathOptIIS.IntegralityData)
1818
@assert length(iis.constraints) >= 2
1919
err = InfeasibleIntegrality{Float64}(
2020
MOI.get(model, MOI.ConstraintFunction(), iis.constraints[1]),
@@ -26,7 +26,7 @@ function _add_result(out::Data, model, iis, meta::MOIIS.IntegralityData)
2626
return
2727
end
2828

29-
function _add_result(out::Data, model, iis, meta::MOIIS.RangeData)
29+
function _add_result(out::Data, model, iis, meta::MOMathOptIISIIS.RangeData)
3030
@assert length(iis.constraints) >= 1
3131
for con in iis.constraints
3232
if con isa MOI.ConstraintIndex{MOI.VariableIndex}
@@ -49,35 +49,15 @@ function _add_result(out::Data, model, iis, meta)
4949
return
5050
end
5151

52-
function _instantiate_with_modify(optimizer, ::Type{T}) where {T}
53-
model = MOI.instantiate(optimizer)
54-
if !MOI.supports_incremental_interface(model)
55-
# Don't use `default_cache` for the cache because, for example, SCS's
56-
# default cache doesn't support modifying coefficients of the constraint
57-
# matrix. JuMP uses the default cache with SCS because it has an outer
58-
# layer of caching; we don't have that here, so we can't use the
59-
# default.
60-
#
61-
# We could revert to using the default cache if we fix this in MOI.
62-
cache = MOI.Utilities.UniversalFallback(MOI.Utilities.Model{T}())
63-
model = MOI.Utilities.CachingOptimizer(cache, model)
64-
end
65-
return MOI.Bridges.full_bridge_optimizer(model, T)
66-
end
67-
6852
function MathOptAnalyzer.analyze(
6953
::Analyzer,
7054
model::MOI.ModelLike;
7155
optimizer = nothing,
7256
)
73-
solver = MOIIS.Optimizer()
74-
MOI.set(solver, MOIIS.InfeasibleModel(), model)
57+
solver = MathOptIIS.Optimizer()
58+
MOI.set(solver, MathOptIIS.InfeasibleModel(), model)
7559
if optimizer !== nothing
76-
MOI.set(
77-
solver,
78-
MOIIS.InnerOptimizer(),
79-
() -> _instantiate_with_modify(optimizer, Float64),
80-
)
60+
MOI.set(solver, MathOptIIS.InnerOptimizer(), optimizer)
8161
end
8262
MOI.compute_conflict!(solver)
8363
out = Data()

0 commit comments

Comments
 (0)