CPXXcutcallbackaddlocal and CPXcutcallbackaddlocal

The routine CPXXcutcallbackaddlocal/CPXcutcallbackaddlocal adds local cuts during MIP branch and cut.

int  CPXXcutcallbackaddlocal( CPXCENVptr env, void * cbdata, int wherefrom, CPXDIM nzcnt, double rhs, int sense, CPXDIM const * cutind, double const * cutval )

int  CPXcutcallbackaddlocal( CPXCENVptr env, void * cbdata, int wherefrom, int nzcnt, double rhs, int sense, int const * cutind, double const * cutval )

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 CPXXcutcallbackaddlocal/CPXcutcallbackaddlocal adds local cuts during MIP branch and cut. A local cut is one that applies to the current node and the subtree rooted at this node. Global cuts, that is, cuts that apply throughout the branch-and-cut tree, are added with the routine CPXXcutcallbackadd/CPXcutcallbackadd. This routine can be called only from within user-written cut callbacks; thus it can be called only when the value of its argument wherefrom is one of the values with a name beginning CPX_CALLBACK_MIP_CUT_.

The cut may be for the original problem if the parameter MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) was set to CPX_OFF before the call to CPXXmipopt/CPXmipopt that calls the callback. In this case, the linear reduction switch (deprecated) (CPXPARAM_Preprocessing_Linear) should also be set to CPX_OFF (zero). Otherwise, the cut is used on the presolved problem.

Arguments

env
A pointer to the CPLEX environment, as returned by CPXXopenCPLEX/CPXopenCPLEX.
cbdata
The pointer passed to the user-written callback. This argument must be the value of cbdata passed to the user-written callback.
wherefrom
An integer value that reports where the user-written callback was called from. This argument must be the value of wherefrom passed to the user-written callback.
nzcnt
An integer value that specifies the number of coefficients in the cut, or equivalently, the length of the arrays cutind and cutval.
rhs
A double value that specifies the value of the righthand side of the cut.
sense
An integer value that specifies the sense of the cut. The sense must be one of these three values:
  • less than or equal to, designated by 'L'
  • equal to, designated by 'E'
  • greater than or equal to, designated by 'G'
cutind
An array containing the column indices of cut coefficients.
cutval
An array containing the values of cut coefficients.

Return

The routine returns 0 (zero) if successful and nonzero if an error occurs.

Example


 status = CPXcutcallbackaddlocal (env,
                                  cbdata,
                                  wherefrom,
                                  mynzcnt,
                                  myrhs,
                                  'L',
                                  mycutind,
                                  mycutval);