Skip to content

Commit

Permalink
fix addition
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Sep 17, 2024
1 parent 9cc16bf commit 377cf9c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/optimization_container.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ function get_objective_expression(v::ObjectiveFunction)
if iszero(v.variant_terms)
return v.invariant_terms
else
return JuMP.add_to_expression!(v.variant_terms, v.invariant_terms)
# JuMP doesn't support expression conversion from Affn to QuadExpressions
if isa(v.invariant_terms, JuMP.GenericQuadExpr)
return JuMP.add_to_expression!(v.invariant_terms, v.variant_terms)
else
return JuMP.add_to_expression!(v.variant_terms, v.invariant_terms)
end
end
end
get_sense(v::ObjectiveFunction) = v.sense
Expand Down

0 comments on commit 377cf9c

Please sign in to comment.