Callbacks for continuous and discrete problems

Describes when callbacks are invoked and enumerates the arguments of a user-defined callback in the C API.

CPLEX will evaluate two user-defined callback functions, one during the solution of continuous problems and one during the solution of discrete problems. CPLEX calls the continuous callback once per iteration during the solution of an LP, QP, or QCP problem and periodically during the presolve. CPLEX calls the discrete callback periodically during the probing phase of MIP preprocessing, periodically during cut generation, and periodically in the branch & cut process.

Every user-defined callback must have these arguments:

  • env, a pointer to the CPLEX environment;

  • cbdata, a pointer to CPLEX internal data structures needed by CPXgetcallbackinfo;

  • wherefrom, specifies which optimizer is calling the callback;

  • cbhandle, a pointer supplied when your application calls CPXsetlpcallbackfunc or CPXsetmipcallbackfunc (so that the callback has access to private user data).

The arguments wherefrom and cbdata should be used only in calls to CPXgetcallbackinfo.