CPXXcallbackaddusercuts and CPXcallbackaddusercuts

Add user cuts from CPX_CALLBACKCONTEXT_RELAXATION.

int CPXXcallbackaddusercuts( CPXCALLBACKCONTEXTptrcontext, CPXDIMrcnt, CPXNNZnzcnt, double const *rhs, char const *sense, CPXNNZ const *rmatbeg, CPXDIM const *rmatind, double const *rmatval, int const *purgeable, int const *local )

int CPXcallbackaddusercuts( CPXCALLBACKCONTEXTptrcontext, intrcnt, intnzcnt, double const *rhs, char const *sense, int const *rmatbeg, int const *rmatind, double const *rmatval, int const *purgeable, int const *local )

Description

This routine separates user cuts in callbacks of type CPX_CALLBACKCONTEXT_RELAXATION. Both local and global user cuts can be separated. Cuts can be specified only in the original space.

Important:

You can call this routine more than once in the same callback invocation; CPLEX will accumulate the constraints from all function calls.

Important:

There is no guarantee CPLEX will use the constraints you specify. It will try to do so, but for technical reasons it is not always possible to use the constraints. You can thus not assume that in subsequent callback invocations the relaxation solutions satisfy the constraints you specified here.

Warning: Calling this function is valid only if the callback was invoked in the context CPX_CALLBACKCONTEXT_RELAXATION. In all other contexts, it returns an error.

Arguments

context

The callback context as passed into the callback function.

rcnt

The number of cuts submitted.

nzcnt

The number of nonzeros in the cuts specified.

rhs

Righthand sides for cuts.

sense

Sense for cuts.

rmatbeg

Array of indices into rmatind and rmatval that specify where each cut starts in the sparse representation of the cuts.

rmatind

Indices of nonzero columns in sparse representation of cuts.

rmatval

Coefficients of nonzero columns in sparse representation of cuts.

purgeable

Array of integer values specifying how CPLEX should treat each cut. See the table for possible values.

local

Array of flags that specifies for each cut whether it is only locally valid (value = 1) or globally valid (value = 0).

Table 1. Possible values of purgeable and their meaning
CPX_USECUT_FORCE The cut is added to the relaxation and stays there
CPX_USECUT_PURGE The cut is added to the relaxation but can be purged later on if CPLEX deems the cut ineffective.
CPX_USECUT_FILTER The cut is treated exactly as cuts generated by CPLEX; that is, CPLEX applies its filtering process and can possibly not even add the cut to the relaxation, for example, if CPLEX deems other cuts more effective, or if the cut is too dense.

Return

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