Overview | Group | Tree | Graph | Index | Concepts |
The routine CPXsetmipcallbackfunc
is used to set the
user-written callback routine to be called prior to solving each subproblem
in the branch & cut tree, including the root node, during the
optimization of a mixed integer program and during some cut generation
routines. This routine works in the same way as the routine
CPXsetlpcallbackfunc
. It enables the user to create a
separate callback function to be called during the solution of mixed integer
programming problems. The prototype for the callback function is identical
to that of CPXsetlpcallbackfunc
.
Example
status = CPXsetmipcallbackfunc (env, mycallback, NULL);
Parameters
env
A pointer to the CPLEX environment, as returned by one of the
CPXopenCPLEX
routines.
callback
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 node during optimization and periodically
during the presolve algorithms. This function must be written by the user.
Its prototype is explained in the Callback description.
cbhandle
A pointer to user private data. This pointer will be passed to the callback function.
Callback description
int callback (CPXENVptr env, void *cbdata, int wherefrom, void *cbhandle);
This is the user-written callback routine.
Callback return value
A nonzero terminates the optimization.
Callback arguments
env
A pointer to the CPLEX environment that was passed into the associated optimization routine.
cbdata
A 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 routine
CPXgetcallbackinfo
.
wherefrom
An integer value indicating from which optimization algorithm the user-written callback function was called. Possible values and their meaning appear in the table.
Value | Symbolic Constant | Meaning |
101 | CPX_CALLBACK_MIP | From mipopt |
107 | CPX_CALLBACK_MIP_PROBE | From probing or clique merging |
108 | CPX_CALLBACK_MIP_FRACCUT | From Gomory fractional cuts |
109 | CPX_CALLBACK_MIP_DISJCUT | From disjunctive cuts |
110 | CPX_CALLBACK_MIP_FLOWMIR | From Mixed Integer Rounding cuts |
cbhandle
A pointer to user private data as passed to
CPXsetmipcallbackfunc
.
See Also:
CPXgetcallbackinfo, CPXsetlpcallbackfunc, CPXsetnetcallbackfunc