Skip to content

Commit d66a068

Browse files
committed
fix: 🐛 Return functions to undo relax_integrality
Returns function vector to undo a relaxation operation. Example: https://jump.dev/JuMP.jl/stable/manual/models/#Relax-integrality
1 parent 42f3242 commit d66a068

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/optimizer_interface.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,8 @@ function JuMP.optimize!(node::OptiNode; kwargs...)
383383
end
384384

385385
function JuMP.relax_integrality(graph::OptiGraph)
386-
for node in all_nodes(graph)
387-
JuMP.relax_integrality(jump_model(node))
388-
end
386+
# Returns vector of functions to revert the relaxation. Call via map(x->x()).
387+
return [JuMP.relax_integrality(jump_model(node)) for node in all_nodes(graph)]
389388
end
390389

391390
function set_node_primals(

0 commit comments

Comments
 (0)