ILOG CPLEX 11.0 User's Manual > Advanced Programming Techniques > Using Optimization Callbacks > Return Values for Callbacks

A user-written callback should return a nonzero value if the user wishes to stop the optimization and a value of zero otherwise.

For LP, QP, or QCP problems, if the callback returns a nonzero value, the solution process will terminate. If the process was not terminated during the presolve process, the status returned by the function IloCplex::getStatus or the routines CPXsolution or CPXgetstat will be CPX_STAT_ABORT_USER.

For both LP, QP, QCP, and MIP problems, if the LP/QP/QCP callback returns a nonzero value during preprocessing, the optimizer will return the value CPXERR_PRESLV_ABORT, and no solution information will be available.

For MIP problems, if the callback returns a nonzero value, the solution process will terminate and the status returned by IloCplex::getStatus or CPXgetstat will be one of the values in Table 30.4.

Table 30.4 Status of Nonzero Callbacks for MIPs
Symbolic constant 
Meaning 
CPXMIP_ABORT_FEAS 
current solution integer feasible 
CPXMIP_ABORT_INFEAS 
no integer feasible solution found