CPXCALLBACKFUNC

Prototype for generic callback functions

typedef int CPXPUBLIC CPXCALLBACKFUNC( CPXCALLBACKCONTEXTptr context, CPXLONG contextid, void * userhandle )

Arguments

context

A pointer to an opaque callback context structure. This pointer is passed to routines that can be called from a generic callback, such as CPXXcallbackgetinfoint and CPXcallbackgetinfoint.

contextid
userhandle

The userhandle argument that was passed to CPXXcallbacksetfunc and CPXcallbacksetfunc when the callback was registered.

Return

The routine returns 0 (zero) if successful and nonzero if an error occurs. Any value different from zero will result in an ungraceful exit of CPLEX (usually with CPXERR_CALLBACK). Note that the actual value returned is not propagated up the call stack. The only thing that CPLEX checks is whether the returned value is zero or not.

Do not use a non-zero return value to stop optimization in case there is no error. Use CPXXcallbackabort and CPXcallbackabort for that purpose.

See also