You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
will additionally support constrained variables in [`GreaterThan`](@ref).
955
+
Note that these [`Bridges.Variable.SingleBridgeOptimizer`](@ref) are mainly
956
+
used for testing bridges. It is recommended to rather use
957
+
[`Bridges.full_bridge_optimizer`](@ref), which automatically selects the
958
+
appropriate bridges for unsupported constrained variables.
959
+
934
960
#### Constraint reformulation
935
961
936
-
A constraint often possess different equivalent formulations, but a solver may only support one of them.
937
-
It would be duplicate work to implement rewritting rules in every solver wrapper for every different formulation of the constraint to express it in the form supported by the solver.
938
-
Constraint bridges provide a way to define a rewritting rule on top of the MOI interface which can be used by any optimizer.
962
+
A constraint often possesses different equivalent formulations, but a solver may only support one of them.
963
+
It would be duplicate work to implement rewriting rules in every solver wrapper for every different formulation of the constraint to express it in the form supported by the solver.
964
+
Constraint bridges provide a way to define a rewriting rule on top of the MOI interface which can be used by any optimizer.
939
965
Some rules also implement constraint modifications and constraint primal and duals translations.
940
966
941
-
For example, the `SplitIntervalBridge` defines the reformulation of a `ScalarAffineFunction`-in-`Interval` constraint into a `ScalarAffineFunction`-in-`GreaterThan` and a `ScalarAffineFunction`-in-`LessThan` constraint.
942
-
The `SplitInterval` is the bridge optimizer that applies the `SplitIntervalBridge` rewritting rule.
943
-
Given an optimizer `optimizer` implementing `ScalarAffineFunction`-in-`GreaterThan` and `ScalarAffineFunction`-in-`LessThan`, the optimizer
944
-
```
945
-
bridgedoptimizer = SplitInterval(optimizer)
967
+
For example, the [`Bridges.Constraint.SplitIntervalBridge`](@ref) defines the
968
+
reformulation of a [`ScalarAffineFunction`](@ref)-in-[`Interval`](@ref)
969
+
constraint into a [`ScalarAffineFunction`](@ref)-in-[`GreaterThan`](@ref) and a
ERROR: Cannot unbridge function because some variables are bridged by variable bridges that do not support reverse mapping, e.g., `ZerosBridge`.
607
+
Stacktrace:
608
+
[1] error(::String, ::String, ::String) at ./error.jl:42
609
+
[2] throw_if_cannot_unbridge at /home/blegat/.julia/dev/MathOptInterface/src/Bridges/Variable/map.jl:343 [inlined]
610
+
[3] unbridged_function(::MOI.Bridges.Variable.SingleBridgeOptimizer{MOI.Bridges.Variable.ZerosBridge{Float64},MOI.Utilities.Model{Float64}}, ::MOI.ScalarAffineFunction{Float64}) at /home/blegat/.julia/dev/MOI/src/Bridges/bridge_optimizer.jl:920
611
+
[4] top-level scope at none:0
612
+
```
613
+
614
+
```@docs
615
+
Bridges.Variable.AbstractBridge
616
+
Bridges.bridged_variable_function
617
+
Bridges.unbridged_variable_function
492
618
```
493
619
494
-
Below is the list of bridges implemented in this package.
620
+
Below is the list of variable bridges implemented in this package.
621
+
```@docs
622
+
Bridges.Variable.ZerosBridge
623
+
Bridges.Variable.FreeBridge
624
+
Bridges.Variable.NonposToNonnegBridge
625
+
Bridges.Variable.VectorizeBridge
626
+
Bridges.Variable.RSOCtoPSDBridge
627
+
```
628
+
629
+
For each bridge defined in this package, a corresponding
630
+
[`Bridges.Variable.SingleBridgeOptimizer`](@ref) is available with the same
631
+
name without the "Bridge" suffix, e.g., `SplitInterval` is a
632
+
`SingleBridgeOptimizer` for the `SplitIntervalBridge`. Moreover, they are all
633
+
added in the [`Bridges.LazyBridgeOptimizer`](@ref) returned by
634
+
[`Bridges.full_bridge_optimizer`](@ref) as it calls
635
+
[`Bridges.Variable.add_all_bridges`](@ref).
636
+
```@docs
637
+
Bridges.Variable.SingleBridgeOptimizer
638
+
Bridges.Variable.add_all_bridges
639
+
```
640
+
641
+
### Constraint bridges
642
+
643
+
When constraints are added with [`add_constraint`](@ref), constraint bridges
644
+
allow to return *bridged constraints* that do not correspond to
645
+
constraints of the underlying model. These constraints were enforced by an
646
+
equivalent formulation that added constraints (and possibly also variables) in
For each bridge defined in this package, a corresponding bridge optimizer is available with the same name without the "Bridge" suffix, e.g., `SplitInterval` is an `SingleBridgeOptimizer` for the `SplitIntervalBridge`.
518
-
Moreover, a `LazyBridgeOptimizer` with all the bridges defined in this package can be obtained with
719
+
For each bridge defined in this package, a corresponding
720
+
[`Bridges.Constraint.SingleBridgeOptimizer`](@ref) is available with the same
721
+
name without the "Bridge" suffix, e.g., `SplitInterval` is a
722
+
`SingleBridgeOptimizer` for the `SplitIntervalBridge`. Moreover, they are all
723
+
added in the [`Bridges.LazyBridgeOptimizer`](@ref) returned by
724
+
[`Bridges.full_bridge_optimizer`](@ref) as it calls
725
+
[`Bridges.Constraint.add_all_bridges`](@ref).
519
726
```@docs
520
-
Bridges.full_bridge_optimizer
727
+
Bridges.Constraint.SingleBridgeOptimizer
728
+
Bridges.Constraint.add_all_bridges
521
729
```
522
730
523
731
### Bridge interface
524
732
525
733
A bridge should implement the following functions to be usable by a bridge optimizer:
0 commit comments