@@ -37,6 +37,8 @@ function test_bounds()
37
37
2.0 ,
38
38
1.0 ,
39
39
)
40
+ @test ModelAnalyzer. variable (ret[], model) == y
41
+ @test ModelAnalyzer. values (ret[]) == [2.0 , 1.0 ]
40
42
#
41
43
buf = IOBuffer ()
42
44
ModelAnalyzer. summarize (
@@ -82,6 +84,9 @@ function test_integrality()
82
84
2.9 ,
83
85
MOI. Integer (),
84
86
)
87
+ @test ModelAnalyzer. variable (ret[], model) == y
88
+ @test ModelAnalyzer. values (ret[]) == [2.2 , 2.9 ]
89
+ @test ModelAnalyzer. set (ret[]) == MOI. Integer ()
85
90
#
86
91
buf = IOBuffer ()
87
92
ModelAnalyzer. summarize (
@@ -129,6 +134,9 @@ function test_binary()
129
134
0.8 ,
130
135
MOI. ZeroOne (),
131
136
)
137
+ @test ModelAnalyzer. variable (ret[], model) == x
138
+ @test ModelAnalyzer. values (ret[]) == [0.5 , 0.8 ]
139
+ @test ModelAnalyzer. set (ret[]) == MOI. ZeroOne ()
132
140
return
133
141
end
134
142
@@ -150,6 +158,9 @@ function test_range()
150
158
22.0 ,
151
159
MOI. LessThan {Float64} (1.0 ),
152
160
)
161
+ @test ModelAnalyzer. constraint (ret[], model) == c
162
+ @test ModelAnalyzer. values (ret[]) == [11.0 , 22.0 ]
163
+ @test ModelAnalyzer. set (ret[]) == MOI. LessThan {Float64} (1.0 )
153
164
#
154
165
buf = IOBuffer ()
155
166
ModelAnalyzer. summarize (
@@ -198,6 +209,9 @@ function test_range_neg()
198
209
22.0 ,
199
210
MOI. LessThan {Float64} (1.0 ),
200
211
)
212
+ @test ModelAnalyzer. constraint (ret[], model) == c
213
+ @test ModelAnalyzer. values (ret[]) == [11.0 , 22.0 ]
214
+ @test ModelAnalyzer. set (ret[]) == MOI. LessThan {Float64} (1.0 )
201
215
return
202
216
end
203
217
@@ -219,6 +233,9 @@ function test_range_equalto()
219
233
3.0 ,
220
234
MOI. EqualTo {Float64} (1.0 ),
221
235
)
236
+ @test ModelAnalyzer. constraint (ret[], model) == c
237
+ @test ModelAnalyzer. values (ret[]) == [3.0 , 3.0 ]
238
+ @test ModelAnalyzer. set (ret[]) == MOI. EqualTo {Float64} (1.0 )
222
239
return
223
240
end
224
241
@@ -240,6 +257,9 @@ function test_range_equalto_2()
240
257
7.0 ,
241
258
MOI. EqualTo {Float64} (1.0 ),
242
259
)
260
+ @test ModelAnalyzer. constraint (ret[], model) == c
261
+ @test ModelAnalyzer. values (ret[]) == [7.0 , 7.0 ]
262
+ @test ModelAnalyzer. set (ret[]) == MOI. EqualTo {Float64} (1.0 )
243
263
return
244
264
end
245
265
@@ -261,6 +281,9 @@ function test_range_greaterthan()
261
281
22.0 ,
262
282
MOI. GreaterThan {Float64} (100.0 ),
263
283
)
284
+ @test ModelAnalyzer. constraint (ret[], model) == c
285
+ @test ModelAnalyzer. values (ret[]) == [11.0 , 22.0 ]
286
+ @test ModelAnalyzer. set (ret[]) == MOI. GreaterThan {Float64} (100.0 )
264
287
return
265
288
end
266
289
@@ -282,6 +305,9 @@ function test_range_equalto_3()
282
305
22.0 ,
283
306
MOI. EqualTo {Float64} (100.0 ),
284
307
)
308
+ @test ModelAnalyzer. constraint (ret[], model) == c
309
+ @test ModelAnalyzer. values (ret[]) == [11.0 , 22.0 ]
310
+ @test ModelAnalyzer. set (ret[]) == MOI. EqualTo {Float64} (100.0 )
285
311
return
286
312
end
287
313
@@ -326,6 +352,9 @@ function test_iis()
326
352
@test length (ret[]. constraint) == 2
327
353
@test Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]]) ==
328
354
Set (JuMP. index .([c2, c1]))
355
+ iis = ModelAnalyzer. constraints (ret[], model)
356
+ @test length (iis) == 2
357
+ @test Set (iis) == Set ([c2, c1])
329
358
#
330
359
buf = IOBuffer ()
331
360
ModelAnalyzer. summarize (
@@ -388,6 +417,10 @@ function test_iis_multiple()
388
417
@test JuMP. index (c2) in Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]])
389
418
@test Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]]) ⊆
390
419
Set (JuMP. index .([c3, c2, c1]))
420
+ iis = ModelAnalyzer. constraints (ret[], model)
421
+ @test length (iis) == 2
422
+ @test Set (iis) ⊆ Set ([c3, c2, c1])
423
+ @test c2 in iis
391
424
return
392
425
end
393
426
@@ -415,6 +448,9 @@ function test_iis_interval_right()
415
448
@test length (ret[]. constraint) == 2
416
449
@test Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]]) ==
417
450
Set (JuMP. index .([c2, c1]))
451
+ iis = ModelAnalyzer. constraints (ret[], model)
452
+ @test length (iis) == 2
453
+ @test Set (iis) == Set ([c2, c1])
418
454
return
419
455
end
420
456
@@ -442,6 +478,9 @@ function test_iis_interval_left()
442
478
@test length (ret[]. constraint) == 2
443
479
@test Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]]) ==
444
480
Set (JuMP. index .([c2, c1]))
481
+ iis = ModelAnalyzer. constraints (ret[], model)
482
+ @test length (iis) == 2
483
+ @test Set (iis) == Set ([c2, c1])
445
484
return
446
485
end
447
486
@@ -472,6 +511,9 @@ function test_iis_spare()
472
511
@test length (ret[]. constraint) == 2
473
512
@test Set ([ret[]. constraint[1 ], ret[]. constraint[2 ]]) ==
474
513
Set (JuMP. index .([c2, c1]))
514
+ iis = ModelAnalyzer. constraints (ret[], model)
515
+ @test length (iis) == 2
516
+ @test Set (iis) == Set ([c2, c1])
475
517
return
476
518
end
477
519
0 commit comments