@@ -885,16 +885,11 @@ function test_solve_conflict_bound_bound(
885
885
) where {T}
886
886
@requires _supports (config, MOI. compute_conflict!)
887
887
@requires _supports (config, MOI. optimize!)
888
- try
889
- MOI. get (model, MOI. ConflictStatus ())
890
- catch
891
- return # If this fails, skip the test.
892
- end
893
888
x = MOI. add_variable (model)
894
889
c1 = MOI. add_constraint (model, x, MOI. GreaterThan (T (2 )))
895
890
c2 = MOI. add_constraint (model, x, MOI. LessThan (T (1 )))
896
- @test MOI. get (model, MOI. ConflictStatus ()) ==
897
- MOI. COMPUTE_CONFLICT_NOT_CALLED
891
+ status = MOI. get (model, MOI. ConflictStatus ())
892
+ @test status == MOI. COMPUTE_CONFLICT_NOT_CALLED
898
893
MOI. optimize! (model)
899
894
@test MOI. get (model, MOI. TerminationStatus ()) == config. infeasible_status
900
895
MOI. compute_conflict! (model)
@@ -941,11 +936,6 @@ function test_solve_conflict_two_affine(
941
936
) where {T}
942
937
@requires _supports (config, MOI. compute_conflict!)
943
938
@requires _supports (config, MOI. optimize!)
944
- try
945
- MOI. get (model, MOI. ConflictStatus ())
946
- catch
947
- return # If this fails, skip the test.
948
- end
949
939
x = MOI. add_variable (model)
950
940
c1 = MOI. add_constraint (
951
941
model,
@@ -957,8 +947,8 @@ function test_solve_conflict_two_affine(
957
947
MOI. ScalarAffineFunction (MOI. ScalarAffineTerm .(T (1 ), [x]), T (0 )),
958
948
MOI. LessThan (T (1 )),
959
949
)
960
- @test MOI. get (model, MOI. ConflictStatus ()) ==
961
- MOI. COMPUTE_CONFLICT_NOT_CALLED
950
+ status = MOI. get (model, MOI. ConflictStatus ())
951
+ @test status == MOI. COMPUTE_CONFLICT_NOT_CALLED
962
952
MOI. optimize! (model)
963
953
@test MOI. get (model, MOI. TerminationStatus ()) == config. infeasible_status
964
954
MOI. compute_conflict! (model)
@@ -1005,15 +995,10 @@ function test_solve_conflict_invalid_interval(
1005
995
) where {T}
1006
996
@requires _supports (config, MOI. compute_conflict!)
1007
997
@requires _supports (config, MOI. optimize!)
1008
- try
1009
- MOI. get (model, MOI. ConflictStatus ())
1010
- catch
1011
- return # If this fails, skip the test.
1012
- end
1013
998
x = MOI. add_variable (model)
1014
999
c1 = MOI. add_constraint (model, x, MOI. Interval (T (1 ), T (0 )))
1015
- @test MOI. get (model, MOI. ConflictStatus ()) ==
1016
- MOI. COMPUTE_CONFLICT_NOT_CALLED
1000
+ status = MOI. get (model, MOI. ConflictStatus ())
1001
+ @test status == MOI. COMPUTE_CONFLICT_NOT_CALLED
1017
1002
MOI. optimize! (model)
1018
1003
@test MOI. get (model, MOI. TerminationStatus ()) == config. infeasible_status
1019
1004
MOI. compute_conflict! (model)
@@ -1057,11 +1042,6 @@ function test_solve_conflict_affine_affine(
1057
1042
) where {T}
1058
1043
@requires _supports (config, MOI. compute_conflict!)
1059
1044
@requires _supports (config, MOI. optimize!)
1060
- try
1061
- MOI. get (model, MOI. ConflictStatus ())
1062
- catch
1063
- return # If this fails, skip the test.
1064
- end
1065
1045
x = MOI. add_variable (model)
1066
1046
y = MOI. add_variable (model)
1067
1047
b1 = MOI. add_constraint (model, x, MOI. GreaterThan (T (0 )))
@@ -1071,8 +1051,8 @@ function test_solve_conflict_affine_affine(
1071
1051
cf2 =
1072
1052
MOI. ScalarAffineFunction (MOI. ScalarAffineTerm .(T[1 , - 1 ], [x, y]), T (0 ))
1073
1053
c2 = MOI. add_constraint (model, cf2, MOI. GreaterThan (T (1 )))
1074
- @test MOI. get (model, MOI. ConflictStatus ()) ==
1075
- MOI. COMPUTE_CONFLICT_NOT_CALLED
1054
+ status = MOI. get (model, MOI. ConflictStatus ())
1055
+ @test status == MOI. COMPUTE_CONFLICT_NOT_CALLED
1076
1056
MOI. optimize! (model)
1077
1057
@test MOI. get (model, MOI. TerminationStatus ()) == config. infeasible_status
1078
1058
MOI. compute_conflict! (model)
@@ -1124,11 +1104,6 @@ function test_solve_conflict_EqualTo(
1124
1104
) where {T}
1125
1105
@requires _supports (config, MOI. compute_conflict!)
1126
1106
@requires _supports (config, MOI. optimize!)
1127
- try
1128
- MOI. get (model, MOI. ConflictStatus ())
1129
- catch
1130
- return # If this fails, skip the test.
1131
- end
1132
1107
x = MOI. add_variable (model)
1133
1108
y = MOI. add_variable (model)
1134
1109
b1 = MOI. add_constraint (model, x, MOI. GreaterThan (T (0 )))
@@ -1138,8 +1113,8 @@ function test_solve_conflict_EqualTo(
1138
1113
cf2 =
1139
1114
MOI. ScalarAffineFunction (MOI. ScalarAffineTerm .(T[1 , - 1 ], [x, y]), T (0 ))
1140
1115
c2 = MOI. add_constraint (model, cf2, MOI. GreaterThan (T (1 )))
1141
- @test MOI. get (model, MOI. ConflictStatus ()) ==
1142
- MOI. COMPUTE_CONFLICT_NOT_CALLED
1116
+ status = MOI. get (model, MOI. ConflictStatus ())
1117
+ @test status == MOI. COMPUTE_CONFLICT_NOT_CALLED
1143
1118
MOI. optimize! (model)
1144
1119
@test MOI. get (model, MOI. TerminationStatus ()) == config. infeasible_status
1145
1120
MOI. compute_conflict! (model)
@@ -1191,11 +1166,6 @@ function test_solve_conflict_NOT_IN_CONFLICT(
1191
1166
) where {T}
1192
1167
@requires _supports (config, MOI. compute_conflict!)
1193
1168
@requires _supports (config, MOI. optimize!)
1194
- try
1195
- MOI. get (model, MOI. ConflictStatus ())
1196
- catch
1197
- return # If this fails, skip the test.
1198
- end
1199
1169
x = MOI. add_variable (model)
1200
1170
y = MOI. add_variable (model)
1201
1171
z = MOI. add_variable (model)
@@ -1210,8 +1180,8 @@ function test_solve_conflict_NOT_IN_CONFLICT(
1210
1180
T (0 ),
1211
1181
)
1212
1182
c2 = MOI. add_constraint (model, cf2, MOI. GreaterThan (T (1 )))
1213
- @test MOI. get (model, MOI. ConflictStatus ()) ==
1214
- MOI. COMPUTE_CONFLICT_NOT_CALLED
1183
+ status = MOI. get (model, MOI. ConflictStatus ())
1184
+ @test status == MOI. COMPUTE_CONFLICT_NOT_CALLED
1215
1185
MOI. optimize! (model)
1216
1186
@test MOI. get (model, MOI. TerminationStatus ()) == config. infeasible_status
1217
1187
MOI. compute_conflict! (model)
@@ -1268,17 +1238,12 @@ function test_solve_conflict_feasible(
1268
1238
) where {T}
1269
1239
@requires _supports (config, MOI. compute_conflict!)
1270
1240
@requires _supports (config, MOI. optimize!)
1271
- try
1272
- MOI. get (model, MOI. ConflictStatus ())
1273
- catch
1274
- return # If this fails, skip the test.
1275
- end
1276
1241
x = MOI. add_variable (model)
1277
1242
f = MOI. ScalarAffineFunction ([MOI. ScalarAffineTerm (T (1 ), x)], T (0 ))
1278
1243
_ = MOI. add_constraint (model, f, MOI. GreaterThan (T (1 )))
1279
1244
_ = MOI. add_constraint (model, f, MOI. LessThan (T (2 )))
1280
- @test MOI. get (model, MOI. ConflictStatus ()) ==
1281
- MOI. COMPUTE_CONFLICT_NOT_CALLED
1245
+ status = MOI. get (model, MOI. ConflictStatus ())
1246
+ @test status == MOI. COMPUTE_CONFLICT_NOT_CALLED
1282
1247
MOI. optimize! (model)
1283
1248
@test MOI. get (model, MOI. TerminationStatus ()) == config. optimal_status
1284
1249
MOI. compute_conflict! (model)
@@ -1317,17 +1282,14 @@ function test_solve_conflict_zeroone(
1317
1282
) where {T}
1318
1283
@requires _supports (config, MOI. compute_conflict!)
1319
1284
@requires _supports (config, MOI. optimize!)
1320
- try
1321
- MOI. get (model, MOI. ConflictStatus ())
1322
- catch
1323
- return # If this fails, skip the test.
1324
- end
1325
1285
x, c1 = MOI. add_constrained_variable (model, MOI. ZeroOne ())
1326
1286
c2 = MOI. add_constraint (
1327
1287
model,
1328
1288
MOI. ScalarAffineFunction (MOI. ScalarAffineTerm .(T (1 ), [x]), T (0 )),
1329
1289
MOI. GreaterThan (T (2 )),
1330
1290
)
1291
+ status = MOI. get (model, MOI. ConflictStatus ())
1292
+ @test status == MOI. COMPUTE_CONFLICT_NOT_CALLED
1331
1293
MOI. optimize! (model)
1332
1294
@test MOI. get (model, MOI. TerminationStatus ()) == config. infeasible_status
1333
1295
MOI. compute_conflict! (model)
@@ -1378,17 +1340,14 @@ function test_solve_conflict_zeroone_2(
1378
1340
@requires (T (1 ) / T (2 )) isa T
1379
1341
@requires _supports (config, MOI. compute_conflict!)
1380
1342
@requires _supports (config, MOI. optimize!)
1381
- try
1382
- MOI. get (model, MOI. ConflictStatus ())
1383
- catch
1384
- return # If this fails, skip the test.
1385
- end
1386
1343
x, c1 = MOI. add_constrained_variable (model, MOI. ZeroOne ())
1387
1344
c2 = MOI. add_constraint (
1388
1345
model,
1389
1346
MOI. ScalarAffineFunction (MOI. ScalarAffineTerm .(T (1 ), [x]), T (0 )),
1390
1347
MOI. EqualTo (T (1 ) / T (2 )),
1391
1348
)
1349
+ status = MOI. get (model, MOI. ConflictStatus ())
1350
+ @test status == MOI. COMPUTE_CONFLICT_NOT_CALLED
1392
1351
MOI. optimize! (model)
1393
1352
@test MOI. get (model, MOI. TerminationStatus ()) == config. infeasible_status
1394
1353
MOI. compute_conflict! (model)
0 commit comments