CPXXgetcallbackctype and CPXgetcallbackctype
The routine CPXXgetcallbackctype/CPXgetcallbackctype retrieves the ctypes
for the MIP problem from within a user-written callback during MIP
optimization.
int CPXXgetcallbackctype( CPXCENVptr env, void * cbdata, int wherefrom, char * xctype, CPXDIM begin, CPXDIM end )
int CPXgetcallbackctype( CPXCENVptr env, void * cbdata, int wherefrom, char * xctype, int begin, int end )
Description
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 CPXXgetcallbackctype/CPXgetcallbackctype retrieves the ctypes
for the MIP problem from within a user-written callback during MIP
optimization. The values are from the original problem if the
MIP callback switch between original model and reduced, presolved model
(CPXPARAM_MIP_Strategy_CallbackReducedLP)
is set to CPX_OFF. Otherwise,
they are from the presolved problem.
This routine can be called from any MIP callback.
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
cbdatapassed to the user-written callback. - wherefrom
-
An integer value reporting from where the user-written callback was called. The argument must be the value of
wherefrompassed to the user-written callback. - xctype
-
An array where the ctype values for the MIP problem will be returned. The array must be of length at least (
end-begin+1). The type of variablejis returned inctype[j-begin]. See the routineCPXXcopyctype/CPXcopyctypefor a list of possible values for the variables inxctype. If successful,xctype[0]throughxctype[end-begin]contain the variable types. - begin
- An integer specifying the beginning of the range of ctype values to be returned.
- end
- An integer specifying the end of the range of ctype values to be returned.
Return
The routine returns 0 (zero) if successful and nonzero if an error occurs.Example
status = CPXgetcallbackctype (env, cbdata, wherefrom,
prectype, 0, precols-1);