Originally posted by: S.U.N.
Thank you for your reply,
I read in detail the documentation, and my understanding is that I should use:
static int CPXPUBLIC MyCutCallBack (CPXCENVptr env, void *cbdata,int wherefrom, void *cbhandle, int *useraction_p)
{
int status, nodeindex, nbinf;
*useraction_p = CPX_CALLBACK_DEFAULT;
status = CPXgetcallbacknodeinfo (env, cbdata, CPX_CALLBACK_MIP_CUT, 0, CPX_CALLBACK_INFO_NODE_NODENUM, &nodeindex);
//To get the node index
status = CPXgetcallbacknodeinfo(env, cbdata, CPX_CALLBACK_MIP_NODE, nodeindex, CPX_CALLBACK_INFO_NODE_NIINF, &nbinf) ;
// to get the number of infeasibilities = fractionnal variables
if (nbinf == 0)
{
// (The current Solution is integer)
}
}
However:
-
the value of wherefrom is always 106 within MyCutCallBack (at least in the tests I ran)
-
I still cannot retrieve the nodeindex: CPXgetcallbacknodeinfo gives an error 1003 and does not give the right value to "nodeindex".
SUN
#CPLEXOptimizers#DecisionOptimization