Skip to content

Commit

Permalink
Fix GUB constraint not released
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed May 7, 2021
1 parent 2e1a8db commit 99b8a73
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libecole/src/scip/gub-branch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,20 @@ static SCIP_RETCODE SCIPbranchGUB_add_child(
SCIP_Real lhs,
SCIP_Real rhs,
SCIP_NODE** node_out) {
// TODO decide on priorities
SCIP_NODE* node = nullptr;
SCIP_CALL(SCIPcreateChild(scip, &node, priority, estimate));
auto name = fmt::format("branching-{}", SCIPnodeGetNumber(node));
SCIP_CONS* cons = nullptr;
SCIP_CALL(SCIPcreateConsBasicLinear(scip, &cons, name.c_str(), nvars, vars, ones, lhs, rhs));
SCIP_CALL(SCIPaddConsNode(scip, node, cons, nullptr));
SCIP_RETCODE retcode = SCIP_OKAY;
SCIP_CALL_TERMINATE(retcode, SCIPaddConsNode(scip, node, cons, nullptr), TERM);
if (node_out != nullptr) {
*node_out = node;
}
return SCIP_OKAY;

TERM:
SCIP_CALL(SCIPreleaseCons(scip, &cons));
return retcode;
}

SCIP_RETCODE
Expand Down

0 comments on commit 99b8a73

Please sign in to comment.