Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Bridges/Bridges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const CI = MOI.ConstraintIndex
include("bridge.jl")
include("bridge_optimizer.jl")

# Variable bridges
include("Variable/Variable.jl")
# Constraint bridges
include("Constraint/Constraint.jl")

Expand Down
14 changes: 14 additions & 0 deletions src/Bridges/Variable/Variable.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Variable

using MathOptInterface
const MOI = MathOptInterface
const MOIU = MOI.Utilities
const MOIB = MOI.Bridges

# Definition of a variable bridge
include("bridge.jl")

# Mapping between variable indices and bridges
include("map.jl")

end
21 changes: 21 additions & 0 deletions src/Bridges/Variable/bridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,24 @@ function concrete_bridge_type(b::MOIB.AbstractBridgeOptimizer,
S::Type{<:MOI.AbstractSet})
return concrete_bridge_type(MOIB.bridge_type(b, S), S)
end

"""
unbridged_map(bridge::MOI.Bridges.Variable.AbstractBridge,
vi::MOI.VariableIndex)

For a bridged variable in a scalar set, return a tuple of pairs mapping the
variables created by the bridge to an affine expression in terms of the
bridged variable `vi`.

unbridged_map(bridge::MOI.Bridges.Variable.AbstractBridge,
vi::MOI.VariableIndex, i::IndexInVector)

For a bridged variable in a vector set, return a tuple of pairs mapping the
variables created by the bridge to an affine expression in terms of the bridged
variable `vi` corresponding to the `i`th variable of the vector.

If there is no way to recover the expression in terms of the bridged variable
`vi`, return `nothing`. See [`ZerosBridge`](@ref) for an example of bridge
returning `nothing`.
"""
function unbridged_map end
Loading