Originally posted by: SystemAdmin
Wow. This is a really long standing bug. CPXgetcallbackindicatorinfo() with CPX_CALLBACK_INFO_IC_IMPLYING_VAR and CPX_CALLBACK_INFO_IC_IMPLIED_VAR never worked since the introduction of the method in 2005.
The next release will contain a fix for this bug.
What happens due to the bug is that your 'implying' and 'implied' variables just stay unassigned. Unfortunately, there is no work-around with the current version.
What do you mean with "the first and second lines inside the loop are crashing"? In our code I do not see anything that could make the code crash. Just, as I said, that the return value is not assigned.
Btw: you are correctly catching the status of each CPX method call. But why aren't you checking it against zero? I would suggest to change your code to something like this:
status = CPXgetcallbackindicatorinfo(env, cbdata, wherefrom, 0, CPX_CALLBACK_INFO_IC_NUM , &numindic);
if ( status ) goto TERMINATE;
for(int i = 0; i < numindic; i++)
{
status = CPXgetcallbackindicatorinfo(env, cbdata, wherefrom, i, CPX_CALLBACK_INFO_IC_IMPLYING_VAR , &implying);
if ( status ) goto TERMINATE;
status = CPXgetcallbackindicatorinfo(env, cbdata, wherefrom, i, CPX_CALLBACK_INFO_IC_IMPLIED_VAR, &implied);
if ( status ) goto TERMINATE;
status = CPXgetcallbackindicatorinfo(env, cbdata, wherefrom, i, CPX_CALLBACK_INFO_IC_SENSE, &sense);
if ( status ) goto TERMINATE;
status = CPXgetcallbackindicatorinfo(env, cbdata, wherefrom, i, CPX_CALLBACK_INFO_IC_RHS, &rhs);
if ( status ) goto TERMINATE;
status = CPXgetcallbackindicatorinfo(env, cbdata, wherefrom, i, CPX_CALLBACK_INFO_IC_IS_FEASIBLE, &isfeas);
if ( status ) goto TERMINATE;
cout << "x" << implying << " -> x" << implied << sense << rhs << endl;
}
TERMINATE:
if ( status ) {
char err[1024];
CPXgeterrorstring(env, status, err);
cout << err << endl;
}
#CPLEXOptimizers#DecisionOptimization