Skip to content

Commit f559840

Browse files
committed
Fix pass_nonvariable_constraints with bridged variables bis (#1367)
1 parent 220641a commit f559840

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Bridges/bridge_optimizer.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ function MOIU.pass_nonvariable_constraints(
360360
if Variable.has_bridges(Variable.bridges(dest))
361361
# The functions may contained bridged variables which needs to be
362362
# substituted so we use the fallback.
363-
MOIU.pass_nonvariable_constraints_fallback(
363+
return MOIU.pass_nonvariable_constraints_fallback(
364364
dest,
365365
src,
366366
idxmap,

test/Bridges/lazy_bridge_optimizer.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,9 @@ end
11791179
ci_bridged = first(MOI.get(model, MOI.ListOfConstraintIndices{F,S}()))
11801180
attr = MOI.ConstraintFunction()
11811181
@test MOI.get(bridged, attr, ci_bridged) f(vi_bridged)
1182-
ci_sdpa = first(MOI.get(model, MOI.ListOfConstraintIndices{F,S}()))
1182+
cis = MOI.get(model, MOI.ListOfConstraintIndices{F,S}())
1183+
@test length(cis) == 1
1184+
ci_sdpa = first(cis)
11831185
func = [1.0, -1.0]'MOI.SingleVariable.(vis_sdpa)
11841186
@test MOI.get(model, attr, ci_sdpa) func
11851187
end

0 commit comments

Comments
 (0)