Skip to content

Commit

Permalink
Fix empty summation
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Aug 14, 2024
1 parent be3cfe0 commit 08a2721
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 @@ -305,10 +305,13 @@ end
function relaxation_model_obbt(m::Optimizer, discretization, bound::Number)
create_obbt_model(m, discretization, bound)

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.model_mip,
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]
),
)

if is_min_sense(m)
Expand Down

0 comments on commit 08a2721

Please sign in to comment.