CPXXgetcallbacklp and CPXgetcallbacklp

The routine CPXXgetcallbacklp/CPXgetcallbacklp retrieves the pointer to the MIP problem that is in use when the user-written callback function is called.

int  CPXXgetcallbacklp( CPXCENVptr env, void * cbdata, int wherefrom, CPXCLPptr * lp_p )

int  CPXgetcallbacklp( CPXCENVptr env, void * cbdata, int wherefrom, CPXCLPptr * lp_p )

Description

Warning:

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 CPXXgetcallbacklp/CPXgetcallbacklp retrieves the pointer to the MIP problem that is in use when the user-written callback function is called. It is the original MIP if the MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) is set to CPX_OFF; otherwise, it is the presolved MIP. To obtain information about the node LP associated with this MIP, use the following routines:

Each of those routines will return node information associated with the original MIP if the MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) is turned off (that is, set to CPX_OFF); otherwise, they return information associated with the presolved MIP.

In contrast, the function CPXXgetcallbacknodelp/CPXgetcallbacknodelp returns a pointer to the node subproblem, which is an LP. Note that the setting of the MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) does not affect this lp pointer. Since CPLEX does not explicitly maintain an unpresolved node LP, the lp pointer will correspond to the presolved node LP unless CPLEX presolve has been turned off or CPLEX has made no presolve reductions at all. Generally, this pointer may be used only in CPLEX Callable Library query routines, such as CPXXsolution/CPXsolution or CPXXgetrows/CPXgetrows.

The routine CPXXgetcallbacklp/CPXgetcallbacklp 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 cbdata passed 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 wherefrom passed to the user-written callback.
lp_p
A pointer to a variable of type CPXLPptr to receive the pointer to the LP problem object, which is a MIP.

Return

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

Example


 status = CPXgetcallbacklp (env, cbdata, wherefrom, &origlp);

See also admipex1.c, admipex2.c, and admipex3.c in the standard distribution.