Skip to content

Commit 591072b

Browse files
committed
Support of bridges with external sets/funcs
1 parent c8e597e commit 591072b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Bridges/singlebridgeoptimizer.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ macro bridge(modelname, bridge, ss, sst, vs, vst, sf, sft, vf, vft)
4545
esc(quote
4646
$MOIU.@model $bridged_model_name $ss $sst $vs $vst $sf $sft $vf $vft
4747
const $modelname{T, OT<:MOI.ModelLike} = $MOIB.SingleBridgeOptimizer{$bridge{T}, $bridged_model_name{T}, OT}
48-
is_bridged(::$modelname, ::Type{<:$bridged_funs}, ::Type{<:$bridged_sets}) = true
48+
MathOptInterface.Bridges.is_bridged(::$modelname, ::Type{<:$bridged_funs}, ::Type{<:$bridged_sets}) = true
4949
supports_bridging_constraint(::$modelname, ::Type{<:$bridged_funs}, ::Type{<:$bridged_sets}) = true
5050
end)
5151
end

src/Utilities/model.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ end
409409
# Expr(:., MOI, :($(QuoteNode(s)))) is Expr(:., MOI, :(:EqualTo)) <- what we want
410410

411411
# (MOI, :Zeros) -> :(MOI.Zeros)
412-
_mod(m::Module, s::Symbol) = Expr(:., m, :($(QuoteNode(s))))
412+
_mod(m::Module, s::Symbol) = s
413413
# (:Zeros) -> :(MOI.Zeros)
414414
_moi(s::Symbol) = _mod(MOI, s)
415415
_set(s::SymbolSet) = _moi(s.s)
@@ -586,7 +586,7 @@ macro model(modelname, ss, sst, vs, vst, sf, sft, vf, vft)
586586
field = _field(s)
587587
code = quote
588588
$code
589-
$funct(model::$c, ci::$T{F, <:$set}, args...) where F = $funct(model.$field, ci, args...)
589+
MathOptInterface.Utilities.$funct(model::$c, ci::$T{F, <:$set}, args...) where F = MathOptInterface.Utilities.$funct(model.$field, ci, args...)
590590
end
591591
end
592592
end
@@ -596,7 +596,7 @@ macro model(modelname, ss, sst, vs, vst, sf, sft, vf, vft)
596596
field = _field(f)
597597
code = quote
598598
$code
599-
$funct(model::$modelname, ci::$T{<:$fun}, args...) = $funct(model.$field, ci, args...)
599+
MathOptInterface.Utilities.$funct(model::$modelname, ci::$T{<:$fun}, args...) = MathOptInterface.Utilities.$funct(model.$field, ci, args...)
600600
end
601601
end
602602
end

0 commit comments

Comments
 (0)