NO FRAMES

CPXgetcallbacksosinfo

public int CPXgetcallbacksosinfo(CPXCENVptr env, void * cbdata, int wherefrom, int sosindex, int member, int whichinfo, void * result_p)
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 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:

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.

Table 1: Information Requested for a User-Written SOS Callback
Symbolic ConstantC TypeMeaning
CPX_CALLBACK_INFO_SOS_NUMintnumber of SOSs
CPX_CALLBACK_INFO_SOS_TYPEcharone of the values in Table 4
CPX_CALLBACK_INFO_SOS_SIZEintsize of SOS
CPX_CALLBACK_INFO_SOS_IS_FEASIBLEint1 if SOS is feasible 0 if SOS is not
CPX_CALLBACK_INFO_SOS_MEMBER_INDEXintvariable index of memberth member of SOS
CPX_CALLBACK_INFO_SOS_MEMBER_REFVALdoublereference value (weight) of this member
Table 2: SOS Types Returned when whichinfo = CPX_CALLBACK_INFO_SOS_TYPE
Symbolic ConstantSOS Type
CPX_SOS1type 1
CPX_SOS2type 2

Parameters:

env

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

cbdata

The pointer passed to the user-written callback. This parameter must be the value of cbdata passed to the user-written callback.

wherefrom

An integer value indicating where the user-written callback was called from. This parameter must be the value of wherefrom passed to the user-written callback.

sosindex

The index of the special ordered set (SOS) for which information is requested. SOSs are indexed from zero to (numsets - 1) where numsets is the result of calling this routine with a whichinfo value of CPX_CALLBACK_INFO_SOS_NUM.

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, whichinfo = CPX_CALLBACK_INFO_SOS_TYPE).

result_p

A generic pointer to a variable of type double, int, or char. The variable represents the value returned by whichinfo. (The column C Type in the table indicates the type of various values returned by whichinfo.)

Returns:

The routine returns zero if successful and nonzero if an error occurs. If the return value is nonzero, the requested value may not be available.