Skip to content

Commit 9842ec4

Browse files
committed
Fix dual objective value with free variable
1 parent 6914b62 commit 9842ec4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/MOI_wrapper.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -2271,9 +2271,10 @@ function _active_bound(l, x, u, d)
22712271
end
22722272
elseif isfinite(l)
22732273
return l
2274-
else
2275-
@assert isfinite(u)
2274+
elseif isfinite(u)
22762275
return u
2276+
else
2277+
return 0.0
22772278
end
22782279
end
22792280

test/MOI_wrapper.jl

+2
Original file line numberDiff line numberDiff line change
@@ -941,11 +941,13 @@ function test_active_bound()
941941
(0.0, 1.0, 1.0, -2.0) => 1.0,
942942
(0.0, 0.6, 1.0, -2.0) => 1.0,
943943
(0.0, 0.6, 1.0, 2.0) => 1.0, # incorrect d but doesn't matter
944+
(-Inf, 0.0, Inf, 0.0) => 0.0,
944945
# It's a ray. Choose based on sign
945946
(0.0, NaN, 1.0, 2.0) => 0.0,
946947
(0.0, NaN, 1.0, 1e-10) => 0.0,
947948
(0.0, NaN, 1.0, -2.0) => 1.0,
948949
(0.0, NaN, 1.0, -1e-10) => 1.0,
950+
(-Inf, NaN, Inf, 0.0) => 0.0,
949951
# It's a one-sided ray
950952
(0.0, NaN, Inf, 2.0) => 0.0,
951953
(0.0, NaN, Inf, -1e-10) => 0.0,

0 commit comments

Comments
 (0)