Skip to content

Commit ceccb9f

Browse files
committed
cleanup api
1 parent 5ecd302 commit ceccb9f

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/ModelAnalyzer.jl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,14 @@ Return the value associated to a particular issue. The value is a number
143143
with a different meaning depending on the type of issue. For example, for
144144
some numerical issues, it can be the coefficient value.
145145
"""
146-
function value(issue::AbstractIssue, ::MOI.ModelLike)
147-
return value(issue)
148-
end
146+
function value end
149147

150148
"""
151149
values(issue::AbstractIssue)
152150
153151
Return the values associated to a particular issue.
154152
"""
155-
function values(issue::AbstractIssue, ::MOI.ModelLike)
156-
return values(issue)
157-
end
153+
function values end
158154

159155
"""
160156
variable(issue::AbstractIssue)
@@ -197,9 +193,7 @@ end
197193
198194
Return the set associated to a particular issue.
199195
"""
200-
function set(issue::AbstractIssue, ::MOI.ModelLike)
201-
return set(issue)
202-
end
196+
function set end
203197

204198
function _verbose_summarize end
205199

test/infeasibility.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,9 @@ function test_iis_interval_left()
481481
iis = ModelAnalyzer.constraints(ret[], model)
482482
@test length(iis) == 2
483483
@test Set(iis) == Set([c2, c1])
484+
iis = ModelAnalyzer.constraints(ret[], JuMP.backend(model))
485+
@test length(iis) == 2
486+
@test Set(iis) == Set(JuMP.index.([c2, c1]))
484487
return
485488
end
486489

test/numerical.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ function test_dense_constraint()
367367
)
368368
@test length(ret) == 1
369369
@test ModelAnalyzer.constraint(ret[]) == JuMP.index(c)
370+
@test ModelAnalyzer.constraint(ret[], JuMP.backend(model)) == JuMP.index(c)
370371
@test ModelAnalyzer.constraint(ret[], model) == c
371372
@test ModelAnalyzer.value(ret[]) == 10_000
372373
#
@@ -405,6 +406,7 @@ function test_small_matrix_coef()
405406
@test length(ret) == 1
406407
@test ModelAnalyzer.constraint(ret[], model) == c
407408
@test ModelAnalyzer.variable(ret[], model) == x
409+
@test ModelAnalyzer.variable(ret[], JuMP.backend(model)) == JuMP.index(x)
408410
@test ModelAnalyzer.value(ret[]) == 1e-9
409411
#
410412
buf = IOBuffer()
@@ -713,6 +715,8 @@ function test_small_objective_coef_quad()
713715
)
714716
@test length(ret) == 1
715717
@test ModelAnalyzer.variables(ret[], model) == [x, x]
718+
@test ModelAnalyzer.variables(ret[], JuMP.backend(model)) ==
719+
JuMP.index.([x, x])
716720
@test_broken ModelAnalyzer.value(ret[]) == 1e-9 # 2e-9 TODO, what to return here
717721
#
718722
buf = IOBuffer()

0 commit comments

Comments
 (0)