@@ -1310,66 +1310,63 @@ const MOIU = MOI.Utilities
13101310const MOIB = MOI. Bridges
13111311
13121312import FooBar
1313- const optimizer = FooBar. Optimizer ( )
1314- MOI . set (optimizer, MOI. Silent (), true )
1313+ const OPTIMIZER_CONSTRUCTOR = MOI . OptimizerWithAttributes ( FooBar. Optimizer, MOI . Silent () => true )
1314+ const OPTIMIZER = MOI. instantiate (OPTIMIZER_CONSTRUCTOR )
13151315
13161316@testset " SolverName" begin
1317- @test MOI. get (optimizer , MOI. SolverName ()) == " FooBar"
1317+ @test MOI. get (OPTIMIZER , MOI. SolverName ()) == " FooBar"
13181318end
13191319
13201320@testset " supports_default_copy_to" begin
1321- @test MOIU. supports_default_copy_to (optimizer , false )
1321+ @test MOIU. supports_default_copy_to (OPTIMIZER , false )
13221322 # Use `@test !...` if names are not supported
1323- @test MOIU. supports_default_copy_to (optimizer , true )
1323+ @test MOIU. supports_default_copy_to (OPTIMIZER , true )
13241324end
13251325
1326- const bridged = MOIB . full_bridge_optimizer (optimizer, Float64)
1327- const config = MOIT. TestConfig (atol= 1e-6 , rtol= 1e-6 )
1326+ const BRIDGED = MOI . instantiate (OPTIMIZER_CONSTRUCTOR, with_bridge_type = Float64)
1327+ const CONFIG = MOIT. TestConfig (atol= 1e-6 , rtol= 1e-6 )
13281328
13291329@testset " Unit" begin
1330- MOIT. unittest (bridged, config )
1330+ MOIT. unittest (BRIDGED, CONFIG )
13311331end
13321332
13331333@testset " Modification" begin
1334- MOIT. modificationtest (bridged, config )
1334+ MOIT. modificationtest (BRIDGED, CONFIG )
13351335end
13361336
13371337@testset " Continuous Linear" begin
1338- MOIT. contlineartest (bridged, config )
1338+ MOIT. contlineartest (BRIDGED, CONFIG )
13391339end
13401340
13411341@testset " Continuous Conic" begin
1342- MOIT. contlineartest (bridged, config )
1342+ MOIT. contlineartest (BRIDGED, CONFIG )
13431343end
13441344
13451345@testset " Integer Conic" begin
1346- MOIT. intconictest (bridged, config )
1346+ MOIT. intconictest (BRIDGED, CONFIG )
13471347end
13481348```
1349- The optimizer ` bridged ` constructed with [ ` Bridges.full_bridge_optimizer ` ] ( @ref )
1350- automatically bridges constraints that are not supported by ` optimizer `
1349+ The optimizer ` BRIDGED ` constructed with [ ` instantiate ` ] ( @ref )
1350+ automatically bridges constraints that are not supported by ` OPTIMIZER `
13511351using the bridges listed in [ Bridges] ( @ref ) . It is recommended for an
13521352implementation of MOI to only support constraints that are natively supported
13531353by the solver and let bridges transform the constraint to the appropriate form.
1354- For this reason it is expected that tests may not pass if ` optimizer ` is used
1355- instead of ` bridged ` .
1354+ For this reason it is expected that tests may not pass if ` OPTIMIZER ` is used
1355+ instead of ` BRIDGED ` .
13561356
13571357To test that a specific problem can be solved without bridges, a specific test can
1358- be run with ` optimizer ` instead of ` bridged ` . For instance
1358+ be run with ` OPTIMIZER ` instead of ` BRIDGED ` . For instance
13591359``` julia
13601360@testset " Interval constraints" begin
1361- MOIT. linear10test (optimizer, config )
1361+ MOIT. linear10test (OPTIMIZER, CONFIG )
13621362end
13631363```
1364- checks that ` optimizer ` implements support for
1364+ checks that ` OPTIMIZER ` implements support for
13651365[ ` ScalarAffineFunction ` ] ( @ref ) -in-[ ` Interval ` ] ( @ref ) .
13661366
1367- If the wrapper does not support building the model incrementally (i.e. with ` add_variable ` and ` add_constraint ` ), then ` supports_default_copy_to ` can be replaced by ` supports_allocate_load ` if appropriate (see [ Implementing copy] ( @ref ) ) and the line ` const bridged = ... ` can be replaced with
1368- ``` julia
1369- const cache = MOIU. UniversalFallback (MOIU. Model {Float64} ())
1370- const cached = MOIU. CachingOptimizer (cache, optimizer)
1371- const bridged = MOIB. full_bridge_optimizer (cached, Float64)
1372- ```
1367+ If the wrapper does not support building the model incrementally (i.e. with ` add_variable ` and ` add_constraint ` ),
1368+ then ` supports_default_copy_to ` can be replaced by ` supports_allocate_load ` if
1369+ appropriate (see [ Implementing copy] ( @ref ) ).
13731370
13741371### Benchmarking
13751372
0 commit comments