File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
src/Bridges/Objective/bridges Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 199
199
# Pretend that every model supports, and silently skip in set if unsupported
200
200
MOI. supports_fallback (:: MOI.ModelLike , :: SlackBridgePrimalDualStart ) = true
201
201
202
+ function MOI. throw_set_error_fallback (
203
+ :: MOI.ModelLike ,
204
+ :: SlackBridgePrimalDualStart ,
205
+ :: AbstractBridge ,
206
+ :: Nothing ,
207
+ )
208
+ return # Silently ignore for other bridges
209
+ end
210
+
202
211
function MOI. set (
203
212
model:: MOI.ModelLike ,
204
213
:: SlackBridgePrimalDualStart ,
Original file line number Diff line number Diff line change @@ -514,6 +514,20 @@ function test_deletion_of_variable_in_slacked_objective()
514
514
return
515
515
end
516
516
517
+ function test_SlackBridgePrimalDualStart_non_slack ()
518
+ inner = MOI. Utilities. MockOptimizer (
519
+ MOI. Utilities. UniversalFallback (MOI. Utilities. Model {Float64} ()),
520
+ )
521
+ # Should ignore without erroring
522
+ MOI. set (inner, MOI. Bridges. Objective. SlackBridgePrimalDualStart (), nothing )
523
+ model = MOI. Bridges. Objective. Functionize {Float64} (inner)
524
+ x = MOI. add_variable (model)
525
+ MOI. set (model, MOI. ObjectiveFunction {typeof(x)} (), x)
526
+ # Should ignore without erroring
527
+ MOI. set (model, MOI. Bridges. Objective. SlackBridgePrimalDualStart (), nothing )
528
+ return
529
+ end
530
+
517
531
function test_SlackBridgePrimalDualStart ()
518
532
inner = MOI. Utilities. MockOptimizer (
519
533
MOI. Utilities. UniversalFallback (MOI. Utilities. Model {Float64} ()),
You can’t perform that action at this time.
0 commit comments