Skip to content

Commit 2bc1708

Browse files
committed
Update
1 parent dd9eb9d commit 2bc1708

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Bridges/bridge_optimizer.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,9 @@ function MOI.get(
14771477
MOI.get(b.model, MOI.ConstraintFunction(), ci)
14781478
end
14791479
f = unbridged_function(b, func)
1480-
return MOI.Utilities.shift_constant(set, -MOI.constant(f))
1480+
g = bridged_function(b, f)
1481+
offset = MOI.constant(g) - MOI.constant(f)
1482+
return MOI.Utilities.shift_constant(set, offset)
14811483
end
14821484

14831485
## Other constraint attributes

test/Bridges/bridge_optimizer.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,12 +1232,12 @@ function test_issue_2452()
12321232
dest = MOI.instantiate(Model2452{Float64}; with_bridge_type = Float64)
12331233
index_map = MOI.copy_to(dest, src)
12341234
set = MOI.get(dest, MOI.ConstraintSet(), index_map[c])
1235-
@test_broken set == MOI.EqualTo(3.0)
1235+
@test set == MOI.EqualTo(3.0)
12361236
MOI.set(dest, MOI.ConstraintSet(), index_map[c], set)
1237-
@test_broken MOI.get(dest, MOI.ConstraintSet(), index_map[c]) == set
1237+
@test MOI.get(dest, MOI.ConstraintSet(), index_map[c]) == set
12381238
new_set = MOI.EqualTo(2.0)
12391239
MOI.set(dest, MOI.ConstraintSet(), index_map[c], new_set)
1240-
@test_broken MOI.get(dest, MOI.ConstraintSet(), index_map[c]) == new_set
1240+
@test MOI.get(dest, MOI.ConstraintSet(), index_map[c]) == new_set
12411241
return
12421242
end
12431243

0 commit comments

Comments
 (0)