|
450 | 450 | ) == 1 |
451 | 451 | end |
452 | 452 |
|
| 453 | +@testset "ComplementsWithSetType dimension" begin |
| 454 | + s = MathOptComplements.ComplementsWithSetType{MOI.Nonnegatives}(4) |
| 455 | + @test MOI.dimension(s) == 4 |
| 456 | +end |
| 457 | + |
| 458 | +@testset "Optimizer bridge dispatch" begin |
| 459 | + # NLP path: VectorAffineFunction in ComplementsWithSetType → NonlinearBridge |
| 460 | + opt_nlp = MathOptComplements.Optimizer( |
| 461 | + MOI.Utilities.UniversalFallback(MOI.Utilities.Model{Float64}()), |
| 462 | + ) |
| 463 | + S = MathOptComplements.ComplementsWithSetType{MOI.Nonnegatives} |
| 464 | + @test MOI.Bridges.is_bridged(opt_nlp, S) |
| 465 | + @test MOI.Bridges.supports_bridging_constrained_variable(opt_nlp, S) |
| 466 | + @test MOI.Bridges.bridge_type(opt_nlp, MOI.VectorAffineFunction{Float64}, S) == |
| 467 | + MathOptComplements.Bridges.NonlinearBridge{Float64,MOI.Nonnegatives} |
| 468 | + # SOS1 path: VectorOfVariables in ComplementsWithSetType{Zeros} → ToSOS1Bridge |
| 469 | + opt_sos1 = MathOptComplements.Optimizer( |
| 470 | + MOI.Bridges.full_bridge_optimizer(HiGHS.Optimizer(), Float64), |
| 471 | + ) |
| 472 | + S_zeros = MathOptComplements.ComplementsWithSetType{MOI.Zeros} |
| 473 | + @test MOI.Bridges.bridge_type(opt_sos1, MOI.VectorOfVariables, S_zeros) == |
| 474 | + MathOptComplements.Bridges.ToSOS1Bridge{Float64} |
| 475 | +end |
| 476 | + |
453 | 477 | @testset "ComplementarityReformulation supports on bridge types" begin |
454 | 478 | model = MOI.Utilities.UniversalFallback(MOI.Utilities.Model{Float64}()) |
455 | 479 | attr = MathOptComplements.ComplementarityReformulation() |
|
0 commit comments