Description
The CPXsetlpcallbackfunc() is used to modify the user-written callback routine which will be called after each iteration during the optimization of a linear program, and also periodically during the CPLEX presolve algorithm.Return Value
The routine returns a zero on success, and a nonzero if an error occurs.Synopsis
int CPXsetlpcallbackfunc (CPXENVptr env,
int (CPXPUBLIC *callback)
(CPXENVptr, void *, int, void *),
void *cbhandle);
CPXENVptr envThe pointer to the CPLEX environment as returned by one of the
CPXopenCPLEX routines.
int (CPXPUBLIC *callback) (CPXENVptr, void *, int, void *)A pointer to a user-written callback function. Setting callback to NULL will prevent any callback function from being called during optimization. The call to
callback will occur after every iteration during optimization and periodically during the CPLEX presolve algorithms. This function is written by the user, and is prototyped as it appears below.
void *cbhandleA pointer to user private data. This pointer will be passed to the callback function.
int callback (CPXENVptr env,
void *cbdata,
int wherefrom,
void *cbhandle);
CPXENVptr envThe pointer to the CPLEX environment that was passed into the associated optimization routine.
void *cbdataA pointer passed from the optimization routine to the user-written callback function that identifies the problem being optimized. The only purpose for the
cbdata pointer is to pass it to the CPXgetcallbackinfo() routine.
int wherefromAn integer value indicating from which optimization algorithm the user-written callback function was called. Possible values and their meaning appear in the table below.
void *cbhandlePointer to user private data, as passed to
CPXsetlpcallbackfunc() or CPXsetmipcallbackfunc().
status = CPXsetlpcallbackfunc (env, mycallback, NULL);