[SCIP] How to safely release the pricing variable?
杨瑞光
yrgys at foxmail.com
Tue Aug 26 09:42:50 CEST 2025
Hi,
In the process of implementing branch-and-price using C++ and SCIP, I added variables to the model using SCIP_CALL (SCIPaddVar (scip, var)) (a variable in the initial solution of the model) and SCIP_CALL (SCIPaddPricedVar (scip, priced_var, 1.0)) in main.cpp and pricer.cpp, respectively, and added var and priced_var to var_vec (vector<SCIP_VAR*>) using var_vec.push_back (var) and var_vec.push_back (priced_var). However, after releasing variables using SCIP_CALL (SCIPreleaseVar (scip,&var_vec[i])), a memory access conflict occurred when calling SCIP_CALL (SCIPfreeTransform(scip)) and SCIP_CALL(SCIPfree(&scip)).
I tried to disable the pricing function of the model and found that the memory access conflict disappeared. I don't know why this happened. Do I need to perform any other processing on the pricing variables to safely release them?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20250826/742490af/attachment.html>
More information about the Scip
mailing list