NO FRAMES

CPXsetmipcallbackfunc

int CPXPUBLIC CPXsetmipcallbackfunc(CPXENVptr env, int(CPXPUBLIC *callback)(CPXCENVptr, void *, int, void *) , void * cbhandle)
Definition file: cplex.h
Include files: cplex.h

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.

ValueSymbolic ConstantMeaning
101CPX_CALLBACK_MIPFrom mipopt
107CPX_CALLBACK_MIP_PROBEFrom probing or clique merging
108CPX_CALLBACK_MIP_FRACCUTFrom Gomory fractional cuts
109CPX_CALLBACK_MIP_DISJCUTFrom disjunctive cuts
110CPX_CALLBACK_MIP_FLOWMIRFrom Mixed Integer Rounding cuts

cbhandle

A pointer to user private data as passed to CPXsetmipcallbackfunc.

See Also:

Returns:

The routine returns zero on success and nonzero if an error occurs.