Skip to content

Commit

Permalink
Fix possibly empty sum in presolve.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Aug 13, 2024
1 parent 2bd5570 commit 7691e55
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/presolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,13 @@ This function adds the upper/lower bounding constraint on the objective function
for the optimization models solved within the OBBT algorithm.
"""
function post_objective_bound(m::Optimizer, bound::Number; kwargs...)
obj_expr = sum(
m.bounding_obj_mip[:coefs][j] *
_index_to_variable_ref(m.model_mip, m.bounding_obj_mip[:vars][j].args[2]) for
j in 1:m.bounding_obj_mip[:cnt]
obj_expr = JuMP.@expression(
m,
sum(
m.bounding_obj_mip[:coefs][j] *
_index_to_variable_ref(m.model_mip, m.bounding_obj_mip[:vars][j].args[2]) for
j in 1:m.bounding_obj_mip[:cnt]
),
)

obj_bound_tol = get_option(m, :presolve_bt_obj_bound_tol)
Expand Down

0 comments on commit 7691e55

Please sign in to comment.