Overview | Group | Index | Concepts |
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 CPXgetcallbacksosinfo
accesses information
about special ordered sets (SOSs) during MIP optimization from within
user-written callbacks. This routine may be called only when the value of
its wherefrom
argument is one of these values:
CPX_CALLBACK_MIP_HEURISTIC
,
CPX_CALLBACK_MIP_BRANCH
,
CPX_CALLBACK_MIP_INCUMBENT
, or
CPX_CALLBACK_MIP_CUT
.
The information returned is for the original problem if the parameter
CPX_PARAM_MIPCBREDLP
is set to CPX_OFF
before the
call to CPXmipopt
that calls the callback. Otherwise, it is
for the presolved problem.
Example
status = CPXgetcallbacksosinfo(env, curlp, wherefrom, 6, 4, CPX_CALLBACK_INFO_SOS_IS_FEASIBLE, &isfeasible);
See also the example admipex3.c
in the standard distribution.
Symbolic Constant | C Type | Meaning |
---|---|---|
CPX_CALLBACK_INFO_SOS_NUM | int | number of SOSs |
CPX_CALLBACK_INFO_SOS_TYPE | char | one of the values in Table 4 |
CPX_CALLBACK_INFO_SOS_SIZE | int | size of SOS |
CPX_CALLBACK_INFO_SOS_IS_FEASIBLE | int | 1 if SOS is feasible 0 if SOS is not |
CPX_CALLBACK_INFO_SOS_MEMBER_INDEX | int | variable index of memberth member of SOS |
CPX_CALLBACK_INFO_SOS_MEMBER_REFVAL | double | reference value (weight) of this member |
Symbolic Constant | SOS Type |
---|---|
CPX_SOS1 | type 1 |
CPX_SOS2 | type 2 |
env | A pointer to the CPLEX environment, as returned by |
cbdata | The pointer passed to the user-written callback. This parameter must be the value of |
wherefrom | An integer value indicating where the user-written callback was called from. This parameter must be the value of |
sosindex | The index of the special ordered set (SOS) for which information is requested. SOSs are indexed from zero to |
member | The index of the member of the SOS for which information is requested. |
whichinfo | An integer indicating which information is requested. Table 1 summarizes the possible values. Table 2 summarizes possible values returned when the type of information requested is the SOS type (that is, |
result_p | A generic pointer to a variable of type |