1- import JuMP
2-
3- # struct JuMPData{T<:AbstractData} <: ModelAnalyzer.AbstractData
4- # data::T
5- # model::JuMP.Model
6- # end
1+ # Copyright (c) 2025: Joaquim Garcia, Oscar Dowson and contributors
2+ #
3+ # Use of this source code is governed by an MIT-style license that can be found
4+ # in the LICENSE.md file or at https://opensource.org/licenses/MIT.
75
8- # struct JuMPIssue{T<:AbstractIssue} <: ModelAnalyzer.AbstractIssue
9- # issue::T
10- # model::JuMP.Model
11- # end
6+ import JuMP
127
138function ModelAnalyzer. analyze (
149 analyzer:: T ,
15- model:: JuMP.Model ;
10+ model:: JuMP.GenericModel ;
1611 kwargs... ,
1712) where {T<: ModelAnalyzer.AbstractAnalyzer }
1813 moi_model = JuMP. backend (model)
@@ -21,16 +16,19 @@ function ModelAnalyzer.analyze(
2116 return result
2217end
2318
24- function ModelAnalyzer. _name (ref:: MOI.VariableIndex , model:: JuMP.Model )
25- jump_ref = JuMP. VariableRef (model, ref)
19+ function ModelAnalyzer. _name (
20+ ref:: MOI.VariableIndex ,
21+ model:: JuMP.GenericModel{T} ,
22+ ) where {T}
23+ jump_ref = JuMP. GenericVariableRef {T} (model, ref)
2624 name = JuMP. name (jump_ref)
2725 if ! isempty (name)
2826 return name
2927 end
3028 return " $jump_ref "
3129end
3230
33- function ModelAnalyzer. _name (ref:: MOI.ConstraintIndex , model:: JuMP.Model )
31+ function ModelAnalyzer. _name (ref:: MOI.ConstraintIndex , model:: JuMP.GenericModel )
3432 jump_ref = JuMP. constraint_ref_with_index (model, ref)
3533 name = JuMP. name (jump_ref)
3634 if ! isempty (name)
@@ -40,39 +38,39 @@ function ModelAnalyzer._name(ref::MOI.ConstraintIndex, model::JuMP.Model)
4038end
4139
4240"""
43- variable(issue::ModelAnalyzer.AbstractIssue, model::JuMP.Model )
41+ variable(issue::ModelAnalyzer.AbstractIssue, model::JuMP.GenericModel )
4442
4543Return the **JuMP** variable reference associated to a particular issue.
4644"""
4745function ModelAnalyzer. variable (
4846 issue:: ModelAnalyzer.AbstractIssue ,
49- model:: JuMP.Model ,
50- )
47+ model:: JuMP.GenericModel{T} ,
48+ ) where {T}
5149 ref = ModelAnalyzer. variable (issue)
52- return JuMP. VariableRef (model, ref)
50+ return JuMP. GenericVariableRef {T} (model, ref)
5351end
5452
5553"""
56- variables(issue::ModelAnalyzer.AbstractIssue, model::JuMP.Model )
54+ variables(issue::ModelAnalyzer.AbstractIssue, model::JuMP.GenericModel )
5755
5856Return the **JuMP** variable references associated to a particular issue.
5957"""
6058function ModelAnalyzer. variables (
6159 issue:: ModelAnalyzer.AbstractIssue ,
62- model:: JuMP.Model ,
63- )
60+ model:: JuMP.GenericModel{T} ,
61+ ) where {T}
6462 refs = ModelAnalyzer. variables (issue)
65- return JuMP. VariableRef .(model, refs)
63+ return JuMP. GenericVariableRef {T} .(model, refs)
6664end
6765
6866"""
69- constraint(issue::ModelAnalyzer.AbstractIssue, model::JuMP.Model )
67+ constraint(issue::ModelAnalyzer.AbstractIssue, model::JuMP.GenericModel )
7068
7169Return the **JuMP** constraint reference associated to a particular issue.
7270"""
7371function ModelAnalyzer. constraint (
7472 issue:: ModelAnalyzer.AbstractIssue ,
75- model:: JuMP.Model ,
73+ model:: JuMP.GenericModel ,
7674)
7775 ref = ModelAnalyzer. constraint (issue)
7876 return JuMP. constraint_ref_with_index (model, ref)
0 commit comments