NO FRAMES

CPXgetmipcallbackfunc

int CPXPUBLIC CPXgetmipcallbackfunc(CPXCENVptr env, int(CPXPUBLIC **callback_p)(CPXCENVptr, void *, int, void *) , void ** cbhandle_p)
Definition file: cplex.h

The routine CPXgetmipcallbackfunc is used to access the user-written callback routine to be called prior to solving each subproblem in the branch & cut tree during the optimization of a mixed integer program.

This routine works in the same way as the routine CPXgetlpcallbackfunc. 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 CPXgetlpcallbackfunc.

Parameters

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

callback_p

The address of the pointer to the current user-written callback function. If no callback function has been set, the pointer evaluates to NULL.

cbhandle_p

The address of a variable to hold the user's private pointer.

Example

 status = CPXgetmipcallbackfunc (env, mycallback, NULL);
 

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 LP 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 this table.

Indicators of algorithm that called user-written callback
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

Pointer to user private data, as passed to CPXsetmipcallbackfunc.

See Also:

Returns:

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