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 (
7+ out:: Data ,
8+ model,
9+ iis,
10+ meta:: MathOptIIS.Metadata{T,Nothing} ,
11+ ) where {T}
712 @assert length (iis. constraints) == 2
8- err = InfeasibleBounds {Float64 } (
13+ err = InfeasibleBounds {T } (
914 MOI. get (model, MOI. ConstraintFunction (), iis. constraints[1 ]),
1015 meta. lower_bound,
1116 meta. upper_bound,
@@ -14,9 +19,14 @@ function _add_result(out::Data, model, iis, meta::MOIIS.BoundsData)
1419 return
1520end
1621
17- function _add_result (out:: Data , model, iis, meta:: MOIIS.IntegralityData )
22+ function _add_result (
23+ out:: Data ,
24+ model,
25+ iis,
26+ meta:: MathOptIIS.Metadata{T,S} ,
27+ ) where {T,S<: Union{MOI.Integer,MOI.ZeroOne} }
1828 @assert length (iis. constraints) >= 2
19- err = InfeasibleIntegrality {Float64 } (
29+ err = InfeasibleIntegrality {T } (
2030 MOI. get (model, MOI. ConstraintFunction (), iis. constraints[1 ]),
2131 meta. lower_bound,
2232 meta. upper_bound,
@@ -26,13 +36,18 @@ function _add_result(out::Data, model, iis, meta::MOIIS.IntegralityData)
2636 return
2737end
2838
29- function _add_result (out:: Data , model, iis, meta:: MOIIS.RangeData )
39+ function _add_result (
40+ out:: Data ,
41+ model,
42+ iis,
43+ meta:: MathOptIIS.Metadata{T,S} ,
44+ ) where {T,S<: MOI.AbstractSet }
3045 @assert length (iis. constraints) >= 1
3146 for con in iis. constraints
3247 if con isa MOI. ConstraintIndex{MOI. VariableIndex}
3348 continue
3449 end
35- err = InfeasibleConstraintRange {Float64 } (
50+ err = InfeasibleConstraintRange {T } (
3651 con,
3752 meta. lower_bound,
3853 meta. upper_bound,
@@ -49,35 +64,15 @@ function _add_result(out::Data, model, iis, meta)
4964 return
5065end
5166
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-
6867function MathOptAnalyzer. analyze (
6968 :: Analyzer ,
7069 model:: MOI.ModelLike ;
7170 optimizer = nothing ,
7271)
73- solver = MOIIS . Optimizer ()
74- MOI. set (solver, MOIIS . InfeasibleModel (), model)
72+ solver = MathOptIIS . Optimizer ()
73+ MOI. set (solver, MathOptIIS . InfeasibleModel (), model)
7574 if optimizer != = nothing
76- MOI. set (
77- solver,
78- MOIIS. InnerOptimizer (),
79- () -> _instantiate_with_modify (optimizer, Float64),
80- )
75+ MOI. set (solver, MathOptIIS. InnerOptimizer (), optimizer)
8176 end
8277 MOI. compute_conflict! (solver)
8378 out = Data ()
0 commit comments