CPXXgetcallbacknodelp and CPXgetcallbacknodelp

The routine CPXXgetcallbacknodelp/CPXgetcallbacknodelp returns a pointer to the subproblem at the current node from within a user-written callback.

int  CPXXgetcallbacknodelp( CPXCENVptr env, void * cbdata, int wherefrom, CPXLPptr * nodelp_p )

int  CPXgetcallbacknodelp( CPXCENVptr env, void * cbdata, int wherefrom, CPXLPptr * nodelp_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 CPXXgetcallbacknodelp/CPXgetcallbacknodelp returns a pointer to the subproblem at the current node from within a user-written callback. Generally, this pointer may be used only in CPLEX Callable Library query routines, such as CPXXsolution/CPXsolution or CPXXgetrows/CPXgetrows.

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.

Arguments

env
A pointer to the CPLEX environment, as returned by CPXXopenCPLEX/CPXopenCPLEX.
cbdata
The cbdata 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 where the user-written callback was called from. This argument must be the value of the wherefrom passed to the user-written callback.
nodelp_p
The lp pointer specifying the current subproblem. If no subproblem is defined, the pointer is set to NULL.

Return

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

Example


 status = CPXgetcallbacknodelp (env, cbdata, wherefrom, &nodelp);

See also the example admipex1.c and admipex6.c in the standard distribution.

Do not call this routine with wherefrom==CPX_CALLBACK_MIP_DELETENODE. Do not call this routine with wherefrom==CPX_CALLBACK_MIP_NODE. In other words, CPXXgetcallbacknodelp/CPXgetcallbacknodelp can be called only when its argument wherefrom has one of the following values:

  • CPX_CALLBACK_MIP,
  • CPX_CALLBACK_MIP_BRANCH,
  • CPX_CALLBACK_MIP_CUT_FEAS,
  • CPX_CALLBACK_MIP_CUT_LOOP,
  • CPX_CALLBACK_MIP_CUT_LAST,
  • CPX_CALLBACK_MIP_CUT_UNBD,
  • CPX_CALLBACK_MIP_DISJCUT,
  • CPX_CALLBACK_MIP_FLOWMIR,
  • CPX_CALLBACK_MIP_FRACCUT,
  • CPX_CALLBACK_MIP_HEURISTIC,
  • CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN,
  • CPX_CALLBACK_MIP_INCUMBENT_NODESOLN,
  • CPX_CALLBACK_MIP_INCUMBENT_USERSOLN,
  • CPX_CALLBACK_MIP_PROBE, or
  • CPX_CALLBACK_MIP_SOLVE.

When the wherefrom argument has the value CPX_CALLBACK_MIP_SOLVE, the subproblem pointer may also be used in CPLEX optimization routines.

Warning: Any modification to the subproblem may result in corruption of the problem and of the CPLEX environment.
A nonzero return value may mean that the requested value is not available.