-
Notifications
You must be signed in to change notification settings - Fork 285
Description
I am wondering if it would be better to replace the line if (cb_in) *cb_in = cc_in; in the method setCallback(), file Highs.cpp, with the following line
if (cb_in) cb_in->user_interrupt = (cc_in.user_interrupt != 0);
because if I understand it correctly, the C callback modifies cb_in directly via cbdata. Functions like Highs_setCallbackSolution modify the C++ object (cb_in) directly through the cbdata pointer, so cb_in already has the updated state. It suffices to only copy back the interrupt flag which might have been modified directly in cc_in.
In my experiment, the original code does not work if I inject a feasible solution to the MIP solver at the root node, right after the LP relaxation has been solved for the first time. With this modification, it works. My implementation is based on the C API.