NO FRAMES

CPXcutcallbackadd

public int CPXcutcallbackadd(CPXCENVptr env, void * cbdata, int wherefrom, int nzcnt, double rhs, int sense, const int * cutind, const double * cutval)
Definition file: cplex.h
Note

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

The routine CPXcutcallbackadd adds cuts to the current node LP subproblem during MIP branch & cut. This routine may be called only from within user-written cut callbacks; thus it may be called only when the value of its wherefrom argument is CPX_CALLBACK_MIP_CUT.

The cut may be for the original problem if the parameter CPX_PARAM_MIPCBREDLP was set to CPX_OFF before the call to CPXmipopt that calls the callback. In this case, the parameter CPX_PARAM_PRELINEAR should also be set to CPX_OFF (zero). Otherwise, the cut is used on the presolved problem.

Example

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

See also the example admipex5.c in the standard distribution.

Parameters:

env

A pointer to the CPLEX environment, as returned by 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.

cutind

An array containing the column indices of cut coefficients.

cutval

An array containing the values of cut coefficients.

Returns:

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