CPXXgetlazyconstraintcallbackfunc and CPXgetlazyconstraintcallbackfunc

The routine CPXXgetlazyconstraintcallbackfunc/CPXgetlazyconstraintcallbackfunc accesses the user-written callback for adding lazy constraints.

int  CPXXgetlazyconstraintcallbackfunc( CPXCENVptr env, int(CPXPUBLIC **cutcallback_p)(CPXX_CALLBACK_CUT_ARGS), void ** cbhandle_p )

int  CPXgetlazyconstraintcallbackfunc( CPXCENVptr env, int(CPXPUBLIC **cutcallback_p)(CALLBACK_CUT_ARGS), void ** cbhandle_p )

Description

Warning:

This is an advanced routine. Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead.

The routine CPXXgetlazyconstraintcallbackfunc/CPXgetlazyconstraintcallbackfunc accesses the user-written callback for adding lazy constraints. The user-written callback is called by CPLEX in these situations:

  • when CPLEX compares an integer-feasible solution, including one provided by a MIP start before any nodes exist, with lazy constraints;
  • when the LP at a node is unbounded, and a lazy constraint might cut off the primal ray.
Tip:

The routine CPXXgetlazyconstraintcallbackfunc/CPXgetlazyconstraintcallbackfunc and its analog CPXXgetusercutcallbackfunc/CPXgetusercutcallbackfunc replace the deprecated routine CPXgetcutcallbackfunc, which will be removed in a future release. Do not use the deprecated routine in the same application as either of its replacements.

Arguments

env

A pointer to the CPLEX environment, as returned by CPXXopenCPLEX/CPXopenCPLEX.

cutcallback_p

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

cbhandle_p

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

Return

The routine returns 0 (zero) if successful or an error code otherwise.

Example


 CPXgetcutcallbackfunc(env, &cutcallback_p, &cbhandle_p);
 

See also the topic Advanced MIP control interface in the CPLEX User's Manual.