Callbacks

Describes coding conventions of the C API with respect to callbacks.

The Callable Library supports callbacks so that you can define functions that will be called at crucial points in your application:

  • during the presolve process;

  • once per iteration in a linear programming or quadratic programming routine; and

  • at various points, such as before node processing, in a mixed integer optimization.

In addition, callback functions can call CPXgetcallbackinfo to retrieve information about the progress of an optimization algorithm. They can also return a value to indicate whether to terminate an optimization. CPXgetcallbackinfo and certain other callback-specific routines are the only ones of the Callable Library that a user-defined callback may call. (Of course, calls to routines not in the Callable Library are permitted.)

Using legacy optimization callbacks explores callback facilities in greater detail, and Advanced MIP control interface (legacy) discusses control callbacks in particular.